1 Qualcomm's PM8xxx voltage XOADC
3 The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
4 oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921.
8 - compatible: should be one of:
14 - reg: should contain the ADC base address in the PMIC, typically
17 - xoadc-ref-supply: should reference a regulator that can supply
18 a reference voltage on demand. The reference voltage may vary
19 with PMIC variant but is typically something like 2.2 or 1.8V.
21 The following required properties are standard for IO channels, see
22 iio-bindings.txt for more details, but notice that this particular
23 ADC has a special addressing scheme that require two cells for
24 identifying each ADC channel:
26 - #address-cells: should be set to <2>, the first cell is the
27 prescaler (on PM8058) or premux (on PM8921) with two valid bits
28 so legal values are 0x00, 0x01 or 0x02. The second cell
29 is the main analog mux setting (0x00..0x0f). The combination
30 of prescaler/premux and analog mux uniquely addresses a hardware
31 channel on all systems.
33 - #size-cells: should be set to <0>
35 - #io-channel-cells: should be set to <2>, again the cells are
36 precaler or premux followed by the analog muxing line.
38 - interrupts: should refer to the parent PMIC interrupt controller
39 and reference the proper ADC interrupt.
43 The ADC channels are configured as subnodes of the ADC.
45 Since some of them are used for calibrating the ADC, these nodes are
60 These three nodes are used for absolute and ratiometric calibration
61 and only need to have these reg values: they are by hardware definition
62 1:1 ratio converters that sample 625, 1250 and 0 milliV and create
63 an interpolation calibration for all other ADCs.
65 Optional subnodes: any channels other than channels [0x00 0x0c],
66 [0x00 0x0d] and [0x00 0x0f] are optional.
68 Required channel node properties:
70 - reg: should contain the hardware channel number in the range
73 Optional channel node properties:
77 Definition: This parameter is used to decrease the ADC sampling rate.
78 Quicker measurements can be made by reducing the decimation ratio.
79 Valid values are 512, 1024, 2048, 4096.
80 If the property is not found, a default value of 512 will be used.
84 Definition: Channel calibration type. If this property is specified
85 VADC will use a special voltage references for channel
86 calibration. The available references are specified in the
87 as a u32 value setting (see below) and it is compulsory
88 to also specify this reference if ratiometric calibration
91 If the property is not found, the channel will be
92 calibrated with the 0.625V and 1.25V reference channels, also
93 known as an absolute calibration.
94 The reference voltage pairs when using ratiometric calibration:
99 4 = XOADC_GND/XOADC_GND
100 5 = XOADC_VREF/XOADC_GND
105 compatible = "qcom,pm8058-adc";
107 interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>;
108 #address-cells = <2>;
110 #io-channel-cells = <2>;
112 vcoin: adc-channel@0 {
115 vbat: adc-channel@1 {
118 dcin: adc-channel@2 {
121 ichg: adc-channel@3 {
124 vph_pwr: adc-channel@4 {
127 usb_vbus: adc-channel@a {
130 die_temp: adc-channel@b {
133 ref_625mv: adc-channel@c {
136 ref_1250mv: adc-channel@d {
139 ref_325mv: adc-channel@e {
142 ref_muxoff: adc-channel@f {
147 /* IIO client node */
149 compatible = "iio-hwmon";
150 io-channels = <&xoadc 0x00 0x01>, /* Battery */
151 <&xoadc 0x00 0x02>, /* DC in (charger) */
152 <&xoadc 0x00 0x04>, /* VPH the main system voltage */
153 <&xoadc 0x00 0x0b>, /* Die temperature */
154 <&xoadc 0x00 0x0c>, /* Reference voltage 1.25V */
155 <&xoadc 0x00 0x0d>, /* Reference voltage 0.625V */
156 <&xoadc 0x00 0x0e>; /* Reference voltage 0.325V */