xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/iio/afe/current-sense-shunt.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunCurrent Sense Shunt
2*4882a593Smuzhiyun===================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunWhen an io-channel measures the voltage over a current sense shunt,
5*4882a593Smuzhiyunthe interesting measurement is almost always the current through the
6*4882a593Smuzhiyunshunt, not the voltage over it. This binding describes such a current
7*4882a593Smuzhiyunsense circuit.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunRequired properties:
10*4882a593Smuzhiyun- compatible : "current-sense-shunt"
11*4882a593Smuzhiyun- io-channels : Channel node of a voltage io-channel.
12*4882a593Smuzhiyun- shunt-resistor-micro-ohms : The shunt resistance in microohms.
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunExample:
15*4882a593SmuzhiyunThe system current is measured by measuring the voltage over a
16*4882a593Smuzhiyun3.3 ohms shunt resistor.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyunsysi {
19*4882a593Smuzhiyun	compatible = "current-sense-shunt";
20*4882a593Smuzhiyun	io-channels = <&tiadc 0>;
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun	/* Divide the voltage by 3300000/1000000 (or 3.3) for the current. */
23*4882a593Smuzhiyun	shunt-resistor-micro-ohms = <3300000>;
24*4882a593Smuzhiyun};
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun&i2c {
27*4882a593Smuzhiyun	tiadc: adc@48 {
28*4882a593Smuzhiyun		compatible = "ti,ads1015";
29*4882a593Smuzhiyun		reg = <0x48>;
30*4882a593Smuzhiyun		#io-channel-cells = <1>;
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun		#address-cells = <1>;
33*4882a593Smuzhiyun		#size-cells = <0>;
34*4882a593Smuzhiyun
35*4882a593Smuzhiyun		channel@0 { /* IN0,IN1 differential */
36*4882a593Smuzhiyun			reg = <0>;
37*4882a593Smuzhiyun			ti,gain = <1>;
38*4882a593Smuzhiyun			ti,datarate = <4>;
39*4882a593Smuzhiyun		};
40*4882a593Smuzhiyun	};
41*4882a593Smuzhiyun};
42