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.

regulator: dt-bindings: mt6358: Add MT6366 PMIC

The MediaTek MT6366 PMIC is similar to the MT6358 PMIC. It is designed
to be paired with the MediaTek MT8186 SoC. It has 9 buck regulators and
29 LDO regulators, not counting ones that feed internally and basically
have no controls. The regulators are named after their intended usage
for the SoC and system design, thus not named generically as ldoX or
dcdcX, but as vcn33 or vgpu.

The differences compared to the MT6358 are minimal:
- Regulators removed: VCAMA1, VCAMA2, VCAMD, VCAMIO, VLDO28
- Regulators added: VM18, VMDDR, VSRAM_CORE

Both PMIC models contain a chip ID register at the same address that
can be used to differentiate the actual model. Thus, even though the
MT6366 is not fully backward compatible with the MT6358, it still falls
back on the MT6358 compatible string. It is up to the implementation
to use the chip ID register as a probing mechanism.

Update the MT6358 regulator binding and add entries for all the MT6366's
regulators and their supplies. The regulator node names follow a cleaned
up style without type prefixes and with underscores replaced with hyphens.

Signed-off-by: Zhiyong Tao <zhiyong.tao@mediatek.com>
[wens@chromium.org: major rework and added commit message]
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230928085537.3246669-6-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Zhiyong Tao and committed by
Mark Brown
c631494a 2f384e60

