Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

dt-bindings:iio:adc:qcom,pm8018-adc: yaml conversion and rename.

Renamed to match a listed compatible rather than relying on wildcards
with all their usual problems.

Dropped the reference supply as a requirement as at least one dtsi doesn't
include it and the example never did.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20201031184854.745828-36-jic23@kernel.org

+166 -157
+166
Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/qcom,pm8018-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Qualcomm's PM8xxx voltage XOADC 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + description: | 13 + The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal 14 + oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - qcom,pm8018-adc 20 + - qcom,pm8038-adc 21 + - qcom,pm8058-adc 22 + - qcom,pm8921-adc 23 + 24 + reg: 25 + maxItems: 1 26 + description: 27 + ADC base address in the PMIC, typically 0x197. 28 + 29 + xoadc-ref-supply: 30 + description: 31 + The reference voltage may vary with PMIC variant but is typically 32 + something like 2.2 or 1.8V. 33 + 34 + interrupts: 35 + maxItems: 1 36 + 37 + "#address-cells": 38 + const: 2 39 + description: 40 + The first cell is the prescaler (on PM8058) or premux (on PM8921) 41 + with two valid bits so legal values are 0x00, 0x01 or 0x02. 42 + The second cell is the main analog mux setting (0x00..0x0f). 43 + The combination of prescaler/premux and analog mux uniquely addresses 44 + a hardware channel on all systems. 45 + 46 + "#size-cells": 47 + const: 0 48 + 49 + "#io-channel-cells": 50 + const: 2 51 + description: 52 + The cells are precaler or premux followed by the analog muxing line. 53 + 54 + additionalProperties: false 55 + 56 + required: 57 + - compatible 58 + - reg 59 + - "#io-channel-cells" 60 + - "#address-cells" 61 + - "#size-cells" 62 + - adc-channel@c 63 + - adc-channel@d 64 + - adc-channel@f 65 + 66 + patternProperties: 67 + "^(adc-channel@)[0-9a-f]$": 68 + type: object 69 + description: | 70 + ADC channel specific configuration. 71 + Note that channels c, d and f must be present for calibration. 72 + These three nodes are used for absolute and ratiometric calibration 73 + and only need to have these reg values: they are by hardware definition 74 + 1:1 ratio converters that sample 625, 1250 and 0 milliV and create 75 + an interpolation calibration for all other ADCs. 76 + 77 + properties: 78 + reg: 79 + maxItems: 1 80 + 81 + qcom,decimation: 82 + $ref: /schemas/types.yaml#/definitions/uint32 83 + description: | 84 + This parameter is used to decrease the ADC sampling rate. 85 + Quicker measurements can be made by reducing the decimation ratio. 86 + Valid values are 512, 1024, 2048, 4096. 87 + If the property is not found, a default value of 512 will be used. 88 + 89 + qcom,ratiometric: 90 + $ref: /schemas/types.yaml#/definitions/uint32 91 + description: | 92 + Channel calibration type. If this property is specified 93 + VADC will use a special voltage references for channel 94 + calibration. The available references are specified in the 95 + as a u32 value setting (see below) and it is compulsory 96 + to also specify this reference if ratiometric calibration 97 + is selected. 98 + 99 + If the property is not found, the channel will be 100 + calibrated with the 0.625V and 1.25V reference channels, also 101 + known as an absolute calibration. 102 + 103 + The reference voltage pairs when using ratiometric calibration: 104 + 0 = XO_IN/XOADC_GND 105 + 1 = PMIC_IN/XOADC_GND 106 + 2 = PMIC_IN/BMS_CSP 107 + 3 (invalid) 108 + 4 = XOADC_GND/XOADC_GND 109 + 5 = XOADC_VREF/XOADC_GND 110 + 111 + additionalProperties: false 112 + 113 + required: 114 + - reg 115 + 116 + examples: 117 + - | 118 + #include <dt-bindings/interrupt-controller/irq.h> 119 + pmic { 120 + #address-cells = <1>; 121 + #size-cells = <0>; 122 + 123 + adc@197 { 124 + compatible = "qcom,pm8058-adc"; 125 + reg = <0x197>; 126 + interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>; 127 + #address-cells = <2>; 128 + #size-cells = <0>; 129 + #io-channel-cells = <2>; 130 + 131 + vcoin: adc-channel@0 { 132 + reg = <0x00 0x00>; 133 + }; 134 + vbat: adc-channel@1 { 135 + reg = <0x00 0x01>; 136 + }; 137 + dcin: adc-channel@2 { 138 + reg = <0x00 0x02>; 139 + }; 140 + ichg: adc-channel@3 { 141 + reg = <0x00 0x03>; 142 + }; 143 + vph_pwr: adc-channel@4 { 144 + reg = <0x00 0x04>; 145 + }; 146 + usb_vbus: adc-channel@a { 147 + reg = <0x00 0x0a>; 148 + }; 149 + die_temp: adc-channel@b { 150 + reg = <0x00 0x0b>; 151 + }; 152 + ref_625mv: adc-channel@c { 153 + reg = <0x00 0x0c>; 154 + }; 155 + ref_1250mv: adc-channel@d { 156 + reg = <0x00 0x0d>; 157 + }; 158 + ref_325mv: adc-channel@e { 159 + reg = <0x00 0x0e>; 160 + }; 161 + ref_muxoff: adc-channel@f { 162 + reg = <0x00 0x0f>; 163 + }; 164 + }; 165 + }; 166 + ...
-157
Documentation/devicetree/bindings/iio/adc/qcom,pm8xxx-xoadc.txt
··· 1 - Qualcomm's PM8xxx voltage XOADC 2 - 3 - The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal 4 - oscillator ADC) encompassing PM8018, PM8038, PM8058 and PM8921. 5 - 6 - Required properties: 7 - 8 - - compatible: should be one of: 9 - "qcom,pm8018-adc" 10 - "qcom,pm8038-adc" 11 - "qcom,pm8058-adc" 12 - "qcom,pm8921-adc" 13 - 14 - - reg: should contain the ADC base address in the PMIC, typically 15 - 0x197. 16 - 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. 20 - 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: 25 - 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. 32 - 33 - - #size-cells: should be set to <0> 34 - 35 - - #io-channel-cells: should be set to <2>, again the cells are 36 - precaler or premux followed by the analog muxing line. 37 - 38 - - interrupts: should refer to the parent PMIC interrupt controller 39 - and reference the proper ADC interrupt. 40 - 41 - Required subnodes: 42 - 43 - The ADC channels are configured as subnodes of the ADC. 44 - 45 - Since some of them are used for calibrating the ADC, these nodes are 46 - compulsory: 47 - 48 - adc-channel@c { 49 - reg = <0x00 0x0c>; 50 - }; 51 - 52 - adc-channel@d { 53 - reg = <0x00 0x0d>; 54 - }; 55 - 56 - adc-channel@f { 57 - reg = <0x00 0x0f>; 58 - }; 59 - 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. 64 - 65 - Optional subnodes: any channels other than channels [0x00 0x0c], 66 - [0x00 0x0d] and [0x00 0x0f] are optional. 67 - 68 - Required channel node properties: 69 - 70 - - reg: should contain the hardware channel number in the range 71 - 0 .. 0xff (8 bits). 72 - 73 - Optional channel node properties: 74 - 75 - - qcom,decimation: 76 - Value type: <u32> 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. 81 - 82 - - qcom,ratiometric: 83 - Value type: <u32> 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 89 - is selected. 90 - 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: 95 - 0 = XO_IN/XOADC_GND 96 - 1 = PMIC_IN/XOADC_GND 97 - 2 = PMIC_IN/BMS_CSP 98 - 3 (invalid) 99 - 4 = XOADC_GND/XOADC_GND 100 - 5 = XOADC_VREF/XOADC_GND 101 - 102 - Example: 103 - 104 - xoadc: xoadc@197 { 105 - compatible = "qcom,pm8058-adc"; 106 - reg = <0x197>; 107 - interrupts-extended = <&pm8058 76 IRQ_TYPE_EDGE_RISING>; 108 - #address-cells = <2>; 109 - #size-cells = <0>; 110 - #io-channel-cells = <2>; 111 - 112 - vcoin: adc-channel@0 { 113 - reg = <0x00 0x00>; 114 - }; 115 - vbat: adc-channel@1 { 116 - reg = <0x00 0x01>; 117 - }; 118 - dcin: adc-channel@2 { 119 - reg = <0x00 0x02>; 120 - }; 121 - ichg: adc-channel@3 { 122 - reg = <0x00 0x03>; 123 - }; 124 - vph_pwr: adc-channel@4 { 125 - reg = <0x00 0x04>; 126 - }; 127 - usb_vbus: adc-channel@a { 128 - reg = <0x00 0x0a>; 129 - }; 130 - die_temp: adc-channel@b { 131 - reg = <0x00 0x0b>; 132 - }; 133 - ref_625mv: adc-channel@c { 134 - reg = <0x00 0x0c>; 135 - }; 136 - ref_1250mv: adc-channel@d { 137 - reg = <0x00 0x0d>; 138 - }; 139 - ref_325mv: adc-channel@e { 140 - reg = <0x00 0x0e>; 141 - }; 142 - ref_muxoff: adc-channel@f { 143 - reg = <0x00 0x0f>; 144 - }; 145 - }; 146 - 147 - /* IIO client node */ 148 - iio-hwmon { 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 */ 157 - };