Skip to contentSkip to conversation

Add support for poweroff via RK806 PMIC

PATCH Superseded Ondřej Jirman 2 participants 4 messages Oct 10, 2023

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover 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

v2:
- add a missing driver patch

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

 Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 5 +++++
 drivers/mfd/rk8xx-core.c                                  | 4 ++++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.42.0
#1 lore raw

PATCH v2 1/2 dt-bindings: mfd: rk806: Allow rockchip,system-power-controller property

From: Ondrej Jirman <[email protected]>

Declare support for this property.

---
 Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml +5 -0
index cf2500f2e9a0..e8c9f17f6ea8 100644
@@ -29,6 +29,11 @@ properties:
   '#gpio-cells':
     const: 2
 
+  rockchip,system-power-controller:
+    type: boolean
+    description:
+      Telling whether or not this PMIC is controlling the system power.
+
   vcc1-supply:
     description:
       The input supply for dcdc-reg1.
Signature · 1 line
2.42.0
maintainer
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: mfd: rk806: Allow rockchip,system-power-controller property

Quoted 14 lines · Ondřej Jirman

From: Ondrej Jirman <[email protected]>

Declare support for this property.

---
 Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml +0 -0
index cf2500f2e9a0..e8c9f17f6ea8 100644

Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml properties: · line 35

Quoted 7 lines
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml +4 -0
@@ -29,6 +29,11 @@ properties:
   '#gpio-cells':
     const: 2
 
+  rockchip,system-power-controller:
+    type: boolean
+    description:
+      Telling whether or not this PMIC is controlling the system power.

New users should use the common 'system-power-controller'.

Feel free to mark rockchip,system-power-controller deprecated and add 'system-power-controller' on the existing Rockchip PMIC bindings.

Quoted 7 lines
Documentation/devicetree/bindings/mfd/rockchip,rk806.yaml +1 -0
+
   vcc1-supply:
     description:
       The input supply for dcdc-reg1.
Signature · 1 line
2.42.0
#3 lore raw

PATCH v2 2/2 mfd: rk8xx: Add support for RK806 power off

In reply to Ondřej Jirman

From: Ondrej Jirman <[email protected]>

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

---
 drivers/mfd/rk8xx-core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/mfd/rk8xx-core.c +4 -0
index 11a831e92da8..ef40050f1169 100644
@@ -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;
Signature · 1 line
2.42.0