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