2023-10-10 17:42:12

by Ondřej Jirman

[permalink] [raw]
Subject: [PATCH v3 0/4] Add support for poweroff via RK806 PMIC

From: Ondrej Jirman <[email protected]>

The PMIC supports powering off by twiddling some bits in a register. Add support
for it via pre-existing rockchip,system-power-controller DT property.

The series was tested against Linux 6.6-rc4.

Please take a look.

Thank you,
Ondřej Jirman

v3:
- use system-power-controller
- deprecate rockchip,system-power-controller
v2:
- add a missing driver patch

Ondrej Jirman (4):
dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller
dt-bindings: mfd: rk806: Allow system-power-controller property
mfd: rk8xx: Add support for standard system-power-controller property
mfd: rk8xx: Add support for RK806 power off

Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 2 ++
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
drivers/mfd/rk8xx-core.c | 7 ++++++-
7 files changed, 23 insertions(+), 1 deletion(-)

--
2.42.0


2023-10-10 17:42:15

by Ondřej Jirman

[permalink] [raw]
Subject: [PATCH v3 4/4] mfd: rk8xx: Add support for RK806 power off

From: Ondrej Jirman <[email protected]>

Use DEV_OFF bit to power off the RK806 PMIC, when system-power-controller
is used in DTS.

Signed-off-by: Ondrej Jirman <[email protected]>
---
drivers/mfd/rk8xx-core.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/mfd/rk8xx-core.c b/drivers/mfd/rk8xx-core.c
index a50a181b18e9..c47164a3ec1d 100644
--- a/drivers/mfd/rk8xx-core.c
+++ b/drivers/mfd/rk8xx-core.c
@@ -525,6 +525,10 @@ static int rk808_power_off(struct sys_off_data *data)
reg = RK805_DEV_CTRL_REG;
bit = DEV_OFF;
break;
+ case RK806_ID:
+ reg = RK806_SYS_CFG3;
+ bit = DEV_OFF;
+ break;
case RK808_ID:
reg = RK808_DEVCTRL_REG,
bit = DEV_OFF_RST;
--
2.42.0

2023-10-10 17:42:18

by Ondřej Jirman

[permalink] [raw]
Subject: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

From: Ondrej Jirman <[email protected]>

Deprecate support for this property in favor of standard
system-power-controller one.

Signed-off-by: Ondrej Jirman <[email protected]>
---
Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
5 files changed, 15 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
index 4992f71b6fc3..ec5e0fadef95 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
@@ -42,9 +42,12 @@ properties:

rockchip,system-power-controller:
type: boolean
+ deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.

+ system-power-controller: true
+
wakeup-source:
type: boolean
description:
diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
index f5908fa01a61..f1364c66cd62 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml
@@ -37,9 +37,12 @@ properties:

rockchip,system-power-controller:
type: boolean
+ deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.

+ system-power-controller: true
+
wakeup-source:
type: boolean
description:
diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
index 7fb849ac74a7..382bb2f87a54 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
@@ -37,9 +37,12 @@ properties:

rockchip,system-power-controller:
type: boolean
+ deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.

+ system-power-controller: true
+
wakeup-source:
type: boolean
description:
diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
index 269fb85b2027..92b1592e8942 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml
@@ -38,9 +38,12 @@ properties:

rockchip,system-power-controller:
type: boolean
+ deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.

+ system-power-controller: true
+
wakeup-source:
type: boolean
description:
diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
index b57c4b005cf4..038804ff708d 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml
@@ -37,9 +37,12 @@ properties:

rockchip,system-power-controller:
type: boolean
+ deprecated: true
description:
Telling whether or not this PMIC is controlling the system power.

+ system-power-controller: true
+
wakeup-source:
type: boolean
description:
--
2.42.0

2023-10-10 17:42:26

by Ondřej Jirman

[permalink] [raw]
Subject: [PATCH v3 2/4] dt-bindings: mfd: rk806: Allow system-power-controller property

From: Ondrej Jirman <[email protected]>

Declare support for this property.

Signed-off-by: Ondrej Jirman <[email protected]>
---
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
index cf2500f2e9a0..3c2b06629b75 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml
@@ -29,6 +29,8 @@ properties:
'#gpio-cells':
const: 2

+ system-power-controller: true
+
vcc1-supply:
description:
The input supply for dcdc-reg1.
--
2.42.0

2023-10-11 16:38:30

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH v3 0/4] Add support for poweroff via RK806 PMIC

Hi,

On Tue, Oct 10, 2023 at 07:41:15PM +0200, Ondřej Jirman wrote:
> From: Ondrej Jirman <[email protected]>
>
> The PMIC supports powering off by twiddling some bits in a register. Add support
> for it via pre-existing rockchip,system-power-controller DT property.
>
> The series was tested against Linux 6.6-rc4.
>
> Please take a look.
>
> Thank you,
> Ondřej Jirman
>
> v3:
> - use system-power-controller
> - deprecate rockchip,system-power-controller
> v2:
> - add a missing driver patch
>
> Ondrej Jirman (4):
> dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller
> dt-bindings: mfd: rk806: Allow system-power-controller property
> mfd: rk8xx: Add support for standard system-power-controller property
> mfd: rk8xx: Add support for RK806 power off
>
> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 2 ++
> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> drivers/mfd/rk8xx-core.c | 7 ++++++-
> 7 files changed, 23 insertions(+), 1 deletion(-)

The series is

Reviewed-by: Sebastian Reichel <[email protected]>

Thanks,

-- Sebastian


Attachments:
(No filename) (1.44 kB)
signature.asc (849.00 B)
Download all attachments