+120 -29
+120 -29
Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml
··· 16 16 17 17 properties: 18 18 compatible: 19 - const: mediatek,mt6358-regulator 20 - 21 - ldo_vxo22: 22 - description: LDOs with fixed 2.2V output and 0~100/10mV tuning 23 - type: object 24 - $ref: regulator.yaml# 25 - properties: 26 - regulator-allowed-modes: false 27 - unevaluatedProperties: false 28 - 29 - ldo_vusb: 30 - description: LDOs with fixed 3.0V output and 0~100/10mV tuning 31 - type: object 32 - $ref: regulator.yaml# 33 - properties: 34 - regulator-allowed-modes: false 35 - unevaluatedProperties: false 19 + oneOf: 20 + - const: mediatek,mt6358-regulator 21 + - items: 22 + - const: mediatek,mt6366-regulator 23 + - const: mediatek,mt6358-regulator 36 24 37 25 vsys-ldo1-supply: 38 26 description: Supply for LDOs vfe28, vxo22, vcn28, vaux18, vaud28, vsim1, vusb, vbif28 39 27 vsys-ldo2-supply: 40 - description: Supply for LDOs vldo28, vio28, vmc, vmch, vsim2 28 + description: Supply for LDOs vldo28 (MT6358 only), vio28, vmc, vmch, vsim2 41 29 vsys-ldo3-supply: 42 - description: Supply for LDOs vcn33, vcama1, vcama2, vemc, vibr 30 + description: Supply for LDOs vcn33, vcama[12] (MT6358 only), vemc, vibr 43 31 vsys-vcore-supply: 44 32 description: Supply for buck regulator vcore 45 33 vsys-vdram1-supply: ··· 47 59 vsys-vs2-supply: 48 60 description: Supply for buck regulator vs2 49 61 vs1-ldo1-supply: 50 - description: Supply for LDOs vrf18, vefuse, vcn18, vcamio, vio18 62 + description: 63 + Supply for LDOs vrf18, vefuse, vcn18, vcamio (MT6358 only), vio18, vm18 (MT6366 only) 51 64 vs2-ldo1-supply: 52 - description: Supply for LDOs vdram2 65 + description: Supply for LDOs vdram2, vmddr (MT6366 only) 53 66 vs2-ldo2-supply: 54 67 description: Supply for LDOs vrf12, va12 55 68 vs2-ldo3-supply: 56 - description: Supply for LDOs vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 69 + description: 70 + Supply for LDOs vsram-core (MT6366 only), vsram-gpu, vsram-others, vsram-proc11, vsram-proc12 57 71 vs2-ldo4-supply: 58 72 description: Supply for LDO vcamd 59 73 60 74 patternProperties: 61 - "^buck_v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": 75 + "^(buck_)?v(core|dram1|gpu|modem|pa|proc1[12]|s[12])$": 62 76 description: Buck regulators 63 77 type: object 64 78 $ref: regulator.yaml# ··· 75 85 enum: [0, 1] 76 86 unevaluatedProperties: false 77 87 78 - "^ldo_v(a|rf)12$": 88 + "^(ldo_)?v(a|rf)12$": 79 89 description: LDOs with fixed 1.2V output and 0~100/10mV tuning 80 90 type: object 81 91 $ref: regulator.yaml# ··· 83 93 regulator-allowed-modes: false 84 94 unevaluatedProperties: false 85 95 86 - "^ldo_v((aux|cn|io|rf)18|camio)$": 87 - description: LDOs with fixed 1.8V output and 0~100/10mV tuning 96 + "^(ldo_)?v((aux|cn|io|rf)18|camio)$": 97 + description: 98 + LDOs with fixed 1.8V output and 0~100/10mV tuning (vcn18 on MT6366 has variable output) 88 99 type: object 89 100 $ref: regulator.yaml# 90 101 properties: 91 102 regulator-allowed-modes: false 92 103 unevaluatedProperties: false 93 104 94 - "^ldo_v(aud|bif|cn|fe|io)28$": 105 + "^(ldo_)?vxo22$": 106 + description: LDOs with fixed 2.2V output and 0~100/10mV tuning 107 + type: object 108 + $ref: regulator.yaml# 109 + properties: 110 + regulator-allowed-modes: false 111 + unevaluatedProperties: false 112 + 113 + "^(ldo_)?v(aud|bif|cn|fe|io)28$": 95 114 description: LDOs with fixed 2.8V output and 0~100/10mV tuning 96 115 type: object 97 116 $ref: regulator.yaml# ··· 108 109 regulator-allowed-modes: false 109 110 unevaluatedProperties: false 110 111 111 - "^ldo_vsram_(gpu|others|proc1[12])$": 112 + "^(ldo_)?vusb$": 113 + description: LDOs with fixed 3.0V output and 0~100/10mV tuning 114 + type: object 115 + $ref: regulator.yaml# 116 + properties: 117 + regulator-allowed-modes: false 118 + unevaluatedProperties: false 119 + 120 + "^(ldo_)?vsram[_-](core|gpu|others|proc1[12])$": 112 121 description: LDOs with variable output 113 122 type: object 114 123 $ref: regulator.yaml# ··· 124 117 regulator-allowed-modes: false 125 118 unevaluatedProperties: false 126 119 127 - "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": 120 + "^(ldo_)?v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|m18|mc|mch|mddr|sim[12])$": 128 121 description: LDOs with variable output and 0~100/10mV tuning 129 122 type: object 130 123 $ref: regulator.yaml# ··· 136 129 - compatible 137 130 138 131 additionalProperties: false 132 + 133 + allOf: 134 + - if: 135 + properties: 136 + compatible: 137 + const: mediatek,mt6358-regulator 138 + then: 139 + patternProperties: 140 + # Old regulator node name scheme (with prefix and underscores) only 141 + # ([^y-] is used to avoid matching -supply 142 + "^(?<!buck_)(?<!ldo_)v.*[^y-](?!-supply)$": false 143 + "^ldo_vsram-": false 144 + # vsram_core regulator doesn't exist on MT6358 145 + "^ldo_vsram[-_]core$": false 146 + 147 + properties: 148 + # vm18 and vmddr regulators don't exist on MT6358 149 + ldo_vm18: false 150 + ldo_vmddr: false 151 + 152 + - if: 153 + properties: 154 + compatible: 155 + contains: 156 + const: mediatek,mt6366-regulator 157 + then: 158 + patternProperties: 159 + # Prefer cleaned up regulator node names 160 + "^(buck|ldo)_": false 161 + # Don't allow underscores 162 + "^vsram_": false 163 + # vcam* regulators don't exist on MT6366 164 + "^vcam": false 165 + 166 + properties: 167 + # vldo28 regulator doesn't exist on MT6366 168 + vldo28: false 169 + # vs2_ldo4 supply pin doesn't exist on MT6366 170 + vs2-ldo4-supply: false 139 171 140 172 examples: 141 173 - | ··· 202 156 }; 203 157 }; 204 158 159 + - | 160 + #include <dt-bindings/regulator/mediatek,mt6397-regulator.h> 161 + 162 + regulator { 163 + compatible = "mediatek,mt6366-regulator", "mediatek,mt6358-regulator"; 164 + 165 + vdram1 { 166 + regulator-name = "pp1125_emi_vdd2"; 167 + regulator-min-microvolt = <1125000>; 168 + regulator-max-microvolt = <1125000>; 169 + regulator-ramp-delay = <12500>; 170 + regulator-enable-ramp-delay = <0>; 171 + regulator-allowed-modes = <MT6397_BUCK_MODE_AUTO 172 + MT6397_BUCK_MODE_FORCE_PWM>; 173 + regulator-always-on; 174 + }; 175 + 176 + vproc11 { 177 + regulator-name = "ppvar_dvdd_proc_bc_mt6366"; 178 + regulator-min-microvolt = <600000>; 179 + regulator-max-microvolt = <1200000>; 180 + regulator-ramp-delay = <6250>; 181 + regulator-enable-ramp-delay = <200>; 182 + regulator-allowed-modes = <MT6397_BUCK_MODE_AUTO 183 + MT6397_BUCK_MODE_FORCE_PWM>; 184 + regulator-always-on; 185 + }; 186 + 187 + vmddr { 188 + regulator-name = "pm0750_emi_vmddr"; 189 + regulator-min-microvolt = <700000>; 190 + regulator-max-microvolt = <750000>; 191 + regulator-enable-ramp-delay = <325>; 192 + regulator-always-on; 193 + }; 194 + 195 + vsram-proc11 { 196 + regulator-name = "pp0900_dvdd_sram_bc"; 197 + regulator-min-microvolt = <850000>; 198 + regulator-max-microvolt = <1120000>; 199 + regulator-ramp-delay = <6250>; 200 + regulator-enable-ramp-delay = <240>; 201 + regulator-always-on; 202 + }; 203 + }; 205 204 ...