1 Qualcomm's SPMI PMIC ADC
3 - SPMI PMIC voltage ADC (VADC) provides interface to clients to read
4 voltage. The VADC is a 15-bit sigma-delta ADC.
5 - SPMI PMIC5 voltage ADC (ADC) provides interface to clients to read
6 voltage. The VADC is a 16-bit sigma-delta ADC.
13 Definition: Should contain "qcom,spmi-vadc".
14 Should contain "qcom,spmi-adc5" for PMIC5 ADC driver.
15 Should contain "qcom,spmi-adc-rev2" for PMIC rev2 ADC driver.
19 Value type: <prop-encoded-array>
20 Definition: VADC base address in the SPMI PMIC register map.
25 Definition: Must be one. Child node 'reg' property should define ADC
31 Definition: Must be zero.
36 Definition: Must be one. For details about IIO bindings see:
37 Documentation/devicetree/bindings/iio/iio-bindings.txt
41 Value type: <prop-encoded-array>
42 Definition: End of conversion interrupt.
44 Channel node properties:
49 Definition: ADC channel number.
50 See include/dt-bindings/iio/qcom,spmi-vadc.h
53 Usage: required for "qcom,spmi-adc5" and "qcom,spmi-adc-rev2"
55 Definition: ADC input of the platform as seen in the schematics.
56 For thermistor inputs connected to generic AMUX or GPIO inputs
57 these can vary across platform for the same pins. Hence select
58 the platform schematics name for this channel.
63 Definition: This parameter is used to decrease ADC sampling rate.
64 Quicker measurements can be made by reducing decimation ratio.
65 - For compatible property "qcom,spmi-vadc", valid values are
66 512, 1024, 2048, 4096. If property is not found, default value
68 - For compatible property "qcom,spmi-adc5", valid values are 250, 420
69 and 840. If property is not found, default value of 840 is used.
70 - For compatible property "qcom,spmi-adc-rev2", valid values are 256,
71 512 and 1024. If property is not present, default value is 1024.
75 Value type: <u32 array>
76 Definition: Used for scaling the channel input signal before the signal is
77 fed to VADC. The configuration for this node is to know the
78 pre-determined ratio and use it for post scaling. Select one from
79 the following options.
80 <1 1>, <1 3>, <1 4>, <1 6>, <1 20>, <1 8>, <10 81>, <1 10>
81 If property is not found default value depending on chip will be used.
86 Definition: Channel calibration type.
87 - For compatible property "qcom,spmi-vadc", if this property is
88 specified VADC will use the VDD reference (1.8V) and GND for
89 channel calibration. If property is not found, channel will be
90 calibrated with 0.625V and 1.25V reference channels, also
91 known as absolute calibration.
92 - For compatible property "qcom,spmi-adc5" and "qcom,spmi-adc-rev2",
93 if this property is specified VADC will use the VDD reference
94 (1.875V) and GND for channel calibration. If property is not found,
95 channel will be calibrated with 0V and 1.25V reference channels,
96 also known as absolute calibration.
98 - qcom,hw-settle-time:
101 Definition: Time between AMUX getting configured and the ADC starting
102 conversion. The 'hw_settle_time' is an index used from valid values
103 and programmed in hardware to achieve the hardware settling delay.
104 - For compatible property "qcom,spmi-vadc" and "qcom,spmi-adc-rev2",
105 Delay = 100us * (hw_settle_time) for hw_settle_time < 11,
106 and 2ms * (hw_settle_time - 10) otherwise.
107 Valid values are: 0, 100, 200, 300, 400, 500, 600, 700, 800,
108 900 us and 1, 2, 4, 6, 8, 10 ms.
109 If property is not found, channel will use 0us.
110 - For compatible property "qcom,spmi-adc5", delay = 15us for
111 value 0, 100us * (value) for values < 11,
112 and 2ms * (value - 10) otherwise.
113 Valid values are: 15, 100, 200, 300, 400, 500, 600, 700, 800,
114 900 us and 1, 2, 4, 6, 8, 10 ms
115 Certain controller digital versions have valid values of
116 15, 100, 200, 300, 400, 500, 600, 700, 1, 2, 4, 8, 16, 32, 64, 128 ms
117 If property is not found, channel will use 15us.
122 Definition: Number of samples to be used for measurement.
123 Averaging provides the option to obtain a single measurement
124 from the ADC that is an average of multiple samples. The value
125 selected is 2^(value).
126 - For compatible property "qcom,spmi-vadc", valid values
127 are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512
128 If property is not found, 1 sample will be used.
129 - For compatible property "qcom,spmi-adc5" and "qcom,spmi-adc-rev2",
130 valid values are: 1, 2, 4, 8, 16
131 If property is not found, 1 sample will be used.
135 For compatible property "qcom,spmi-vadc" following channels, also known as
136 reference point channels, are used for result calibration and their channel
137 configuration nodes should be defined:
138 VADC_REF_625MV and/or VADC_SPARE1(based on PMIC version) VADC_REF_1250MV,
139 VADC_GND_REF and VADC_VDD_VADC.
144 pmic_vadc: vadc@3100 {
145 compatible = "qcom,spmi-vadc";
147 interrupts = <0x0 0x31 0x0 IRQ_TYPE_EDGE_RISING>;
148 #address-cells = <1>;
150 #io-channel-cells = <1>;
155 reg = <VADC_LR_MUX10_USB_ID>;
156 qcom,decimation = <512>;
158 qcom,hw-settle-time = <200>;
159 qcom,avg-samples = <1>;
160 qcom,pre-scaling = <1 3>;
164 /* IIO client node */
166 io-channels = <&pmic_vadc VADC_LR_MUX10_USB_ID>;
167 io-channel-names = "vadc";