2024-02-17 08:21:29

by Andreas Kemnade

[permalink] [raw]
Subject: [PATCH v4 0/5] mfd: twl: system-power-controller

Add system-power-controller property in the bindings and
the corresponding implementation and use it where
appropriate.
Not all cases are hit yet, there has probably to be a
separate series after going through with a brush.

Changes in v4:
- fix spelling/grammar
- drop twl4030 dts cleanup, it would need an IB
or be postponed till next release

Changes in v3:
- twl-core:
- remove repetitive verbose error messages
- placed constants at top part of function
- minor cleanups

Changes in v2:
- add A-By
- fix compiler warning

Andreas Kemnade (5):
dt-bindings: mfd: ti,twl: Document system-power-controller
twl-core: add power off implementation for twl603x
ARM: dts: omap-embt2ws: system-power-controller for bt200
ARM: dts: omap4-panda-common: Enable powering off the device
mfd: twl4030-power: accept standard property for power controller

.../devicetree/bindings/mfd/ti,twl.yaml | 2 ++
.../boot/dts/ti/omap/omap4-epson-embt2ws.dts | 1 +
.../boot/dts/ti/omap/omap4-panda-common.dtsi | 1 +
drivers/mfd/twl-core.c | 28 +++++++++++++++++++
drivers/mfd/twl4030-power.c | 3 ++
include/linux/mfd/twl.h | 1 +
6 files changed, 36 insertions(+)

--
2.39.2



2024-02-17 08:21:45

by Andreas Kemnade

[permalink] [raw]
Subject: [PATCH v4 4/5] ARM: dts: omap4-panda-common: Enable powering off the device

As the TWL6030 chip is the main power controller here, declare
it as system-power-controller

Signed-off-by: Andreas Kemnade <[email protected]>
---
arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi b/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi
index f528511c2537b..97706d6296a68 100644
--- a/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/ti/omap/omap4-panda-common.dtsi
@@ -408,6 +408,7 @@ twl: twl@48 {
reg = <0x48>;
/* IRQ# = 7 */
interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */
+ system-power-controller;
};

twl6040: twl@4b {
--
2.39.2


2024-02-17 08:21:50

by Andreas Kemnade

[permalink] [raw]
Subject: [PATCH v4 5/5] mfd: twl4030-power: accept standard property for power controller

Instead of only accepting the ti specific properties accept also
the standard property. For uniformity, search in the parent node
for the tag. The code for powering off is also isolated from the
rest in this file. So it is a pure Linux design decision to put it
here.

Signed-off-by: Andreas Kemnade <[email protected]>
---
drivers/mfd/twl4030-power.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
index 1595e9c76132d..0bca948ab6bae 100644
--- a/drivers/mfd/twl4030-power.c
+++ b/drivers/mfd/twl4030-power.c
@@ -686,6 +686,9 @@ static bool twl4030_power_use_poweroff(const struct twl4030_power_data *pdata,
if (of_property_read_bool(node, "ti,use_poweroff"))
return true;

+ if (of_device_is_system_power_controller(node->parent))
+ return true;
+
return false;
}

--
2.39.2


2024-02-23 16:21:29

by Lee Jones

[permalink] [raw]
Subject: Re: (subset) [PATCH v4 0/5] mfd: twl: system-power-controller

On Sat, 17 Feb 2024 09:20:02 +0100, Andreas Kemnade wrote:
> Add system-power-controller property in the bindings and
> the corresponding implementation and use it where
> appropriate.
> Not all cases are hit yet, there has probably to be a
> separate series after going through with a brush.
>
> Changes in v4:
> - fix spelling/grammar
> - drop twl4030 dts cleanup, it would need an IB
> or be postponed till next release
>
> [...]

Applied, thanks!

[1/5] dt-bindings: mfd: ti,twl: Document system-power-controller
commit: 0c7cc7497f6f62a65037e94cf0d885ab0af3c0d3
[2/5] twl-core: add power off implementation for twl603x
commit: ca9414a1d08756c8392f9219caee607e1b7bade1
[5/5] mfd: twl4030-power: accept standard property for power controller
commit: 8ba560ec14267af1169e1f5407fbce514fd4f6f6

--
Lee Jones [李琼斯]


2024-02-26 15:51:43

by Tony Lindgren

[permalink] [raw]
Subject: Re: (subset) [PATCH v4 0/5] mfd: twl: system-power-controller

* Lee Jones <[email protected]> [240223 16:12]:
> On Sat, 17 Feb 2024 09:20:02 +0100, Andreas Kemnade wrote:
> > Add system-power-controller property in the bindings and
> > the corresponding implementation and use it where
> > appropriate.
> > Not all cases are hit yet, there has probably to be a
> > separate series after going through with a brush.
> >
> > Changes in v4:
> > - fix spelling/grammar
> > - drop twl4030 dts cleanup, it would need an IB
> > or be postponed till next release
> >
> > [...]
>
> Applied, thanks!
>
> [1/5] dt-bindings: mfd: ti,twl: Document system-power-controller
> commit: 0c7cc7497f6f62a65037e94cf0d885ab0af3c0d3
> [2/5] twl-core: add power off implementation for twl603x
> commit: ca9414a1d08756c8392f9219caee607e1b7bade1
> [5/5] mfd: twl4030-power: accept standard property for power controller
> commit: 8ba560ec14267af1169e1f5407fbce514fd4f6f6

Applying the two dts changes into omap-for-v6.9/dt thanks.

Tony