devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] iio: adc: ina3221: Add DT binding details
@ 2016-06-01 12:34 Laxman Dewangan
  2016-06-01 12:34 ` [PATCH 2/3] iio: adc: ina3221: Add support for IIO ADC driver for TI INA3221 Laxman Dewangan
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Laxman Dewangan @ 2016-06-01 12:34 UTC (permalink / raw)
  To: robh+dt-DgEjT+Ai2ygdnm+yROfE0A, jic23-DgEjT+Ai2ygdnm+yROfE0A,
	corbet-T1hC0tSOHrs, lars-Qo5EllUWu/uELgA04lAiVw
  Cc: devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA,
	linux-iio-u79uwXL29TY76Z2rM5mHXA, Laxman Dewangan

The INA3221 is a three-channel, high-side current and bus voltage monitor
with an I2C interface from Texas Instruments. The INA3221 monitors both
shunt voltage drops and bus supply voltages in addition to having
programmable conversion times and averaging modes for these signals.
The INA3221 offers both critical and warning alerts to detect multiple
programmable out-of-range conditions for each channel.

Add DT binding details for INA3221 device for configuring device in
different modes and enable multiple functionalities from device.

Signed-off-by: Laxman Dewangan <ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 .../devicetree/bindings/iio/adc/ina3221.txt        | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ina3221.txt

diff --git a/Documentation/devicetree/bindings/iio/adc/ina3221.txt b/Documentation/devicetree/bindings/iio/adc/ina3221.txt
new file mode 100644
index 0000000..9f0908d
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ina3221.txt
@@ -0,0 +1,107 @@
+TI INA3221 DT binding
+
+The INA3221 is a three-channel, high-side current and bus voltage monitor
+with an I2C interface from Texas Instruments. The INA3221 monitors both
+shunt voltage drops and bus supply voltages in addition to having
+programmable conversion times and averaging modes for these signals.
+The INA3221 offers both critical and warning alerts to detect multiple
+programmable out-of-range conditions for each channel.
+
+Required properties:
+-------------------
+- compatible:		Must be "ti,ina3221".
+- reg:			I2C slave device address.
+- #io-channel-cells:	Should be set to 1. The value from the client node
+			represent the channel number.
+
+Optional properties:
+------------------
+one-shot-average-sample:	Integer, Number of sample to average before
+				putting in the registers in oneshot mode.
+
+one-shot-vbus-conv-time-us:	Integer in microseconds, ADC conversion time for
+				bus voltage reading in oneshot mode.
+
+one-shot-shunt-conv-time-us:	Integer in microseconds, ADC conversion time for
+				shunt voltage reading in oneshot mode.
+
+continuous-average-sample:	Integer, Number of sample to average before
+				putting in the registers in continuous mode.
+
+continuous-vbus-conv-time-us:	Integer in microseconds, ADC conversion time for
+				bus voltage reading in continuous mode.
+
+continuous-shunt-conv-time-us:	Integer in microseconds, ADC conversion time for
+				shunt voltage reading in continuous mode.
+
+enable-power-monitor:		Boolean, Enable power monitoring of the device.
+
+enable-continuous-mode:		Boolean. Device support oneshot and continuous
+				mode for the channel data conversion. Presence
+				of this property will enable the continuous
+				mode from boot.
+
+enable-warning-alert:		Boolean, Enable the alert signal when shunt
+				current cross the warning threshold on any of
+				the channel. Absence of this property will not
+				enable the warning alert.
+
+enable-critical-alert:		Boolean, Enable the alert signal when shunt
+				current cross the critical threshold on any
+				of the channel. Absence of this property will
+				not enable the critical alert.
+
+Optional Subnode properties:
+---------------------------
+The channel specific properties are provided as child node of device.
+The fixed child node names of device node used for channel identification.
+
+Child node's name are "channel0" for channel 0, "channel1" for channel 1 and
+"channel2" for channel 2.
+
+Channel specific properties are provided under these child node. Following
+are the properties:
+
+label:					String, the name of the bus.
+shunt-resistor-mohm:			Integer, The shunt resistance on bus
+					in milli-ohm.
+warning-current-limit-microamp:		Integer in microamp, warning current threshold
+					for the channel	to generate warning alert.
+critical-current-limit-microamp:	Integer in microamp, critical current threshold
+					for the channel to generate warning alert.
+
+Example:
+
+i2c@7000c400 {
+	ina3221x@42 {
+		compatible = "ti,ina3221";
+		reg = <0x42>;
+		one-shot-average-sample = <1>;
+		one-shot-vbus-conv-time-us = <140>;
+		one-shot-shunt-conv-time-us = <140>;
+		continuous-average-sample = <64>;
+		continuous-vbus-conv-time-us = <140>;
+		continuous-shunt-conv-time-us = <140>;
+		enable-power-monitor;
+
+		#io-channel-cells = <1>;
+
+		channel0 {
+			label = "VDD_MUX";
+			shunt-resistor-mohm = <20>;
+		};
+
+		channel1 {
+			label = "VDD_5V_IO_SYS";
+			shunt-resistor-mohm = <5>;
+			warning-current-limit-microamp = <8190000>;
+			critical-current-limit-microamp = <1000000>;
+		};
+
+		channel2 {
+			label = "VDD_3V3_SYS";
+			shunt-resistor-mohm = <10>;
+		};
+	};
+};
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2016-06-08 15:37 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-01 12:34 [PATCH 1/3] iio: adc: ina3221: Add DT binding details Laxman Dewangan
2016-06-01 12:34 ` [PATCH 2/3] iio: adc: ina3221: Add support for IIO ADC driver for TI INA3221 Laxman Dewangan
2016-06-03 10:06   ` Jonathan Cameron
2016-06-03 10:16     ` Jonathan Cameron
2016-06-03 11:31       ` Laxman Dewangan
     [not found]         ` <57516A74.4060008-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-03 12:04           ` Jonathan Cameron
     [not found]             ` <42c00dfb-bb45-405c-a1d2-516ece137826-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-06-03 12:03               ` Laxman Dewangan
     [not found]     ` <44e28639-67b6-7586-5e6d-c0180ccded79-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-06-03 11:26       ` Laxman Dewangan
2016-06-03 12:09         ` Jonathan Cameron
2016-06-03 12:17           ` Laxman Dewangan
2016-06-03 13:29     ` Guenter Roeck
2016-06-03 14:14       ` Laxman Dewangan
2016-06-03 15:17         ` Andrew F. Davis
2016-06-07 22:30           ` Guenter Roeck
2016-06-08 15:04             ` Andrew F. Davis
2016-06-08 15:37               ` Laxman Dewangan
2016-06-01 12:34 ` [PATCH 3/3] iio: adc: ina3221: Add sysfs details " Laxman Dewangan
2016-06-03 10:26   ` Jonathan Cameron
     [not found] ` <1464784454-7988-1-git-send-email-ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-03  2:07   ` [PATCH 1/3] iio: adc: ina3221: Add DT binding details Rob Herring
2016-06-03  9:02     ` Laxman Dewangan
2016-06-03 10:19     ` Jonathan Cameron
2016-06-03 11:48       ` Laxman Dewangan
2016-06-03 12:11         ` Jonathan Cameron
2016-06-03 12:21           ` Laxman Dewangan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).