Re: [PATCH 8/8] dt-bindings: hwmon: allow specifying channels for tmp421
From: Guenter Roeck <linux@roeck-us.net>
Date: 2021-09-22 12:39:29
Also in:
linux-hwmon
On Wed, Sep 22, 2021 at 09:22:33AM +0200, Krzysztof Adamski wrote:
Dnia Tue, Sep 21, 2021 at 05:58:31AM -0700, Guenter Roeck napisał(a):quoted
quoted
ti,n-factorn-factor isn't just supported by TI sensors, though it isn't always called n-factor. Maxim (eg MAX6581) uses the term "ideality factor", though they also refer to the factor as "N" in the datasheet. So question is if we make this ti,n-factor and maxim,n-factor, or if we make it generic and define some kind of generic units. Thoughts ? My personal preference would be a generic definition, but is not a strong preference.That was exactly my way of thinking here - many sensors have n-factor parameter and this is the name I see most often. That being said, maybe it should be "nfactor" instead of "n-factor", as this is what tmp513 is using?quoted
In regard to units, the n-factor is, as the name says, a factor. Default value is 1.008. The value range for MAX6581 is 0.999 to 1.030. For TMP421 it is 0.706542 to 1.747977. So the scondary question is if the value written should be the register value (as proposed here) or the absolute factor (eg in micro-units).Since expressing the fractional values in DT isn't well supported and (at least here) hardware guys like to think in terms of register values so this is what I proposed. Also, I just noticed that, for example, TMP531 is using register values as well.
I never see "someone else does that" as valid argument. Also, DT does support fractional values, via units. It is perfectly valid to describe a voltage as micro-volt, for example. If the agreement is to use raw register values, I think the property name should be prefixed with the vendor name, since it won't be a standard property. I'll defer on Rob for that, though. Thanks, Guenter