summaryrefslogtreecommitdiff
path: root/Documentation/devicetree
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2014-04-13 12:18:00 +0530
committerLaxman Dewangan <ldewangan@nvidia.com>2014-04-13 05:36:21 -0700
commitf1d0c94ee899b600173bc504565c813936f5c92f (patch)
tree43bdf66d727964d03b6b591e1078745d4a2a9af8 /Documentation/devicetree
parentfa85b6c99e4f2f335bb20bab7a214c620a9d1b7a (diff)
iio: meter: ina3221: add dt binding header for iio channel support
Update the INA3221x DT binding documents and add dt-binding header to use the macro from DTS file. The updates details how it can be instantiated as iio channels and client driver use this from DT node for measuring different parameters of different channels. It also details the index for different signal monitor which is require for iio channel consumer interface. bug 1413219 Change-Id: I1c31322d4d905983e16ef132c0bd75af29fd0583 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/395549
Diffstat (limited to 'Documentation/devicetree')
-rw-r--r--Documentation/devicetree/bindings/iio/meter/ina3221.txt37
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"
+}