2023-10-12 20:01:06

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 2/4] dt-bindings: mfd: rk806: Allow system-power-controller property


On Tue, 10 Oct 2023 19:41:17 +0200, Ondřej Jirman wrote:
> From: Ondrej Jirman <[email protected]>
>
> Declare support for this property.
>
> Signed-off-by: Ondrej Jirman <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>

Reviewed-by: Rob Herring <[email protected]>

2023-10-12 20:01:21

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller


On Tue, 10 Oct 2023 19:41:16 +0200, Ondřej Jirman wrote:
> From: Ondrej Jirman <[email protected]>
>
> Deprecate support for this property in favor of standard
> system-power-controller one.
>
> Signed-off-by: Ondrej Jirman <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> 5 files changed, 15 insertions(+)
>

Reviewed-by: Rob Herring <[email protected]>

2023-10-19 10:30:43

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

On Tue, 10 Oct 2023, Ondřej Jirman wrote:

> From: Ondrej Jirman <[email protected]>
>
> Deprecate support for this property in favor of standard
> system-power-controller one.
>
> Signed-off-by: Ondrej Jirman <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> 5 files changed, 15 insertions(+)

I don't see anything wrong with it.

It would be nice to have a DT Ack though.

--
Lee Jones [李琼斯]

2023-10-19 10:30:56

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

On 19/10/2023 12:29, Lee Jones wrote:
> On Tue, 10 Oct 2023, Ondřej Jirman wrote:
>
>> From: Ondrej Jirman <[email protected]>
>>
>> Deprecate support for this property in favor of standard
>> system-power-controller one.
>>
>> Signed-off-by: Ondrej Jirman <[email protected]>
>> ---
>> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
>> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
>> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
>> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
>> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
>> 5 files changed, 15 insertions(+)
>
> I don't see anything wrong with it.
>
> It would be nice to have a DT Ack though.

Rob gave review on 12th Oct.

Best regards,
Krzysztof

2023-10-19 13:52:09

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

On Thu, 19 Oct 2023, Krzysztof Kozlowski wrote:

> On 19/10/2023 12:29, Lee Jones wrote:
> > On Tue, 10 Oct 2023, Ondřej Jirman wrote:
> >
> >> From: Ondrej Jirman <[email protected]>
> >>
> >> Deprecate support for this property in favor of standard
> >> system-power-controller one.
> >>
> >> Signed-off-by: Ondrej Jirman <[email protected]>
> >> ---
> >> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> >> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> >> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> >> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> >> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> >> 5 files changed, 15 insertions(+)
> >
> > I don't see anything wrong with it.
> >
> > It would be nice to have a DT Ack though.
>
> Rob gave review on 12th Oct.

This new version was submitted on the 10th Oct.

--
Lee Jones [李琼斯]

2023-10-19 14:03:28

by Ondřej Jirman

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

On Thu, Oct 19, 2023 at 02:50:32PM +0100, Lee Jones wrote:
>
> On Thu, 19 Oct 2023, Krzysztof Kozlowski wrote:
>
> > On 19/10/2023 12:29, Lee Jones wrote:
> > > On Tue, 10 Oct 2023, Ondřej Jirman wrote:
> > >
> > >> From: Ondrej Jirman <[email protected]>
> > >>
> > >> Deprecate support for this property in favor of standard
> > >> system-power-controller one.
> > >>
> > >> Signed-off-by: Ondrej Jirman <[email protected]>
> > >> ---
> > >> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> > >> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> > >> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> > >> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> > >> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> > >> 5 files changed, 15 insertions(+)
> > >
> > > I don't see anything wrong with it.
> > >
> > > It would be nice to have a DT Ack though.
> >
> > Rob gave review on 12th Oct.
>
> This new version was submitted on the 10th Oct.

https://lore.kernel.org/lkml/[email protected]/

> --
> Lee Jones [李琼斯]

2023-10-19 15:01:20

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v3 1/4] dt-bindings: mfd: rk8xx: Deprecate rockchip,system-power-controller

On Thu, 19 Oct 2023, Ondřej Jirman wrote:

> On Thu, Oct 19, 2023 at 02:50:32PM +0100, Lee Jones wrote:
> >
> > On Thu, 19 Oct 2023, Krzysztof Kozlowski wrote:
> >
> > > On 19/10/2023 12:29, Lee Jones wrote:
> > > > On Tue, 10 Oct 2023, Ondřej Jirman wrote:
> > > >
> > > >> From: Ondrej Jirman <[email protected]>
> > > >>
> > > >> Deprecate support for this property in favor of standard
> > > >> system-power-controller one.
> > > >>
> > > >> Signed-off-by: Ondrej Jirman <[email protected]>
> > > >> ---
> > > >> Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml | 3 +++
> > > >> Documentation/devicetree/bindings/mfd/rockchip,rk808.yaml | 3 +++
> > > >> Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml | 3 +++
> > > >> Documentation/devicetree/bindings/mfd/rockchip,rk817.yaml | 3 +++
> > > >> Documentation/devicetree/bindings/mfd/rockchip,rk818.yaml | 3 +++
> > > >> 5 files changed, 15 insertions(+)
> > > >
> > > > I don't see anything wrong with it.
> > > >
> > > > It would be nice to have a DT Ack though.
> > >
> > > Rob gave review on 12th Oct.
> >
> > This new version was submitted on the 10th Oct.
>
> https://lore.kernel.org/lkml/[email protected]/

Please collect it up along with any other tags you've received and
submit a [RESEND] set. Thanks.

--
Lee Jones [李琼斯]