* [PATCH v2] power: regulator: tps65941: Enable FPWM bits
@ 2026-04-21 8:21 Neha Malcom Francis
2026-04-21 8:36 ` J, KEERTHY
2026-04-21 12:26 ` Kumar, Udit
0 siblings, 2 replies; 3+ messages in thread
From: Neha Malcom Francis @ 2026-04-21 8:21 UTC (permalink / raw)
To: trini, jh80.chung, peng.fan
Cc: j-keerthy, t-fujiwara1, u-boot, u-kumar1, gehariprasath,
n-francis
Depending on the phase selection (single or multi), the FPWM bits
configured forces the regulator to operate in PWM mode. In case of
multi-phase selection, the FPWM_MP bits enforce the regulator to also
operate in multi-phase. This fixes correct multi-phase operation.
While at this, correct incorrect macro alignment as well.
Fixes: 065a452ae6a1 ("power: regulator: tps65941: add regulator support")
Link: https://www.ti.com/lit/ds/symlink/tps6594-q1.pdf
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Takuma Fujiwara <t-fujiwara1@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
---
Changes since v1:
https://lore.kernel.org/u-boot/20260129072857.1437272-1-n-francis@ti.com/
- alignment correction
- used existing macros instead of 12, 123 etc.
Tested on J721S2-EVM (same as v1, no logical changes)
https://gist.github.com/nehamalcom/a74fb2a3b59421d0e04693c7d244fdb4
Before the patch, the kernel TPS6594 regulator driver would warn about
overcurrent on a buck, this was due to incorrect multi-phase configuration.
This patch resolves it.
drivers/power/regulator/tps65941_regulator.c | 15 ++++++++++++---
include/power/tps65941.h | 4 +++-
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c
index 2561d6f4c6c..209968b5718 100644
--- a/drivers/power/regulator/tps65941_regulator.c
+++ b/drivers/power/regulator/tps65941_regulator.c
@@ -63,13 +63,14 @@ static inline int tps65941_get_chip_id(struct udevice *dev)
static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
{
- int ret;
+ int ret, idx;
unsigned int adr;
struct dm_regulator_uclass_plat *uc_pdata;
uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
+ idx = dev->driver_data;
ret = pmic_reg_read(dev->parent, adr);
if (ret < 0)
return ret;
@@ -84,10 +85,18 @@ static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
return 0;
} else if (op == PMIC_OP_SET) {
- if (*enable)
+ if (*enable) {
ret |= TPS65941_BUCK_MODE_MASK;
- else
+ /* Enable FPWM */
+ ret |= TPS65941_BUCK_FPWM_MASK;
+ /* If Multiphase enable FPWM_MP */
+ if (idx == TPS65941_BUCK_ID_12 ||
+ idx == TPS65941_BUCK_ID_123 ||
+ idx == TPS65941_BUCK_ID_1234)
+ ret |= TPS65941_BUCK_FPWM_MP_MASK;
+ } else {
ret &= ~TPS65941_BUCK_MODE_MASK;
+ }
ret = pmic_reg_write(dev->parent, adr, ret);
if (ret)
return ret;
diff --git a/include/power/tps65941.h b/include/power/tps65941.h
index a026ec56958..78e48a15972 100644
--- a/include/power/tps65941.h
+++ b/include/power/tps65941.h
@@ -19,7 +19,9 @@
#define TPS65941_BUCK_VOLT_MASK 0xFF
#define TPS65941_BUCK_VOLT_MAX_HEX 0xFF
#define TPS65941_BUCK_VOLT_MAX 3340000
-#define TPS65941_BUCK_MODE_MASK 0x1
+#define TPS65941_BUCK_MODE_MASK 0x1
+#define TPS65941_BUCK_FPWM_MASK 0x2
+#define TPS65941_BUCK_FPWM_MP_MASK 0x4
#define TPS65941_LDO_VOLT_MASK 0x7E
#define TPS65941_LDO_VOLT_MAX_HEX 0x3A
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [PATCH v2] power: regulator: tps65941: Enable FPWM bits
2026-04-21 8:21 [PATCH v2] power: regulator: tps65941: Enable FPWM bits Neha Malcom Francis
@ 2026-04-21 8:36 ` J, KEERTHY
2026-04-21 12:26 ` Kumar, Udit
1 sibling, 0 replies; 3+ messages in thread
From: J, KEERTHY @ 2026-04-21 8:36 UTC (permalink / raw)
To: Francis, Neha, trini@konsulko.com, jh80.chung@samsung.com,
peng.fan@nxp.com
Cc: Fujiwara, Takuma, u-boot@lists.denx.de, Kumar, Udit,
Gujulan Elango, Hari Prasath
-----Original Message-----
From: Francis, Neha <n-francis@ti.com>
Sent: Tuesday, April 21, 2026 1:52 PM
To: trini@konsulko.com; jh80.chung@samsung.com; peng.fan@nxp.com
Cc: J, KEERTHY <j-keerthy@ti.com>; Fujiwara, Takuma <t-fujiwara1@ti.com>; u-boot@lists.denx.de; Kumar, Udit <u-kumar1@ti.com>; Gujulan Elango, Hari Prasath <gehariprasath@ti.com>; Francis, Neha <n-francis@ti.com>
Subject: [PATCH v2] power: regulator: tps65941: Enable FPWM bits
Depending on the phase selection (single or multi), the FPWM bits configured forces the regulator to operate in PWM mode. In case of multi-phase selection, the FPWM_MP bits enforce the regulator to also operate in multi-phase. This fixes correct multi-phase operation.
While at this, correct incorrect macro alignment as well.
> FWIW Reviewed-by: Keerthy <j-keerthy@ti.com>
Fixes: 065a452ae6a1 ("power: regulator: tps65941: add regulator support")
Link: https://www.ti.com/lit/ds/symlink/tps6594-q1.pdf
Signed-off-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Takuma Fujiwara <t-fujiwara1@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
---
Changes since v1:
https://lore.kernel.org/u-boot/20260129072857.1437272-1-n-francis@ti.com/
- alignment correction
- used existing macros instead of 12, 123 etc.
Tested on J721S2-EVM (same as v1, no logical changes)
https://gist.github.com/nehamalcom/a74fb2a3b59421d0e04693c7d244fdb4
Before the patch, the kernel TPS6594 regulator driver would warn about overcurrent on a buck, this was due to incorrect multi-phase configuration.
This patch resolves it.
drivers/power/regulator/tps65941_regulator.c | 15 ++++++++++++---
include/power/tps65941.h | 4 +++-
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c
index 2561d6f4c6c..209968b5718 100644
--- a/drivers/power/regulator/tps65941_regulator.c
+++ b/drivers/power/regulator/tps65941_regulator.c
@@ -63,13 +63,14 @@ static inline int tps65941_get_chip_id(struct udevice *dev)
static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable) {
- int ret;
+ int ret, idx;
unsigned int adr;
struct dm_regulator_uclass_plat *uc_pdata;
uc_pdata = dev_get_uclass_plat(dev);
adr = uc_pdata->ctrl_reg;
+ idx = dev->driver_data;
ret = pmic_reg_read(dev->parent, adr);
if (ret < 0)
return ret;
@@ -84,10 +85,18 @@ static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
return 0;
} else if (op == PMIC_OP_SET) {
- if (*enable)
+ if (*enable) {
ret |= TPS65941_BUCK_MODE_MASK;
- else
+ /* Enable FPWM */
+ ret |= TPS65941_BUCK_FPWM_MASK;
+ /* If Multiphase enable FPWM_MP */
+ if (idx == TPS65941_BUCK_ID_12 ||
+ idx == TPS65941_BUCK_ID_123 ||
+ idx == TPS65941_BUCK_ID_1234)
+ ret |= TPS65941_BUCK_FPWM_MP_MASK;
+ } else {
ret &= ~TPS65941_BUCK_MODE_MASK;
+ }
ret = pmic_reg_write(dev->parent, adr, ret);
if (ret)
return ret;
diff --git a/include/power/tps65941.h b/include/power/tps65941.h index a026ec56958..78e48a15972 100644
--- a/include/power/tps65941.h
+++ b/include/power/tps65941.h
@@ -19,7 +19,9 @@
#define TPS65941_BUCK_VOLT_MASK 0xFF
#define TPS65941_BUCK_VOLT_MAX_HEX 0xFF
#define TPS65941_BUCK_VOLT_MAX 3340000
-#define TPS65941_BUCK_MODE_MASK 0x1
+#define TPS65941_BUCK_MODE_MASK 0x1
+#define TPS65941_BUCK_FPWM_MASK 0x2
+#define TPS65941_BUCK_FPWM_MP_MASK 0x4
#define TPS65941_LDO_VOLT_MASK 0x7E
#define TPS65941_LDO_VOLT_MAX_HEX 0x3A
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] power: regulator: tps65941: Enable FPWM bits
2026-04-21 8:21 [PATCH v2] power: regulator: tps65941: Enable FPWM bits Neha Malcom Francis
2026-04-21 8:36 ` J, KEERTHY
@ 2026-04-21 12:26 ` Kumar, Udit
1 sibling, 0 replies; 3+ messages in thread
From: Kumar, Udit @ 2026-04-21 12:26 UTC (permalink / raw)
To: Neha Malcom Francis, trini, jh80.chung, peng.fan
Cc: j-keerthy, t-fujiwara1, u-boot, gehariprasath
Thanks for v2
On 4/21/2026 1:51 PM, Neha Malcom Francis wrote:
> Depending on the phase selection (single or multi), the FPWM bits
> configured forces the regulator to operate in PWM mode. In case of
> multi-phase selection, the FPWM_MP bits enforce the regulator to also
> operate in multi-phase. This fixes correct multi-phase operation.
>
> While at this, correct incorrect macro alignment as well.
>
> Fixes: 065a452ae6a1 ("power: regulator: tps65941: add regulator support")
> Link: https://www.ti.com/lit/ds/symlink/tps6594-q1.pdf
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> Signed-off-by: Takuma Fujiwara <t-fujiwara1@ti.com>
> Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
> ---
> [..]
> diff --git a/drivers/power/regulator/tps65941_regulator.c b/drivers/power/regulator/tps65941_regulator.c
> index 2561d6f4c6c..209968b5718 100644
> --- a/drivers/power/regulator/tps65941_regulator.c
> +++ b/drivers/power/regulator/tps65941_regulator.c
> @@ -63,13 +63,14 @@ static inline int tps65941_get_chip_id(struct udevice *dev)
>
> static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
> {
> - int ret;
> + int ret, idx;
> unsigned int adr;
> struct dm_regulator_uclass_plat *uc_pdata;
>
> uc_pdata = dev_get_uclass_plat(dev);
> adr = uc_pdata->ctrl_reg;
>
> + idx = dev->driver_data;
> ret = pmic_reg_read(dev->parent, adr);
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
> if (ret < 0)
> return ret;
> @@ -84,10 +85,18 @@ static int tps65941_buck_enable(struct udevice *dev, int op, bool *enable)
>
> return 0;
> } else if (op == PMIC_OP_SET) {
[..]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-21 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-21 8:21 [PATCH v2] power: regulator: tps65941: Enable FPWM bits Neha Malcom Francis
2026-04-21 8:36 ` J, KEERTHY
2026-04-21 12:26 ` Kumar, Udit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.