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 regulator-allowed-modes property

The MT6358 PMIC allows changing operating modes for the buck regulators,
but not the LDOs. Existing device trees and the Linux implementation
already utilize this through the standard regulator-allowed-modes
property.

The values currently used in existing device trees are simply raw
numbers. The values in the Linux driver are matching numbers defined
with macros denoting the two supported modes. Turns out these two
modes are common across parts of the larger MT63xx PMIC family. The
MT6397 regulator binding already has macros for the two modes, with
matching numbers.

Codify the supported values for regulator-allowed-modes for the MT6358
in the device tree binding: 0 and 1 are supported for buck regulators,
and the property should not be present for LDO regulators. Users should
use the dt-bindings/regulator/mediatek,mt6397-regulator.h header for
the macros, instead of using raw numbers.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230928085537.3246669-4-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Chen-Yu Tsai and committed by
Mark Brown
0bf4b56b 93880f7e

+27
+27
Documentation/devicetree/bindings/regulator/mediatek,mt6358-regulator.yaml
··· 22 22 description: LDOs with fixed 2.2V output and 0~100/10mV tuning 23 23 type: object 24 24 $ref: regulator.yaml# 25 + properties: 26 + regulator-allowed-modes: false 25 27 unevaluatedProperties: false 26 28 27 29 ldo_vusb: 28 30 description: LDOs with fixed 3.0V output and 0~100/10mV tuning 29 31 type: object 30 32 $ref: regulator.yaml# 33 + properties: 34 + regulator-allowed-modes: false 31 35 unevaluatedProperties: false 32 36 33 37 ··· 40 36 description: Buck regulators 41 37 type: object 42 38 $ref: regulator.yaml# 39 + properties: 40 + regulator-allowed-modes: 41 + description: | 42 + Buck regulatpr operating modes allowed. Valid values below. 43 + Users should use the macros from dt-bindings/regulator/mediatek,mt6397-regulator.h 44 + 0 (MT6397_BUCK_MODE_AUTO): Auto PFM/PWM mode 45 + 1 (MT6397_BUCK_MODE_FORCE_PWM): Forced PWM mode 46 + items: 47 + enum: [0, 1] 43 48 unevaluatedProperties: false 44 49 45 50 "^ldo_v(a|rf)12$": 46 51 description: LDOs with fixed 1.2V output and 0~100/10mV tuning 47 52 type: object 48 53 $ref: regulator.yaml# 54 + properties: 55 + regulator-allowed-modes: false 49 56 unevaluatedProperties: false 50 57 51 58 "^ldo_v((aux|cn|io|rf)18|camio)$": 52 59 description: LDOs with fixed 1.8V output and 0~100/10mV tuning 53 60 type: object 54 61 $ref: regulator.yaml# 62 + properties: 63 + regulator-allowed-modes: false 55 64 unevaluatedProperties: false 56 65 57 66 "^ldo_v(aud|bif|cn|fe|io)28$": 58 67 description: LDOs with fixed 2.8V output and 0~100/10mV tuning 59 68 type: object 60 69 $ref: regulator.yaml# 70 + properties: 71 + regulator-allowed-modes: false 61 72 unevaluatedProperties: false 62 73 63 74 "^ldo_vsram_(gpu|others|proc1[12])$": 64 75 description: LDOs with variable output 65 76 type: object 66 77 $ref: regulator.yaml# 78 + properties: 79 + regulator-allowed-modes: false 67 80 unevaluatedProperties: false 68 81 69 82 "^ldo_v(cama[12]|camd|cn33|dram2|efuse|emc|ibr|ldo28|mc|mch|sim[12])$": 70 83 description: LDOs with variable output and 0~100/10mV tuning 71 84 type: object 72 85 $ref: regulator.yaml# 86 + properties: 87 + regulator-allowed-modes: false 73 88 unevaluatedProperties: false 74 89 75 90 required: ··· 98 75 99 76 examples: 100 77 - | 78 + #include <dt-bindings/regulator/mediatek,mt6397-regulator.h> 79 + 101 80 regulator { 102 81 compatible = "mediatek,mt6358-regulator"; 103 82 ··· 109 84 regulator-max-microvolt = <900000>; 110 85 regulator-ramp-delay = <6250>; 111 86 regulator-enable-ramp-delay = <200>; 87 + regulator-allowed-modes = <MT6397_BUCK_MODE_AUTO 88 + MT6397_BUCK_MODE_FORCE_PWM>; 112 89 }; 113 90 114 91 ldo_vsram_gpu {