regulator, dt: add dt support for tps6502x regulator
Subsystems (2)
PATCH v3 1/1 regulator, dt: add dt support for tps6502x regulator
add DT support for the tps6502x regulators.
---
Changes in v3:
- fold kbuild patch:
regulator, dt: fix platform_no_drv_owner.cocci warnings into this patch
No need to set .owner here. The core will do it.
Changes in v2:
- add comment from kbuild test robot
- tps6502x_parse_dt_data() can be static
- add comment from Mark Brown:
- remove arch/arm/boot/dts/tps65023.dtsi
- do not use "regulator-compatible"
.../devicetree/bindings/regulator/tps6502x.txt | 58 ++++ drivers/regulator/tps65023-regulator.c | 325 +++++++++++++++------ 2 files changed, 286 insertions(+), 97 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/tps6502x.txt
Documentation/devicetree/bindings/regulator/tps6502x.txt new file +58 -0
@@ -0,0 +1,58 @@ +TPS6502x family of regulators + +Required properties: +- compatible: "ti,tps65020", "ti,tps65021" or "ti,tps65023" +- reg: I2C slave address +- regulators: list of regulators provided by this controller, must be named + after their hardware counterparts: dcdc[1-3] and ldo[1-2] +- regulators: This is the list of child nodes that specify the regulator + initialization data for defined regulators. Not all regulators for the given + device need to be present. The definition for each of these nodes is defined + using the standard binding for regulators found at + Documentation/devicetree/bindings/regulator/regulator.txt. + +Each regulator is defined using the standard binding for regulators. + +Example: + + tps: tps@48 { + compatible = "ti,tps65023"; + + regulators { + vdcdc1_reg: regulator@0 { + reg = <0>; + regulator-name = "vdd_core"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-always-on; + }; + vdcdc2_reg: regulator@1 { + reg = <1>; + regulator-name = "vddshv"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + vdcdc3_reg: regulator@2 { + reg = <2>; + regulator-name = "vdds"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + vldo1_reg: regulator@3 { + reg = <3>; + regulator-name = "vdda1p8v_usbphy"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + vldo2_reg: regulator@4 { + reg = <4>; + regulator-name = "vdda3p3v_usbphy"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + }; + };
drivers/regulator/tps65023-regulator.c +228 -97
370 lines not on this page · raw message
Signature · 1 line
2.1.0
Mark Brown
maintainerQuoted 1 line · Heiko Schocher
add DT support for the tps6502x regulators.
Please use subject lines matching the style for the subsystem.
drivers/regulator/tps65023-regulator.c static const struct i2c_device_id tps_65023_id[] = { · line 383
Quoted 5 lines
drivers/regulator/tps65023-regulator.c +5
-0+ regulators =of_get_child_by_name (np,"regulators" ); +if (!regulators) { +dev_err (dev,"regulator node not found\n" ); +return NULL ; + }
Please use the generic support for locating the DT information for regulators using regulators_node and of_match in the regulator_desc rather than open coding this.
Hello Mark,
Am 27.10.2015 um 03:12 schrieb Mark Brown:
Quoted 4 lines · Heiko Schocher
Quoted 1 line
add DT support for the tps6502x regulators.
Please use subject lines matching the style for the subsystem.
Would be "regulator: tps6520x:" correct?
Quoted 9 lines
drivers/regulator/tps65023-regulator.c static const struct i2c_device_id tps_65023_id[] = { · line 383
Quoted 5 lines
drivers/regulator/tps65023-regulator.c +5
-0+ regulators =of_get_child_by_name (np,"regulators" ); +if (!regulators) { +dev_err (dev,"regulator node not found\n" ); +return NULL ; + }Please use the generic support for locating the DT information for regulators using
regulators_nodeandof_matchin theregulator_descrather than open coding this.
Hmm.. could you point me to a correct example? Seems I overlook sth.
drivers/regulator/tps65090-regulator.cdrivers/regulator/tps65910-regulator.cdrivers/regulator/tps6507x-regulator.cdrivers/regulator/tps6586x-regulator.c
are doing it all the same way ...
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Mark Brown
maintainerQuoted 5 lines · Heiko Schocher
Am 27.10.2015 um 03:12 schrieb Mark Brown:
Quoted 1 line
Please use subject lines matching the style for the subsystem.
Would be "regulator: tps6520x:" correct?
Yes.
Quoted 11 lines
Quoted 9 lines
drivers/regulator/tps65023-regulator.c static const struct i2c_device_id tps_65023_id[] = { · line 383
Quoted 5 lines
drivers/regulator/tps65023-regulator.c +5
-0+ regulators =of_get_child_by_name (np,"regulators" ); +if (!regulators) { +dev_err (dev,"regulator node not found\n" ); +return NULL ; + }Please use the generic support for locating the DT information for regulators using
regulators_nodeandof_matchin theregulator_descrather than open coding this.Hmm.. could you point me to a correct example? Seems I overlook sth.
$ grep -l regulators_node drivers/regulator/*.c drivers/regulator/88pm800.c drivers/regulator/axp20x-regulator.c drivers/regulator/da9062-regulator.c drivers/regulator/isl9305.c drivers/regulator/max14577.c drivers/regulator/max77686.c drivers/regulator/max77693.c drivers/regulator/max77802.c drivers/regulator/mt6311-regulator.c drivers/regulator/of_regulator.c drivers/regulator/rn5t618-regulator.c drivers/regulator/rt5033-regulator.c drivers/regulator/sky81452-regulator.c drivers/regulator/tps65217-regulator.c