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

dt-bindings: mfd: sprd,sc2731: Convert to YAML

Convert the Spreadtrum SC27xx PMIC bindings to DT schema. Adjust the
filename to match the compatible of the only in-tree user, SC2731.
Change #interrupt-cells value to 1, as according to [1] that is the
correct value.
Move partial examples of child nodes in the child node schemas to this new
MFD schema to have one complete example.

[1] https://lore.kernel.org/lkml/b6a32917d1e231277d240a4084bebb6ad91247e3.1550060544.git.baolin.wang@linaro.org/

Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Link: https://lore.kernel.org/r/efd200c3b5b75405e4e450d064b026f10ae2f8e0.1730709384.git.stano.jakubek@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Stanislav Jakubek and committed by
Lee Jones
131a975a 0d3f0739

+254 -182
-17
Documentation/devicetree/bindings/iio/adc/sprd,sc2720-adc.yaml
··· 85 85 pmic { 86 86 #address-cells = <1>; 87 87 #size-cells = <0>; 88 - adc@480 { 89 - compatible = "sprd,sc2731-adc"; 90 - reg = <0x480>; 91 - interrupt-parent = <&sc2731_pmic>; 92 - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; 93 - #io-channel-cells = <1>; 94 - hwlocks = <&hwlock 4>; 95 - nvmem-cells = <&adc_big_scale>, <&adc_small_scale>; 96 - nvmem-cell-names = "big_scale_calib", "small_scale_calib"; 97 - }; 98 - }; 99 - 100 - - | 101 - #include <dt-bindings/interrupt-controller/irq.h> 102 - pmic { 103 - #address-cells = <1>; 104 - #size-cells = <0>; 105 88 adc@504 { 106 89 compatible = "sprd,ump9620-adc"; 107 90 reg = <0x504>;
-31
Documentation/devicetree/bindings/leds/sprd,sc2731-bltc.yaml
··· 50 50 - '#size-cells' 51 51 52 52 additionalProperties: false 53 - 54 - examples: 55 - - | 56 - #include <dt-bindings/leds/common.h> 57 - 58 - pmic { 59 - #address-cells = <1>; 60 - #size-cells = <0>; 61 - 62 - led-controller@200 { 63 - compatible = "sprd,sc2731-bltc"; 64 - reg = <0x200>; 65 - #address-cells = <1>; 66 - #size-cells = <0>; 67 - 68 - led@0 { 69 - reg = <0x0>; 70 - color = <LED_COLOR_ID_RED>; 71 - }; 72 - 73 - led@1 { 74 - reg = <0x1>; 75 - color = <LED_COLOR_ID_GREEN>; 76 - }; 77 - 78 - led@2 { 79 - reg = <0x2>; 80 - color = <LED_COLOR_ID_BLUE>; 81 - }; 82 - }; 83 - }; 84 53 ...
+252
Documentation/devicetree/bindings/mfd/sprd,sc2731.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/mfd/sprd,sc2731.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Spreadtrum SC27xx PMIC 8 + 9 + maintainers: 10 + - Orson Zhai <orsonzhai@gmail.com> 11 + - Baolin Wang <baolin.wang7@gmail.com> 12 + - Chunyan Zhang <zhang.lyra@gmail.com> 13 + 14 + description: | 15 + Spreadtrum PMICs belonging to the SC27xx series integrate all mobile handset 16 + power management, audio codec, battery management and user interface support 17 + functions in a single chip. They have 6 major functional blocks: 18 + - DCDCs to support CPU, memory 19 + - LDOs to support both internal and external requirements 20 + - Battery management system, such as charger, fuel gauge 21 + - Audio codec 22 + - User interface functions, such as indicator, flash LED and so on 23 + - IC level interface, such as power on/off control, RTC, typec and so on 24 + 25 + properties: 26 + $nodename: 27 + pattern: '^pmic@[0-9a-f]+$' 28 + 29 + compatible: 30 + enum: 31 + - sprd,sc2720 32 + - sprd,sc2721 33 + - sprd,sc2723 34 + - sprd,sc2730 35 + - sprd,sc2731 36 + 37 + reg: 38 + maxItems: 1 39 + 40 + interrupts: 41 + maxItems: 1 42 + 43 + interrupt-controller: true 44 + spi-max-frequency: true 45 + 46 + '#address-cells': 47 + const: 1 48 + 49 + '#interrupt-cells': 50 + const: 1 51 + 52 + '#size-cells': 53 + const: 0 54 + 55 + regulators: 56 + type: object 57 + $ref: /schemas/regulator/sprd,sc2731-regulator.yaml# 58 + 59 + patternProperties: 60 + "^adc@[0-9a-f]+$": 61 + type: object 62 + $ref: /schemas/iio/adc/sprd,sc2720-adc.yaml# 63 + 64 + "^charger@[0-9a-f]+$": 65 + type: object 66 + $ref: /schemas/power/supply/sc2731-charger.yaml# 67 + 68 + "^efuse@[0-9a-f]+$": 69 + type: object 70 + additionalProperties: true 71 + properties: 72 + compatible: 73 + enum: 74 + - sprd,sc2720-efuse 75 + - sprd,sc2721-efuse 76 + - sprd,sc2723-efuse 77 + - sprd,sc2730-efuse 78 + - sprd,sc2731-efuse 79 + 80 + "^fuel-gauge@[0-9a-f]+$": 81 + type: object 82 + $ref: /schemas/power/supply/sc27xx-fg.yaml# 83 + 84 + "^gpio@[0-9a-f]+$": 85 + type: object 86 + $ref: /schemas/gpio/sprd,gpio-eic.yaml# 87 + 88 + "^led-controller@[0-9a-f]+$": 89 + type: object 90 + $ref: /schemas/leds/sprd,sc2731-bltc.yaml# 91 + 92 + "^rtc@[0-9a-f]+$": 93 + type: object 94 + $ref: /schemas/rtc/sprd,sc2731-rtc.yaml# 95 + 96 + "^vibrator@[0-9a-f]+$": 97 + type: object 98 + $ref: /schemas/input/sprd,sc27xx-vibrator.yaml# 99 + 100 + required: 101 + - compatible 102 + - reg 103 + - interrupts 104 + - interrupt-controller 105 + - spi-max-frequency 106 + - '#address-cells' 107 + - '#interrupt-cells' 108 + - '#size-cells' 109 + 110 + additionalProperties: false 111 + 112 + examples: 113 + - | 114 + #include <dt-bindings/gpio/gpio.h> 115 + #include <dt-bindings/interrupt-controller/arm-gic.h> 116 + #include <dt-bindings/interrupt-controller/irq.h> 117 + #include <dt-bindings/leds/common.h> 118 + 119 + spi { 120 + #address-cells = <1>; 121 + #size-cells = <0>; 122 + 123 + sc2731_pmic: pmic@0 { 124 + compatible = "sprd,sc2731"; 125 + reg = <0>; 126 + interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 127 + interrupt-controller; 128 + spi-max-frequency = <26000000>; 129 + #address-cells = <1>; 130 + #interrupt-cells = <1>; 131 + #size-cells = <0>; 132 + 133 + charger@0 { 134 + compatible = "sprd,sc2731-charger"; 135 + reg = <0x0>; 136 + phys = <&ssphy>; 137 + monitored-battery = <&bat>; 138 + }; 139 + 140 + led-controller@200 { 141 + compatible = "sprd,sc2731-bltc"; 142 + reg = <0x200>; 143 + #address-cells = <1>; 144 + #size-cells = <0>; 145 + 146 + led@0 { 147 + reg = <0x0>; 148 + color = <LED_COLOR_ID_RED>; 149 + }; 150 + 151 + led@1 { 152 + reg = <0x1>; 153 + color = <LED_COLOR_ID_GREEN>; 154 + }; 155 + 156 + led@2 { 157 + reg = <0x2>; 158 + color = <LED_COLOR_ID_BLUE>; 159 + }; 160 + }; 161 + 162 + rtc@280 { 163 + compatible = "sprd,sc2731-rtc"; 164 + reg = <0x280>; 165 + interrupt-parent = <&sc2731_pmic>; 166 + interrupts = <2>; 167 + }; 168 + 169 + pmic_eic: gpio@300 { 170 + compatible = "sprd,sc2731-eic"; 171 + reg = <0x300>; 172 + interrupt-parent = <&sc2731_pmic>; 173 + interrupts = <5>; 174 + gpio-controller; 175 + #gpio-cells = <2>; 176 + interrupt-controller; 177 + #interrupt-cells = <2>; 178 + }; 179 + 180 + efuse@380 { 181 + compatible = "sprd,sc2731-efuse"; 182 + reg = <0x380>; 183 + hwlocks = <&hwlock 12>; 184 + #address-cells = <1>; 185 + #size-cells = <1>; 186 + 187 + /* Data cells */ 188 + fgu_calib: calib@6 { 189 + reg = <0x6 0x2>; 190 + bits = <0 9>; 191 + }; 192 + 193 + adc_big_scale: calib@24 { 194 + reg = <0x24 0x2>; 195 + }; 196 + 197 + adc_small_scale: calib@26 { 198 + reg = <0x26 0x2>; 199 + }; 200 + }; 201 + 202 + adc@480 { 203 + compatible = "sprd,sc2731-adc"; 204 + reg = <0x480>; 205 + interrupt-parent = <&sc2731_pmic>; 206 + interrupts = <0>; 207 + #io-channel-cells = <1>; 208 + hwlocks = <&hwlock 4>; 209 + nvmem-cells = <&adc_big_scale>, <&adc_small_scale>; 210 + nvmem-cell-names = "big_scale_calib", "small_scale_calib"; 211 + }; 212 + 213 + fuel-gauge@a00 { 214 + compatible = "sprd,sc2731-fgu"; 215 + reg = <0xa00>; 216 + battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>; 217 + interrupt-parent = <&sc2731_pmic>; 218 + interrupts = <4>; 219 + io-channels = <&pmic_adc 5>, <&pmic_adc 14>; 220 + io-channel-names = "bat-temp", "charge-vol"; 221 + nvmem-cells = <&fgu_calib>; 222 + nvmem-cell-names = "fgu_calib"; 223 + monitored-battery = <&bat>; 224 + sprd,calib-resistance-micro-ohms = <21500>; 225 + }; 226 + 227 + vibrator@ec8 { 228 + compatible = "sprd,sc2731-vibrator"; 229 + reg = <0xec8>; 230 + }; 231 + 232 + regulators { 233 + compatible = "sprd,sc2731-regulator"; 234 + 235 + BUCK_CPU0 { 236 + regulator-name = "vddarm0"; 237 + regulator-min-microvolt = <400000>; 238 + regulator-max-microvolt = <1996875>; 239 + regulator-ramp-delay = <25000>; 240 + regulator-always-on; 241 + }; 242 + 243 + LDO_CAMA0 { 244 + regulator-name = "vddcama0"; 245 + regulator-min-microvolt = <1200000>; 246 + regulator-max-microvolt = <3750000>; 247 + regulator-enable-ramp-delay = <100>; 248 + }; 249 + }; 250 + }; 251 + }; 252 + ...
-40
Documentation/devicetree/bindings/mfd/sprd,sc27xx-pmic.txt
··· 1 - Spreadtrum SC27xx Power Management Integrated Circuit (PMIC) 2 - 3 - The Spreadtrum SC27xx series PMICs contain SC2720, SC2721, SC2723, SC2730 4 - and SC2731. The Spreadtrum PMIC belonging to SC27xx series integrates all 5 - mobile handset power management, audio codec, battery management and user 6 - interface support function in a single chip. It has 6 major functional 7 - blocks: 8 - - DCDCs to support CPU, memory. 9 - - LDOs to support both internal and external requirement. 10 - - Battery management system, such as charger, fuel gauge. 11 - - Audio codec. 12 - - User interface function, such as indicator, flash LED and so on. 13 - - IC level interface, such as power on/off control, RTC and typec and so on. 14 - 15 - Required properties: 16 - - compatible: Should be one of the following: 17 - "sprd,sc2720" 18 - "sprd,sc2721" 19 - "sprd,sc2723" 20 - "sprd,sc2730" 21 - "sprd,sc2731" 22 - - reg: The address of the device chip select, should be 0. 23 - - spi-max-frequency: Typically set to 26000000. 24 - - interrupts: The interrupt line the device is connected to. 25 - - interrupt-controller: Marks the device node as an interrupt controller. 26 - - #interrupt-cells: The number of cells to describe an PMIC IRQ, must be 2. 27 - - #address-cells: Child device offset number of cells, must be 1. 28 - - #size-cells: Child device size number of cells, must be 0. 29 - 30 - Example: 31 - pmic@0 { 32 - compatible = "sprd,sc2731"; 33 - reg = <0>; 34 - spi-max-frequency = <26000000>; 35 - interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>; 36 - interrupt-controller; 37 - #interrupt-cells = <2>; 38 - #address-cells = <1>; 39 - #size-cells = <0>; 40 - };
+1 -20
Documentation/devicetree/bindings/power/supply/sc2731-charger.yaml
··· 30 30 - constant-charge-voltage-max-microvolt: maximum constant input voltage. 31 31 32 32 additionalProperties: false 33 - 34 - examples: 35 - - | 36 - bat: battery { 37 - compatible = "simple-battery"; 38 - charge-term-current-microamp = <120000>; 39 - constant-charge-voltage-max-microvolt = <4350000>; 40 - }; 41 - 42 - pmic { 43 - #address-cells = <1>; 44 - #size-cells = <0>; 45 - 46 - battery@a00 { 47 - compatible = "sprd,sc2731-charger"; 48 - reg = <0x0>; 49 - phys = <&ssphy>; 50 - monitored-battery = <&bat>; 51 - }; 52 - }; 33 + ...
+1 -37
Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml
··· 65 65 - monitored-battery 66 66 67 67 additionalProperties: false 68 - 69 - examples: 70 - - | 71 - #include <dt-bindings/gpio/gpio.h> 72 - bat: battery { 73 - compatible = "simple-battery"; 74 - charge-full-design-microamp-hours = <1900000>; 75 - constant-charge-voltage-max-microvolt = <4350000>; 76 - ocv-capacity-celsius = <20>; 77 - ocv-capacity-table-0 = <4185000 100>, <4113000 95>, <4066000 90>, 78 - <4022000 85>, <3983000 80>, <3949000 75>, 79 - <3917000 70>, <3889000 65>, <3864000 60>, 80 - <3835000 55>, <3805000 50>, <3787000 45>, 81 - <3777000 40>, <3773000 35>, <3770000 30>, 82 - <3765000 25>, <3752000 20>, <3724000 15>, 83 - <3680000 10>, <3605000 5>, <3400000 0>; 84 - // ... 85 - }; 86 - 87 - pmic { 88 - #address-cells = <1>; 89 - #size-cells = <0>; 90 - 91 - battery@a00 { 92 - compatible = "sprd,sc2731-fgu"; 93 - reg = <0xa00>; 94 - battery-detect-gpios = <&pmic_eic 9 GPIO_ACTIVE_HIGH>; 95 - interrupt-parent = <&sc2731_pmic>; 96 - interrupts = <4>; 97 - io-channels = <&pmic_adc 5>, <&pmic_adc 14>; 98 - io-channel-names = "bat-temp", "charge-vol"; 99 - nvmem-cells = <&fgu_calib>; 100 - nvmem-cell-names = "fgu_calib"; 101 - monitored-battery = <&bat>; 102 - sprd,calib-resistance-micro-ohms = <21500>; 103 - }; 104 - }; 68 + ...
-21
Documentation/devicetree/bindings/regulator/sprd,sc2731-regulator.yaml
··· 43 43 - compatible 44 44 45 45 additionalProperties: false 46 - 47 - examples: 48 - - | 49 - regulators { 50 - compatible = "sprd,sc2731-regulator"; 51 - 52 - BUCK_CPU0 { 53 - regulator-name = "vddarm0"; 54 - regulator-min-microvolt = <400000>; 55 - regulator-max-microvolt = <1996875>; 56 - regulator-ramp-delay = <25000>; 57 - regulator-always-on; 58 - }; 59 - 60 - LDO_CAMA0 { 61 - regulator-name = "vddcama0"; 62 - regulator-min-microvolt = <1200000>; 63 - regulator-max-microvolt = <3750000>; 64 - regulator-enable-ramp-delay = <100>; 65 - }; 66 - }; 67 46 ...
-16
Documentation/devicetree/bindings/rtc/sprd,sc2731-rtc.yaml
··· 30 30 - $ref: rtc.yaml# 31 31 32 32 unevaluatedProperties: false 33 - 34 - examples: 35 - - | 36 - #include <dt-bindings/interrupt-controller/irq.h> 37 - 38 - pmic { 39 - #address-cells = <1>; 40 - #size-cells = <0>; 41 - 42 - rtc@280 { 43 - compatible = "sprd,sc2731-rtc"; 44 - reg = <0x280>; 45 - interrupt-parent = <&sc2731_pmic>; 46 - interrupts = <2 IRQ_TYPE_LEVEL_HIGH>; 47 - }; 48 - }; 49 33 ...