0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/adc/qcom,pm8018-adc.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Qualcomm's PM8xxx voltage XOADC
0008
0009 maintainers:
0010 - Linus Walleij <linus.walleij@linaro.org>
0011
0012 description: |
0013 The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
0014 oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921.
0015
0016 properties:
0017 compatible:
0018 enum:
0019 - qcom,pm8018-adc
0020 - qcom,pm8038-adc
0021 - qcom,pm8058-adc
0022 - qcom,pm8921-adc
0023
0024 reg:
0025 maxItems: 1
0026 description:
0027 ADC base address in the PMIC, typically 0x197.
0028
0029 xoadc-ref-supply:
0030 description:
0031 The reference voltage may vary with PMIC variant but is typically
0032 something like 2.2 or 1.8V.
0033
0034 interrupts:
0035 maxItems: 1
0036
0037 "#address-cells":
0038 const: 2
0039 description:
0040 The first cell is the prescaler (on PM8058) or premux (on PM8921)
0041 with two valid bits so legal values are 0x00, 0x01 or 0x02.
0042 The second cell is the main analog mux setting (0x00..0x0f).
0043 The combination of prescaler/premux and analog mux uniquely addresses
0044 a hardware channel on all systems.
0045
0046 "#size-cells":
0047 const: 0
0048
0049 "#io-channel-cells":
0050 const: 2
0051 description:
0052 The cells are precaler or premux followed by the analog muxing line.
0053
0054 additionalProperties: false
0055
0056 required:
0057 - compatible
0058 - reg
0059 - "#io-channel-cells"
0060 - "#address-cells"
0061 - "#size-cells"
0062 - adc-channel@c
0063 - adc-channel@d
0064 - adc-channel@f
0065
0066 patternProperties:
0067 "^(adc-channel@)[0-9a-f]$":
0068 type: object
0069 description: |
0070 ADC channel specific configuration.
0071 Note that channels c, d and f must be present for calibration.
0072 These three nodes are used for absolute and ratiometric calibration
0073 and only need to have these reg values: they are by hardware definition
0074 1:1 ratio converters that sample 625, 1250 and 0 milliV and create
0075 an interpolation calibration for all other ADCs.
0076
0077 properties:
0078 reg:
0079 maxItems: 1
0080
0081 qcom,decimation:
0082 $ref: /schemas/types.yaml#/definitions/uint32
0083 description: |
0084 This parameter is used to decrease the ADC sampling rate.
0085 Quicker measurements can be made by reducing the decimation ratio.
0086 Valid values are 512, 1024, 2048, 4096.
0087 If the property is not found, a default value of 512 will be used.
0088
0089 qcom,ratiometric:
0090 $ref: /schemas/types.yaml#/definitions/uint32
0091 description: |
0092 Channel calibration type. If this property is specified
0093 VADC will use a special voltage references for channel
0094 calibration. The available references are specified in the
0095 as a u32 value setting (see below) and it is compulsory
0096 to also specify this reference if ratiometric calibration
0097 is selected.
0098
0099 If the property is not found, the channel will be
0100 calibrated with the 0.625V and 1.25V reference channels, also
0101 known as an absolute calibration.
0102
0103 The reference voltage pairs when using ratiometric calibration:
0104 0 = XO_IN/XOADC_GND
0105 1 = PMIC_IN/XOADC_GND
0106 2 = PMIC_IN/BMS_CSP
0107 3 (invalid)
0108 4 = XOADC_GND/XOADC_GND
0109 5 = XOADC_VREF/XOADC_GND
0110
0111 additionalProperties: false
0112
0113 required:
0114 - reg
0115
0116 examples:
0117 - |
0118 #include <dt-bindings/interrupt-controller/irq.h>
0119 pmic {
0120 #address-cells = <1>;
0121 #size-cells = <0>;
0122
0123 adc@197 {
0124 compatible = "qcom,pm8058-adc";
0125 reg = <0x197>;
0126 interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>;
0127 #address-cells = <2>;
0128 #size-cells = <0>;
0129 #io-channel-cells = <2>;
0130
0131 vcoin: adc-channel@0 {
0132 reg = <0x00 0x00>;
0133 };
0134 vbat: adc-channel@1 {
0135 reg = <0x00 0x01>;
0136 };
0137 dcin: adc-channel@2 {
0138 reg = <0x00 0x02>;
0139 };
0140 ichg: adc-channel@3 {
0141 reg = <0x00 0x03>;
0142 };
0143 vph_pwr: adc-channel@4 {
0144 reg = <0x00 0x04>;
0145 };
0146 usb_vbus: adc-channel@a {
0147 reg = <0x00 0x0a>;
0148 };
0149 die_temp: adc-channel@b {
0150 reg = <0x00 0x0b>;
0151 };
0152 ref_625mv: adc-channel@c {
0153 reg = <0x00 0x0c>;
0154 };
0155 ref_1250mv: adc-channel@d {
0156 reg = <0x00 0x0d>;
0157 };
0158 ref_325mv: adc-channel@e {
0159 reg = <0x00 0x0e>;
0160 };
0161 ref_muxoff: adc-channel@f {
0162 reg = <0x00 0x0f>;
0163 };
0164 };
0165 };
0166 ...