Add support for TI TPS65219 PMIC.
Subsystems (6)
v7 cover Add support for TI TPS65219 PMIC.
From: Jerome NEANNE <[email protected]>
Hi everyone,
bindings and regulator are already there, it has been rebased on master 6.1:
[email protected]:torvalds/linux.git
commit 8f71a2b3f435f29b787537d1abedaa7d8ebe6647
All review feedback have been integrated.
Changes in v7:
- defconfig: change commit message to indicate why (Krzysztof Kozlowski).
- mfd: integrate all feedback from Lee Jones and Biju Das.
Regards,
Jerome
Previous versions:i
v6 - https://lore.kernel.org/all/[email protected]/
v5 - https://lore.kernel.org/lkml/[email protected]/
v4 - https://lore.kernel.org/lkml/[email protected]/
v3 - https://lore.kernel.org/lkml/[email protected]/
v2 - https://lore.kernel.org/lkml/[email protected]/
v1 - https://lore.kernel.org/lkml/[email protected]/
Jerome NEANNE (1):
DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK
board.
Jerome Neanne (4):
DONOTMERGE: arm64: dts: ti: Add pinmux and irq mapping for TPS65219
external interrupts
DONOTMERGE: arm64: dts: ti: k3-am642-sk: Enable tps65219 power-button
mfd: tps65219: Add driver for TI TPS65219 PMIC
arm64: defconfig: Add tps65219 as modules
Markus Schneider-Pargmann (1):
Input: Add tps65219 interrupt driven powerbutton
MAINTAINERS | 1 + arch/arm64/boot/dts/ti/k3-am642-sk.dts | 115 ++++++++ arch/arm64/configs/defconfig | 3 + drivers/input/misc/Kconfig | 10 + drivers/input/misc/Makefile | 1 + drivers/input/misc/tps65219-pwrbutton.c | 148 ++++++++++ drivers/mfd/Kconfig | 14 + drivers/mfd/Makefile | 1 + drivers/mfd/tps65219.c | 299 ++++++++++++++++++++ include/linux/mfd/tps65219.h | 345 ++++++++++++++++++++++++ 10 files changed, 937 insertions(+) create mode 100644 drivers/input/misc/tps65219-pwrbutton.c create mode 100644 drivers/mfd/tps65219.c create mode 100644 include/linux/mfd/tps65219.h
Signature · 1 line
2.25.1
PATCH v7 1/6 DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
From: Jerome NEANNE <[email protected]>
Add support fot the TI Power Management IC TPS65219 on the AM642 SKEVM board.
Needed for driver testing but official board support pending. TI commitment is required before board upstream kick-off.
--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 104 +++++++++++++++++++++++++ 1 file changed, 104 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +104 -0
@@ -219,6 +219,20 @@ led-7 { gpios = <&exp2 7 GPIO_ACTIVE_HIGH>; }; }; + + vsel_sd_nddr: gpio-regulator { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&vsel_sd_nddr_pins_default>; + regulator-name = "tps65219-LDO1-SEL-SD"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + vin-supply = <&ldo1_reg>; + gpios = <&main_gpio0 45 GPIO_ACTIVE_HIGH>; + states = <1800000 0x0>, + <3300000 0x1>; + }; }; &main_pmx0 {
@@ -250,6 +264,13 @@ AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ >; }; + main_i2c0_pins_default: main-i2c0-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ + >; + }; + main_i2c1_pins_default: main-i2c1-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */
@@ -336,6 +357,12 @@ main_wlan_pins_default: main-wlan-pins-default { AM64X_IOPAD(0x00bc, PIN_INPUT, 7) /* (U8) GPIO0_46 */ >; }; + + vsel_sd_nddr_pins_default: vsel-sd-nddr-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x00b8, PIN_INPUT, 7) /* (Y7) PRG1_PRU0_GPO0.GPIO0_45 */ + >; + }; }; &mcu_uart0 {
@@ -384,6 +411,83 @@ &mcu_i2c1 { status = "disabled"; }; +&main_i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&main_i2c0_pins_default>; + clock-frequency = <400000>; + status = "okay"; + + tps65219: pmic@30 { + compatible = "ti,tps65219"; + reg = <0x30>; + system-power-controller; + + buck1-supply = <&vcc_3v3_sys>; + buck2-supply = <&vcc_3v3_sys>; + buck3-supply = <&vcc_3v3_sys>; + ldo1-supply = <&vcc_3v3_sys>; + ldo2-supply = <&buck2_reg>; + ldo3-supply = <&vcc_3v3_sys>; + ldo4-supply = <&vcc_3v3_sys>; + + regulators { + buck1_reg: buck1 { + regulator-name = "VDD_CORE"; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1000000>; + regulator-boot-on; + regulator-always-on; + }; + + buck2_reg: buck2 { + regulator-name = "VCC1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + buck3_reg: buck3 { + regulator-name = "VDD_LPDDR4"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: ldo1 { + regulator-name = "VDDSHV_SD_IO_PMIC"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3300000>; + regulator-allow-bypass; + }; + + ldo2_reg: ldo2 { + regulator-name = "VDDAR_CORE"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo3_reg: ldo3 { + regulator-name = "VDDA_1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo4_reg: ldo4 { + regulator-name = "VDD_PHY_2V5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; &main_i2c1 { pinctrl-names = "default"; pinctrl-0 = <&main_i2c1_pins_default>;
Signature · 1 line
2.25.1
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Hi Jerome,
is this setup working for you on the AM642 SK board?
I am testing your PMIC patches on a AM62 based board with a similar setup and running into the following error
VDDSHV5_SDIO: bypassed regulator has no supply!
VDDSHV5_SDIO: will resolve supply early: ldo1
VDDSHV5_SDIO: supplied by regulator-dummy
VDDSHV5_SDIO: failed to get the current voltage: -EINVAL
Have you noticed problems with LDO1 and bypass mode?
Regards,
Wadim
Am 04.11.22 um 16:23 schrieb Jerome Neanne:
Quoted 150 lines
From: Jerome NEANNE <[email protected]>
Add support fot the TI Power Management IC TPS65219 on the AM642 SKEVM board.
Needed for driver testing but official board support pending. TI commitment is required before board upstream kick-off.
Signed-off-by Jerome NEANNE <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 104 +++++++++++++++++++++++++ 1 file changed, 104 insertions(+)arch/arm64/boot/dts/ti/k3-am642-sk.dts +104
-0@@ -219,6 +219,20 @@ led-7 { gpios = <&exp2 7 GPIO_ACTIVE_HIGH>; }; }; + + vsel_sd_nddr: gpio-regulator { + compatible = "regulator-gpio"; + pinctrl-names = "default"; + pinctrl-0 = <&vsel_sd_nddr_pins_default>; + regulator-name = "tps65219-LDO1-SEL-SD"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + regulator-boot-on; + vin-supply = <&ldo1_reg>; + gpios = <&main_gpio0 45 GPIO_ACTIVE_HIGH>; + states = <1800000 0x0>, + <3300000 0x1>; + }; }; &main_pmx0 {@@ -250,6 +264,13 @@ AM64X_IOPAD(0x02a8, PIN_OUTPUT, 0) /* (E19) USB0_DRVVBUS */ >; }; + main_i2c0_pins_default: main-i2c0-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0260, PIN_INPUT_PULLUP, 0) /* (A18) I2C0_SCL */ + AM64X_IOPAD(0x0264, PIN_INPUT_PULLUP, 0) /* (B18) I2C0_SDA */ + >; + }; + main_i2c1_pins_default: main-i2c1-pins-default { pinctrl-single,pins = < AM64X_IOPAD(0x0268, PIN_INPUT_PULLUP, 0) /* (C18) I2C1_SCL */@@ -336,6 +357,12 @@ main_wlan_pins_default: main-wlan-pins-default { AM64X_IOPAD(0x00bc, PIN_INPUT, 7) /* (U8) GPIO0_46 */ >; }; + + vsel_sd_nddr_pins_default: vsel-sd-nddr-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x00b8, PIN_INPUT, 7) /* (Y7) PRG1_PRU0_GPO0.GPIO0_45 */ + >; + }; }; &mcu_uart0 {@@ -384,6 +411,83 @@ &mcu_i2c1 { status = "disabled"; }; +&main_i2c0 { + pinctrl-names = "default"; + pinctrl-0 = <&main_i2c0_pins_default>; + clock-frequency = <400000>; + status = "okay"; + + tps65219: pmic@30 { + compatible = "ti,tps65219"; + reg = <0x30>; + system-power-controller; + + buck1-supply = <&vcc_3v3_sys>; + buck2-supply = <&vcc_3v3_sys>; + buck3-supply = <&vcc_3v3_sys>; + ldo1-supply = <&vcc_3v3_sys>; + ldo2-supply = <&buck2_reg>; + ldo3-supply = <&vcc_3v3_sys>; + ldo4-supply = <&vcc_3v3_sys>; + + regulators { + buck1_reg: buck1 { + regulator-name = "VDD_CORE"; + regulator-min-microvolt = <750000>; + regulator-max-microvolt = <1000000>; + regulator-boot-on; + regulator-always-on; + }; + + buck2_reg: buck2 { + regulator-name = "VCC1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + buck3_reg: buck3 { + regulator-name = "VDD_LPDDR4"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo1_reg: ldo1 { + regulator-name = "VDDSHV_SD_IO_PMIC"; + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <3300000>; + regulator-allow-bypass; + }; + + ldo2_reg: ldo2 { + regulator-name = "VDDAR_CORE"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <850000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo3_reg: ldo3 { + regulator-name = "VDDA_1V8"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-boot-on; + regulator-always-on; + }; + + ldo4_reg: ldo4 { + regulator-name = "VDD_PHY_2V5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-boot-on; + regulator-always-on; + }; + }; + }; +}; &main_i2c1 { pinctrl-names = "default"; pinctrl-0 = <&main_i2c1_pins_default>;
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 7 lines · Wadim Egorov
Hi Jerome,
is this setup working for you on the AM642 SK board?
I am testing your PMIC patches on a AM62 based board with a similar setup and running into the following error
Quoted 6 lines
VDDSHV5_SDIO: bypassed regulator has no supply!
VDDSHV5_SDIO: will resolve supply early: ldo1
VDDSHV5_SDIO: supplied by regulator-dummy
VDDSHV5_SDIO: failed to get the current voltage:-EINVALHave you noticed problems with LDO1 and bypass mode?
Wadim,
I did not noticed this on am642 board but IIRC this rail was not used. I heard about similar issue reported to me by Nishanth M with a fix proposal here:
https://gist.github.com/nmenon/e4dd6ef6afe31bc9750fa6cbee8d3e25
I did not have time yet to investigate on this but will do soon.
Regards,
Jerome
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 10 lines · jerome Neanne
Quoted 7 lines · Wadim Egorov
I am testing your PMIC patches on a AM62 based board with a similar setup and running into the following error
VDDSHV5_SDIO: bypassed regulator has no supply!
VDDSHV5_SDIO: will resolve supply early: ldo1
VDDSHV5_SDIO: supplied by regulator-dummy
VDDSHV5_SDIO: failed to get the current voltage:-EINVAL
Quoted 6 lines
Quoted 1 line
Have you noticed problems with LDO1 and bypass mode?
I did not noticed this on am642 board but IIRC this rail was not used. I heard about similar issue reported to me by Nishanth M with a fix proposal here:
https://gist.github.com/nmenon/e4dd6ef6afe31bc9750fa6cbee8d3e25
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
Nishanth Menon
maintainerRe: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 18 lines · Mark Brown
Quoted 10 lines · jerome Neanne
Quoted 7 lines · Wadim Egorov
I am testing your PMIC patches on a AM62 based board with a similar setup and running into the following error
VDDSHV5_SDIO: bypassed regulator has no supply!
VDDSHV5_SDIO: will resolve supply early: ldo1
VDDSHV5_SDIO: supplied by regulator-dummy
VDDSHV5_SDIO: failed to get the current voltage:-EINVALQuoted 6 lines
Quoted 1 line
Have you noticed problems with LDO1 and bypass mode?
I did not noticed this on am642 board but IIRC this rail was not used. I heard about similar issue reported to me by Nishanth M with a fix proposal here:
https://gist.github.com/nmenon/e4dd6ef6afe31bc9750fa6cbee8d3e25
Quoted 4 lines
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
Correct - My hack was based on a time crunch hack ;)...
The problem is this - the default NVM in the PMIC is setup such that VSET value =3.3v and bypass bit set (makes sense since the vin=3.3v).
Now the constraint is bypass bit cannot be changed without the LDO being switched off.
regulator-allow-bypass property allows us to control bypass bit, but we should'nt toggle it when LDO is active. Not providing the property implies the bit wont be toggled by regulator core either.
What we need is a scheme that will disable the bypass bit with the intent of operating the LDO with just the vset field. I did'nt find it possible atm.. unless I am mistaken..
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 9 lines · Nishanth Menon
Quoted 4 lines · Mark Brown
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
The problem is this - the default NVM in the PMIC is setup such that VSET value =3.3v and bypass bit set (makes sense since the vin=3.3v).
This implies no voltage drop over the LDO? Sounds a bit suspect.
Quoted 10 lines
Now the constraint is bypass bit cannot be changed without the LDO being switched off.
regulator-allow-bypass property allows us to control bypass bit, but we should'nt toggle it when LDO is active. Not providing the property implies the bit wont be toggled by regulator core either.
What we need is a scheme that will disable the bypass bit with the intent of operating the LDO with just the vset field. I did'nt find it possible atm.. unless I am mistaken..
Can the consumer just disable the supply as part of startup? Though that's starting to feel rather board specific. There's not really a good place to put a board specific setup process like that in the kernel at the minute, you'd ideally want the firmware to leave the device at least disabled if not actually out of bypass on startup so we don't have to deal with this. Ugh...
Nishanth Menon
maintainerRe: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 8 lines · Mark Brown
Quoted 6 lines · Nishanth Menon
Quoted 4 lines · Mark Brown
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
Quoted 4 lines
Quoted 2 lines
The problem is this - the default NVM in the PMIC is setup such that VSET value =3.3v and bypass bit set (makes sense since the vin=3.3v).
This implies no voltage drop over the LDO? Sounds a bit suspect.
Not the choice I'd probably have made ;)
Quoted 8 lines
Quoted 7 lines
Now the constraint is bypass bit cannot be changed without the LDO being switched off.
regulator-allow-bypass property allows us to control bypass bit, but we should'nt toggle it when LDO is active. Not providing the property implies the bit wont be toggled by regulator core either.
Quoted 6 lines
Quoted 3 lines
What we need is a scheme that will disable the bypass bit with the intent of operating the LDO with just the vset field. I did'nt find it possible atm.. unless I am mistaken..
Can the consumer just disable the supply as part of startup? Though that's starting to feel rather board specific. There's not really a
Yeah - this happens to be SDcard supply (at least in my case).. I'd rather not change the mmc host or core layer to handle a case where LDO happened to be in bypass. it is a regulator driver's problem, IMHO how to provide the stated voltage OR fail to transition the voltage.
In this driver's case, it happily accepts and set the VSET voltage - for example to 1.8V, but then, since the bypass bit is set, well, voltage sticks around at 3.3v.
Quoted 4 lines
good place to put a board specific setup process like that in the kernel at the minute, you'd ideally want the firmware to leave the device at least disabled if not actually out of bypass on startup so we don't have to deal with this. Ugh...
Yeah - that would be the other option - I could plug this bypass clear in the u-boot or someplace early so that the LDO behaves
Also the reason why I did'nt send the mentioned patch (or the like upstream and the patch was done just a couple of days back) were the following questions:
a) Why would'nt we handle the case where bypass bit
is set AND voltage change implies bypass bit needs to be disabled? (i would expect it to fail but if i did provide regulator-allow-bypass, then if bypass is set AND requested-voltage != vin-supply, then i'd have expected framework to probably disable bypass and switch voltage to new voltage - which this driver, based on it's constraint will say "nope, cant do" - but that would be better than silently telling me all good, setting vset and leaving the bypass bit on.)
b) If I wanted the LDO to poweroff the bypass bit at start (define the startup hardware condition), I dont seem to have a description for that either.
Signature · 3 lines
Regards, Nishanth Menon Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
Vignesh Raghavendra
maintainerRe: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Mark Brown
Quoted 6 lines · Nishanth Menon
Quoted 4 lines · Mark Brown
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
The problem is this - the default NVM in the PMIC is setup such that VSET value =3.3v and bypass bit set (makes sense since the vin=3.3v).
This implies no voltage drop over the LDO? Sounds a bit suspect.
Not the choice I'd probably have made ;)
Quoted 4 lines
Quoted 3 lines
Now the constraint is bypass bit cannot be changed without the LDO being switched off.
Per https://www.ti.com/lit/ds/symlink/tps65219.pdf (7.3.6 Linear Regulators).
LDOs have two modes:
1. Load switch mode: in this case, output voltages of 1.5V up to 5.5V are supported.
2 Linear regulator LDO mode where output voltage is programmable in the range of 0.6V to 3.4V in 50mV-steps with possibility of bypass.
(CAUTION on page 25):
A mode change between LDO(/bypass) and LSW-mode must only be performed, when this regulator is disabled!
A change between LDO and bypass-mode (supported by LDO1 and LDO2 only) is supported during operation.
So, seems like bypass can be toggled even with LDO on?
[...]
Regards
Vignesh
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Quoted 35 lines · Vignesh Raghavendra
Quoted 9 lines · Nishanth Menon
Quoted 8 lines · Mark Brown
Quoted 6 lines · Nishanth Menon
Quoted 4 lines · Mark Brown
That proposal looks really non-idiomatic and quite unusual, if there's a fixed voltage supply to the LDO I'd expect to see it modeled as a fixed voltage regulator. I'm not sure what the use of bypass here is trying to accomplish TBH.
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
The problem is this - the default NVM in the PMIC is setup such that VSET value =3.3v and bypass bit set (makes sense since the vin=3.3v).
This implies no voltage drop over the LDO? Sounds a bit suspect.
Not the choice I'd probably have made ;)
Quoted 4 lines
Quoted 3 lines
Now the constraint is bypass bit cannot be changed without the LDO being switched off.
Per https://www.ti.com/lit/ds/symlink/tps65219.pdf (7.3.6 Linear Regulators).
LDOs have two modes:
1. Load switch mode: in this case, output voltages of 1.5V up to 5.5V are supported.
2 Linear regulator LDO mode where output voltage is programmable in the range of 0.6V to 3.4V in 50mV-steps with possibility of bypass.
Quoted 8 lines
(CAUTION on page 25):
A mode change between LDO(/bypass) and LSW-mode must only be performed, when this regulator is disabled!
A change between LDO and bypass-mode (supported by LDO1 and LDO2 only) is supported during operation.So, seems like bypass can be toggled even with LDO on?
I possibly miss-interpreted this caution statement which leads to that
situation.
Your understanding sounds correct. My mistake... Sorry for that
Regards,
Jerome.
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
In reply to Nishanth MenonQuoted 4 lines · Nishanth Menon
Yeah - this happens to be SDcard supply (at least in my case).. I'd rather not change the mmc host or core layer to handle a case where LDO happened to be in bypass. it is a regulator driver's problem, IMHO how to provide the stated voltage OR fail to transition the voltage.
Well, if the regulator is in bypass mode then it is by definition not regulating and so it's like programming the voltage while switched off, setting the target for when it starts regulating again. It's a weirder use case but it does feel like the consistent thing to do at least. The driver shouldn't enter/leave bypass without being explicitly told to so since there'll be a performance impact.
Quoted 3 lines
b) If I wanted the LDO to poweroff the bypass bit at start (define the startup hardware condition), I dont seem to have a description for that either.
That's something we could add in constraints, though the actual process of implementing it might get messy if there's restrictions like having to power off (though from further down the thread I see that might not apply to this device).
Re: [PATCH v7 1/6] DONOTMERGE: arm64: dts: ti: Add TI TPS65219 PMIC support for AM642 SK board.
Am 16.12.22 um 14:41 schrieb Mark Brown:
Quoted 13 lines · Nishanth Menon
Quoted 5 lines
Yeah - this happens to be SDcard supply (at least in my case).. I'd rather not change the mmc host or core layer to handle a case where LDO happened to be in bypass. it is a regulator driver's problem, IMHO how to provide the stated voltage OR fail to transition the voltage.
Well, if the regulator is in bypass mode then it is by definition not regulating and so it's like programming the voltage while switched off, setting the target for when it starts regulating again. It's a weirder use case but it does feel like the consistent thing to do at least. The driver shouldn't enter/leave bypass without being explicitly told to so since there'll be a performance impact.
Quoted 7 lines
Quoted 3 lines
b) If I wanted the LDO to poweroff the bypass bit at start (define the startup hardware condition), I dont seem to have a description for that either.
That's something we could add in constraints, though the actual process of implementing it might get messy if there's restrictions like having to power off (though from further down the thread I see that might not apply to this device).
Just for the record:
My reported problem was actually not the LDO1/bypass situation, but an issue in the process of resolving the regulator supplies.
It was resolved by
commit 0debed5b117d ("regulator: core: Fix resolve supply lookup issue")
Now everything seems to work with my setup with LDO1 supplied by a fixed regulator and LDO1 acting in bypass mode on our hardware.
Regards,
Wadim
PATCH v7 2/6 DONOTMERGE: arm64: dts: ti: Add pinmux and irq mapping for TPS65219 external interrupts
In reply to Jerome NeanneInterrupt occurring on PMIC TPS65219 is propagated to SOC through EXTINTn pin connected to gic500 interrupt controller
Needed for driver testing but official board support pending. TI commitment is required before board upstream kick-off.
--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +10 -0
@@ -363,6 +363,12 @@ vsel_sd_nddr_pins_default: vsel-sd-nddr-pins-default { AM64X_IOPAD(0x00b8, PIN_INPUT, 7) /* (Y7) PRG1_PRU0_GPO0.GPIO0_45 */ >; }; + + pmic_irq_pins_default: pmic-irq-pins-default { + pinctrl-single,pins = < + AM64X_IOPAD(0x0278, PIN_INPUT, 0) /* (C19) EXTINTn */ + >; + }; }; &mcu_uart0 {
@@ -421,6 +427,10 @@ tps65219: pmic@30 { compatible = "ti,tps65219"; reg = <0x30>; system-power-controller; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_irq_pins_default>; + interrupt-parent = <&gic500>; + interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; buck1-supply = <&vcc_3v3_sys>; buck2-supply = <&vcc_3v3_sys>;
Signature · 1 line
2.25.1
PATCH v7 3/6 DONOTMERGE: arm64: dts: ti: k3-am642-sk: Enable tps65219 power-button
In reply to Jerome NeanneThis board uses the pin as a power-button, enable it.
Needed for driver testing but official board support pending. TI commitment is required before board upstream kick-off.
--- arch/arm64/boot/dts/ti/k3-am642-sk.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +1 -0
@@ -431,6 +431,7 @@ tps65219: pmic@30 { pinctrl-0 = <&pmic_irq_pins_default>; interrupt-parent = <&gic500>; interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>; + ti,power-button; buck1-supply = <&vcc_3v3_sys>; buck2-supply = <&vcc_3v3_sys>;
Signature · 1 line
2.25.1
PATCH v7 4/6 mfd: tps65219: Add driver for TI TPS65219 PMIC
In reply to Jerome NeanneThe TPS65219 is a power management IC PMIC designed to supply a wide range of SoCs in both portable and stationary applications. Any SoC can control TPS65219 over a standard I2C interface.
It contains the following components:
- Regulators.
- Over Temperature warning and Shut down.
- GPIOs
- Multi Function Pins (MFP)
- power-button
This patch adds support for tps65219 PMIC. At this time only the functionalities listed below are made available:
- Regulators probe and functionalities
- warm and cold reset support
- SW shutdown support
- Regulator warnings via IRQs
- Power-button via IRQ
---
Notes:
Changes in v7:
Lee Jones review
- Kconfig nit: button that is
- tps65219.c, nits: '\n' x2
- tps65219.c, nit: { .name = "tps65219-gpios", },
- tps65219.h, nit: Power Management IC
- tps65219.h, rework header: struct tps65219
- tps65219.h, remove Superflous " " /* MFD_TPS65219_H */
- remove unused tps65219_soft_shutdown further to make W=1 check Biju Das review:
- Remove all includes that are not mandatory
- Remove container_of err check
MAINTAINERS | 1 + drivers/mfd/Kconfig | 14 ++ drivers/mfd/Makefile | 1 + drivers/mfd/tps65219.c | 299 ++++++++++++++++++++++++++++++ include/linux/mfd/tps65219.h | 345 +++++++++++++++++++++++++++++++++++ 5 files changed, 660 insertions(+) create mode 100644 drivers/mfd/tps65219.c create mode 100644 include/linux/mfd/tps65219.h
MAINTAINERS +1 -0
@@ -15122,6 +15122,7 @@ F: drivers/mfd/menelaus.c F: drivers/mfd/palmas.c F: drivers/mfd/tps65217.c F: drivers/mfd/tps65218.c +F: drivers/mfd/tps65219.c F: drivers/mfd/tps65910.c F: drivers/mfd/twl-core.[ch] F: drivers/mfd/twl4030*.c
drivers/mfd/Kconfig +14 -0
@@ -1635,6 +1635,20 @@ config MFD_TPS65218 This driver can also be built as a module. If so, the module will be called tps65218. +config MFD_TPS65219 + tristate "TI TPS65219 Power Management IC" + depends on I2C && OF + select MFD_CORE + select REGMAP_I2C + select REGMAP_IRQ + help + If you say yes here you get support for the TPS65219 series of Power + Management ICs. These include voltage regulators, GPIOs and + push/power button that is often used in portable devices. + + This driver can also be built as a module. If so, the module + will be called tps65219. + config MFD_TPS6586X bool "TI TPS6586x Power Management chips" depends on I2C=y
drivers/mfd/Makefile +1 -0
@@ -101,6 +101,7 @@ obj-$(CONFIG_TPS6507X) += tps6507x.o obj-$(CONFIG_MFD_TPS65086) += tps65086.o obj-$(CONFIG_MFD_TPS65217) += tps65217.o obj-$(CONFIG_MFD_TPS65218) += tps65218.o +obj-$(CONFIG_MFD_TPS65219) += tps65219.o obj-$(CONFIG_MFD_TPS65910) += tps65910.o obj-$(CONFIG_MFD_TPS65912) += tps65912-core.o obj-$(CONFIG_MFD_TPS65912_I2C) += tps65912-i2c.o
drivers/mfd/tps65219.c new file +299 -0
299 lines not on this page · raw message
include/linux/mfd/tps65219.h new file +345 -0
345 lines not on this page · raw message
Signature · 1 line
2.25.1
Kevin Hilman
maintainerRe: [PATCH v7 4/6] mfd: tps65219: Add driver for TI TPS65219 PMIC
Hi Lee,
Quoted 20 lines · Jerome Neanne
The TPS65219 is a power management IC PMIC designed to supply a wide range of SoCs in both portable and stationary applications. Any SoC can control TPS65219 over a standard I2C interface.
It contains the following components:
- Regulators.
- Over Temperature warning and Shut down.
- GPIOs
- Multi Function Pins (MFP)
- power-buttonThis patch adds support for tps65219 PMIC. At this time only the functionalities listed below are made available:
- Regulators probe and functionalities
- warm and cold reset support
- SW shutdown support
- Regulator warnings via IRQs
- Power-button via IRQ
Quoted 3 lines
Signed-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>Acked-for-mfd-by Lee Jones <[email protected]>
You've ack'd this for mfd, and Dmitry acked the input one (PATCH 5/6) but suggested it be merged via the mfd tree.
Could you please take patches 4 & 5 of this series? Then the DT patch can go via arm-soc.
Thanks,
Kevin
Kevin Hilman
maintainerRe: [PATCH v7 4/6] mfd: tps65219: Add driver for TI TPS65219 PMIC
In reply to Jerome NeanneHi Lee,
Quoted 20 lines · Jerome Neanne
The TPS65219 is a power management IC PMIC designed to supply a wide range of SoCs in both portable and stationary applications. Any SoC can control TPS65219 over a standard I2C interface.
It contains the following components:
- Regulators.
- Over Temperature warning and Shut down.
- GPIOs
- Multi Function Pins (MFP)
- power-buttonThis patch adds support for tps65219 PMIC. At this time only the functionalities listed below are made available:
- Regulators probe and functionalities
- warm and cold reset support
- SW shutdown support
- Regulator warnings via IRQs
- Power-button via IRQ
Quoted 3 lines
Signed-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>Acked-for-mfd-by Lee Jones <[email protected]>
You've ack'd this for mfd, and Dmitry acked the input one (PATCH 5/6) but suggested it be merged via the mfd tree.
Could you please take patches 4 & 5 of this series? Then the DT patch can go via arm-soc.
Thanks,
Kevin
Lee Jones
maintainerRe: [PATCH v7 4/6] mfd: tps65219: Add driver for TI TPS65219 PMIC
Quoted 28 lines · Kevin Hilman
Hi Lee,
Quoted 20 lines · Jerome Neanne
The TPS65219 is a power management IC PMIC designed to supply a wide range of SoCs in both portable and stationary applications. Any SoC can control TPS65219 over a standard I2C interface.
It contains the following components:
- Regulators.
- Over Temperature warning and Shut down.
- GPIOs
- Multi Function Pins (MFP)
- power-buttonThis patch adds support for tps65219 PMIC. At this time only the functionalities listed below are made available:
- Regulators probe and functionalities
- warm and cold reset support
- SW shutdown support
- Regulator warnings via IRQs
- Power-button via IRQQuoted 3 lines
Signed-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>Acked-for-mfd-by Lee Jones <[email protected]>
Quoted 5 lines
You've ack'd this for mfd, and Dmitry acked the input one (PATCH 5/6) but suggested it be merged via the mfd tree.
Could you please take patches 4 & 5 of this series? Then the DT patch can go via arm-soc.
Yep. It's on the list. Please bear with me as a process it.
Signature · 6 lines
Lee Jones [李琼斯] _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v7 4/6] mfd: tps65219: Add driver for TI TPS65219 PMIC
In reply to Jerome NeanneQuoted 39 lines · Jerome Neanne
The TPS65219 is a power management IC PMIC designed to supply a wide range of SoCs in both portable and stationary applications. Any SoC can control TPS65219 over a standard I2C interface.
It contains the following components:
- Regulators.
- Over Temperature warning and Shut down.
- GPIOs
- Multi Function Pins (MFP)
- power-buttonThis patch adds support for tps65219 PMIC. At this time only the functionalities listed below are made available:
- Regulators probe and functionalities
- warm and cold reset support
- SW shutdown support
- Regulator warnings via IRQs
- Power-button via IRQSigned-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>Acked-for-mfd-by Lee Jones <[email protected]>---
Notes:
Changes in v7:
Lee Jones review
-Kconfignit: button that is
-tps65219.c, nits: '\n' x2
-tps65219.c, nit: { .name = "tps65219-gpios", },
-tps65219.h, nit: Power Management IC
-tps65219.h, rework header: struct tps65219
-tps65219.h, remove Superflous " " /*MFD_TPS65219_H*/
- remove unusedtps65219_soft_shutdownfurther to make W=1 check Biju Das review:
- Remove all includes that are not mandatory
- Removecontainer_oferr check
Quoted 8 lines
MAINTAINERS | 1 + drivers/mfd/Kconfig | 14 ++ drivers/mfd/Makefile | 1 + drivers/mfd/tps65219.c | 299 ++++++++++++++++++++++++++++++ include/linux/mfd/tps65219.h | 345 +++++++++++++++++++++++++++++++++++ 5 files changed, 660 insertions(+) create mode 100644 drivers/mfd/tps65219.c create mode 100644 include/linux/mfd/tps65219.h
Applied, thanks.
Signature · 1 line
Lee Jones [李琼斯]
PATCH v7 5/6 Input: Add tps65219 interrupt driven powerbutton
In reply to Jerome NeanneFrom: Markus Schneider-Pargmann <[email protected]>
TPS65219 has different interrupts compared to other TPS6521* chips. TPS65219 defines two interrupts for the powerbutton one for push and one for release.
This driver is very simple in that it maps the push interrupt to a key input and the release interrupt to a key release.
Please feel free to merge through MFD tree.
--- drivers/input/misc/Kconfig | 10 ++ drivers/input/misc/Makefile | 1 + drivers/input/misc/tps65219-pwrbutton.c | 148 ++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 drivers/input/misc/tps65219-pwrbutton.c
drivers/input/misc/Kconfig +10 -0
@@ -468,6 +468,16 @@ config INPUT_TPS65218_PWRBUTTON To compile this driver as a module, choose M here. The module will be called tps65218-pwrbutton. +config INPUT_TPS65219_PWRBUTTON + tristate "TPS65219 Power button driver" + depends on MFD_TPS65219 + help + Say Y here if you want to enable power button reporting for + TPS65219 Power Management IC devices. + + To compile this driver as a module, choose M here. The module will + be called tps65219-pwrbutton. + config INPUT_AXP20X_PEK tristate "X-Powers AXP20X power button driver" depends on MFD_AXP20X
drivers/input/misc/Makefile +1 -0
@@ -80,6 +80,7 @@ obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o obj-$(CONFIG_INPUT_SPARCSPKR) += sparcspkr.o obj-$(CONFIG_INPUT_STPMIC1_ONKEY) += stpmic1_onkey.o obj-$(CONFIG_INPUT_TPS65218_PWRBUTTON) += tps65218-pwrbutton.o +obj-$(CONFIG_INPUT_TPS65219_PWRBUTTON) += tps65219-pwrbutton.o obj-$(CONFIG_INPUT_TWL4030_PWRBUTTON) += twl4030-pwrbutton.o obj-$(CONFIG_INPUT_TWL4030_VIBRA) += twl4030-vibra.o obj-$(CONFIG_INPUT_TWL6040_VIBRA) += twl6040-vibra.o
drivers/input/misc/tps65219-pwrbutton.c new file +148 -0
148 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v7 5/6] Input: Add tps65219 interrupt driven powerbutton
Quoted 14 lines · Jerome Neanne
From: Markus Schneider-Pargmann <[email protected]>
TPS65219 has different interrupts compared to other TPS6521* chips. TPS65219 defines two interrupts for the powerbutton one for push and one for release.
This driver is very simple in that it maps the push interrupt to a key input and the release interrupt to a key release.
Signed-off-by Markus Schneider-Pargmann <[email protected]>Signed-off-by Jerome Neanne <[email protected]>Acked-by Dmitry Torokhov <[email protected]>
Quoted 7 lines
Please feel free to merge through MFD tree.
--- drivers/input/misc/Kconfig | 10 ++ drivers/input/misc/Makefile | 1 + drivers/input/misc/tps65219-pwrbutton.c | 148 ++++++++++++++++++++++++ 3 files changed, 159 insertions(+) create mode 100644 drivers/input/misc/tps65219-pwrbutton.c
Applied, thanks.
Signature · 1 line
Lee Jones [李琼斯]
PATCH v7 6/6 arm64: defconfig: Add tps65219 as modules
In reply to Jerome NeanneDevelopment boards from TI: SK-AM64 PROC1004 include the TPS65219 PMIC. Add support for the TPS65219 PMIC by enabling MFD, regulator and power-button drivers. All drivers enabled as modules.
--- arch/arm64/configs/defconfig | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/configs/defconfig +3 -0
@@ -415,6 +415,7 @@ CONFIG_TOUCHSCREEN_GOODIX=m CONFIG_TOUCHSCREEN_EDT_FT5X06=m CONFIG_INPUT_MISC=y CONFIG_INPUT_PM8941_PWRKEY=y +CONFIG_INPUT_TPS65219_PWRBUTTON=m CONFIG_INPUT_PM8XXX_VIBRATOR=m CONFIG_INPUT_PWM_BEEPER=m CONFIG_INPUT_PWM_VIBRA=m
@@ -653,6 +654,7 @@ CONFIG_MFD_SPMI_PMIC=y CONFIG_MFD_RK808=y CONFIG_MFD_SEC_CORE=y CONFIG_MFD_SL28CPLD=y +CONFIG_MFD_TPS65219=m CONFIG_MFD_ROHM_BD718XX=y CONFIG_MFD_WCD934X=m CONFIG_REGULATOR_FIXED_VOLTAGE=y
@@ -680,6 +682,7 @@ CONFIG_REGULATOR_QCOM_SPMI=y CONFIG_REGULATOR_RK808=y CONFIG_REGULATOR_S2MPS11=y CONFIG_REGULATOR_TPS65132=m +CONFIG_REGULATOR_TPS65219=m CONFIG_REGULATOR_VCTRL=m CONFIG_RC_CORE=m CONFIG_RC_DECODERS=y
Signature · 1 line
2.25.1
Re: [PATCH v7 6/6] arm64: defconfig: Add tps65219 as modules
Quoted 6 lines · Jerome Neanne
Development boards from TI: SK-AM64 PROC1004 include the TPS65219 PMIC. Add support for the TPS65219 PMIC by enabling MFD, regulator and power-button drivers. All drivers enabled as modules.
Signed-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>
Kevin Hilman
maintainerRe: [PATCH v7 6/6] arm64: defconfig: Add tps65219 as modules
Arnd, Olof,
Quoted 10 lines · Kevin Hilman
Quoted 6 lines · Jerome Neanne
Development boards from TI: SK-AM64 PROC1004 include the TPS65219 PMIC. Add support for the TPS65219 PMIC by enabling MFD, regulator and power-button drivers. All drivers enabled as modules.
Signed-off-by Jerome Neanne <[email protected]>Signed-off-by Markus Schneider-Pargmann <[email protected]>Reviewed-by Kevin Hilman <[email protected]>
Could you pick this one up via the soc tree? The mfd & input parts have been applied.
In case you don't have the full series in your inbox, it's here:
https://lore.kernel.org/r/[email protected]
Thanks,
Kevin
Quoted 1 line · Jerome Neanne
Hi everyone,
Hello Jerome,
are you planning to have also gpio support added to the driver?
Francesco
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 8 lines · Francesco Dolcini
Quoted 1 line · Jerome Neanne
Hi everyone,
Hello Jerome,
are you planning to have also gpio support added to the driver?
Francesco
Hi Francesco,
I don't have any requirement regarding GPIO on that PMIC. We've just done this (GPIO driver) for another TI PMIC. Will see if this can be reused later.
Regards,
Jerome
Quoted 8 lines · jerome Neanne
Quoted 5 lines · Francesco Dolcini
Quoted 1 line · Jerome Neanne
Hi everyone,
Hello Jerome,
are you planning to have also gpio support added to the driver?
FYI, this is under review:
https://lore.kernel.org/lkml/20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com/