diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/devicetree/bindings/iio/meter/ina3221.txt | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/iio/meter/ina3221.txt b/Documentation/devicetree/bindings/iio/meter/ina3221.txt index 9444b54dfb87..8d4910280c86 100644 --- a/Documentation/devicetree/bindings/iio/meter/ina3221.txt +++ b/Documentation/devicetree/bindings/iio/meter/ina3221.txt @@ -23,6 +23,37 @@ Optional subnode properties: - ti,current-critical-limit-ma: Current critical limit for the given channel. - ti,shunt-resistor-mohm: Shunt register in milli ohm. +IIO channel properties: +It follows same mechanism for iio properties detailed on ../iio-bindings.txt +The iio cells size must be 1. + #io-channel-cells = <1>; +The ina3221 driver provides following monitoring: + voltage, current, current_trigger, power, power_trigger. + The sequence of index assigned in drivers are: + voltage, current, current_trigger, power, power_trigger + The above monitoring is provided for channel 0, 1 and 2. +The sysfs are + in_voltage0_input, in_current0_input, in_current0_trigger_input + in_power0_input, in_power0_trigger_input + in_voltage1_input, in_current1_input, in_current1_trigger_input, + in_power1_input, in_power1_trigger_input + in_voltage2_input, in_current2_input, in_current2_trigger_input, + in_power2_input,in_power2_trigger_input +The channel index are in above sequence starting from 0. + +To ease the DT entry, the macros are added in header dt-bindings/iio/meter/ina3221x.h +The Voltage/current/power macros are defines and can be use with INA3221_CHAN_INDEX to +get the proper index. +Example: For Channel 0, normal power it is INA3221_CHAN_INDEX(0, POWER, NORMAL) +for channel 2, normal current it is INA3221_CHAN_INDEX(2, CURRENT, NORMAL). + +The typical macro for voltage/current and powers are: + INA3221_VOLTAGE, INA3221_CURRENT, INA3221_POWER +The typical macro for normal/trigger are INA3221_NORMAL and INA3221_TRIGGER. + +The INA3221_CHAN_INDEX defined as: +#define INA3221_CHAN_INDEX(chan, type, add) (chan * 5 + INA3221_##type + INA3221_##add) + Example: ina3221x@40 { compatible = "ti,ina3221x"; @@ -31,6 +62,7 @@ Example: ti,continuous-config = <0x7c07>; #address-cells = <1>; #size-cells = <0>; + #io-channel-cells = <1>; channel@0 { reg = <0x0>; @@ -53,3 +85,8 @@ Example: }; }; + +clients { + io-channels = <&ina3221x INA3221_CHAN_INDEX(0, CURRENT, NORMAL)>; + io-channel-names = "battery-current" +} |