Thread (43 messages) 43 messages, 5 authors, 2021-10-08

Re: [PATCH 8/8] dt-bindings: hwmon: allow specifying channels for tmp421

From: Oskar Senft <hidden>
Date: 2021-09-24 15:37:23
Also in: linux-hwmon

quoted
In many cases the channels are "shared" - we have 3 voltage, 3 current and 3
power sensors but in fact they are not separate sensors but 3 channels
each able to measure 3 different things and they may share some common
properties in each channel (so current, voltage and power may be
calculated bases on the same shunt resistor or correction factor). An
example being adi,ltc2992.  In those cases it doesn't make sense to have
two levels as how would you describe the shared parent? Call it generic
"channels"?
So in that case (e.g. for the nct7802, see [1]) do we want just
1-level, maybe like this:

nct7802@28 {
    compatible = "nuvoton,nct7802";
    reg = <0x28>;

    sensor@1 { /* RTD1 */
         reg = <0x1>;
         status = "okay";
         mode = "thermistor"; /* Any of "thermistor", "thermal-diode",
"voltage" */
    };

    sensor@2 { /* RTD2 */
         reg = <0x2>;
         status = "okay";
         mode = "thermal-diode"; /* Any of "thermistor",
"thermal-diode", "voltage" */
    };

    sensor@3 { /* RTD3 */
         reg = <0x3>;
         status = "okay";
         mode = "voltage"; /* Any of "thermistor", "voltage" */
    };

    sensor@4 { /* LTD */
        reg = <0x4>; /* using the same number as in sysfs */
        status = "okay";
        /* No mode configuration for LTD */
    };
};

In this example, RTD1, RTD2 and LTD would be temperature sensors and
RTD3 would be a voltage sensor.

Would that make more sense? Is the use of strings acceptable?

Thanks
Oskar.

[1] https://lore.kernel.org/all/20210921004627.2786132-1-osk@google.com/ (local)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help