1Qualcomm's SPMI PMIC voltage ADC
2
3SPMI PMIC voltage ADC (VADC) provides interface to clients to read
4voltage. The VADC is a 15-bit sigma-delta ADC.
5
6VADC node:
7
8- compatible:
9    Usage: required
10    Value type: <string>
11    Definition: Should contain "qcom,spmi-vadc".
12
13- reg:
14    Usage: required
15    Value type: <prop-encoded-array>
16    Definition: VADC base address and length in the SPMI PMIC register map.
17
18- #address-cells:
19    Usage: required
20    Value type: <u32>
21    Definition: Must be one. Child node 'reg' property should define ADC
22            channel number.
23
24- #size-cells:
25    Usage: required
26    Value type: <u32>
27    Definition: Must be zero.
28
29- #io-channel-cells:
30    Usage: required
31    Value type: <u32>
32    Definition: Must be one. For details about IIO bindings see:
33            Documentation/devicetree/bindings/iio/iio-bindings.txt
34
35- interrupts:
36    Usage: optional
37    Value type: <prop-encoded-array>
38    Definition: End of conversion interrupt.
39
40Channel node properties:
41
42- reg:
43    Usage: required
44    Value type: <u32>
45    Definition: ADC channel number.
46            See include/dt-bindings/iio/qcom,spmi-vadc.h
47
48- qcom,decimation:
49    Usage: optional
50    Value type: <u32>
51    Definition: This parameter is used to decrease ADC sampling rate.
52            Quicker measurements can be made by reducing decimation ratio.
53            Valid values are 512, 1024, 2048, 4096.
54            If property is not found, default value of 512 will be used.
55
56- qcom,pre-scaling:
57    Usage: optional
58    Value type: <u32 array>
59    Definition: Used for scaling the channel input signal before the signal is
60            fed to VADC. The configuration for this node is to know the
61            pre-determined ratio and use it for post scaling. Select one from
62            the following options.
63            <1 1>, <1 3>, <1 4>, <1 6>, <1 20>, <1 8>, <10 81>, <1 10>
64            If property is not found default value depending on chip will be used.
65
66- qcom,ratiometric:
67    Usage: optional
68    Value type: <empty>
69    Definition: Channel calibration type. If this property is specified
70            VADC will use the VDD reference (1.8V) and GND for channel
71            calibration. If property is not found, channel will be
72            calibrated with 0.625V and 1.25V reference channels, also
73            known as absolute calibration.
74
75- qcom,hw-settle-time:
76    Usage: optional
77    Value type: <u32>
78    Definition: Time between AMUX getting configured and the ADC starting
79            conversion. Delay = 100us * (value) for value < 11, and
80            2ms * (value - 10) otherwise.
81            Valid values are: 0, 100, 200, 300, 400, 500, 600, 700, 800,
82            900 us and 1, 2, 4, 6, 8, 10 ms
83            If property is not found, channel will use 0us.
84
85- qcom,avg-samples:
86    Usage: optional
87    Value type: <u32>
88    Definition: Number of samples to be used for measurement.
89            Averaging provides the option to obtain a single measurement
90            from the ADC that is an average of multiple samples. The value
91            selected is 2^(value).
92            Valid values are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512
93            If property is not found, 1 sample will be used.
94
95NOTE:
96
97Following channels, also known as reference point channels, are used for
98result calibration and their channel configuration nodes should be defined:
99VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV,
100VADC_GND_REF and VADC_VDD_VADC.
101
102Example:
103
104	/* VADC node */
105	pmic_vadc: vadc@3100 {
106		compatible = "qcom,spmi-vadc";
107		reg = <0x3100 0x100>;
108		interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
109		#address-cells = <1>;
110		#size-cells = <0>;
111		#io-channel-cells = <1>;
112		io-channel-ranges;
113
114		/* Channel node */
115		usb_id_nopull {
116			reg = <VADC_LR_MUX10_USB_ID>;
117			qcom,decimation = <512>;
118			qcom,ratiometric;
119			qcom,hw-settle-time = <200>;
120			qcom,avg-samples = <1>;
121			qcom,pre-scaling = <1 3>;
122		};
123	};
124
125	/* IIO client node */
126	usb {
127		io-channels = <&pmic_vadc VADC_LR_MUX10_USB_ID>;
128		io-channel-names = "vadc";
129	};
130