Linux-Rockchip Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Yaozhong Li <yaozhonguwl@gmail.com>
Cc: Lee Jones <lee@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	Chris Zhong <zyw@rock-chips.com>,
	Zhang Qing <zhangqing@rock-chips.com>,
	Joseph Chen <chenjh@rock-chips.com>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	mfd@lists.linux.dev, devicetree@vger.kernel.org,
	linux-rockchip@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/3] dt-bindings: mfd: rk8xx: add board level power hold GPIOs
Date: Tue, 20 Oct 2026 22:06:00 -0500	[thread overview]
Message-ID: <20261021030600.GA3816650-robh@kernel.org> (raw)
In-Reply-To: <20261020140127.720-2-yaozhonguwl@gmail.com>

On Tue, Oct 20, 2026 at 10:01:12PM +0800, Yaozhong Li wrote:
> Some boards route "power hold" lines from the SoC into the board's power
> circuitry. Those lines have to be held asserted while the system is
> running and released before the PMIC shutdown request is written,
> otherwise the rails can drop and come back up instead of staying off.
> 
> Add power-hold-gpios to describe those lines and power-hold-delay-ms for
> the settle time. The driver reads them for every RK8xx variant that is
> the system power controller, so add them to all seven RK8xx schemas.
> 
> The array is bounded at two entries. Firefly's vendor kernel handles
> exactly two such lines, pmic,hold-gpio and pmic,stby-gpio, and its board
> files use one or both of them, with an RK808 and with an RK818.
> 
> The lines are released from the PMIC's power-off path, so they are only
> meaningful when the PMIC is the system power controller. Require that,
> accepting whichever spellings of the property each schema allows.
> 
> Assisted-by: LLM
> Signed-off-by: Yaozhong Li <yaozhonguwl@gmail.com>
> ---
>  .../bindings/mfd/rockchip,rk801.yaml          | 23 +++++++++++++++
>  .../bindings/mfd/rockchip,rk805.yaml          | 29 +++++++++++++++++++
>  .../bindings/mfd/rockchip,rk806.yaml          | 23 +++++++++++++++
>  .../bindings/mfd/rockchip,rk808.yaml          | 29 +++++++++++++++++++
>  .../bindings/mfd/rockchip,rk816.yaml          | 23 +++++++++++++++
>  .../bindings/mfd/rockchip,rk817.yaml          | 29 +++++++++++++++++++
>  .../bindings/mfd/rockchip,rk818.yaml          | 29 +++++++++++++++++++
>  7 files changed, 185 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
> index 7c71447..2f9554d 100644
> --- a/Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk801.yaml
> @@ -29,6 +29,25 @@ properties:
>      description:
>        Telling whether or not this PMIC is controlling the system power.
>  
> +  power-hold-gpios:
> +    minItems: 1
> +    maxItems: 2
> +    description:
> +      Board level power hold lines driven by the SoC. They have to be held
> +      asserted while the system is running and released before the PMIC
> +      shutdown request is written, otherwise the rails can drop and come
> +      back up instead of staying off. Only meaningful when this PMIC is the
> +      system power controller, as the lines are released as part of its
> +      power-off path.
> +      The lines are released in the order listed, and power-hold-delay-ms
> +      elapses once, after the last of them.
> +
> +  power-hold-delay-ms:
> +    default: 0
> +    description:
> +      Time to wait after releasing power-hold-gpios before the shutdown
> +      request is written, to let the lines settle.
> +
>    wakeup-source:
>      type: boolean
>      description:
> @@ -71,6 +90,10 @@ properties:
>          unevaluatedProperties: false
>      additionalProperties: false
>  
> +dependencies:
> +  power-hold-delay-ms: [ power-hold-gpios ]
> +  power-hold-gpios: [ system-power-controller ]
> +
>  required:
>    - compatible
>    - reg
> diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
> index da23915..1a11c98 100644
> --- a/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk805.yaml
> @@ -48,6 +48,26 @@ properties:
>  
>    system-power-controller: true
>  
> +  power-hold-gpios:
> +    minItems: 1
> +    maxItems: 2
> +    description:
> +      Board level power hold lines driven by the SoC. They have to be held
> +      asserted while the system is running and released before the PMIC
> +      shutdown request is written, otherwise the rails can drop and come
> +      back up instead of staying off. Only meaningful when this PMIC is the
> +      system power controller, through either system-power-controller or
> +      the deprecated rockchip,system-power-controller, as the lines are
> +      released as part of its power-off path.
> +      The lines are released in the order listed, and power-hold-delay-ms
> +      elapses once, after the last of them.

If you have paragraphs, you need a '>' modifier and blank line between 
paragraphs.

> +
> +  power-hold-delay-ms:
> +    default: 0
> +    description:
> +      Time to wait after releasing power-hold-gpios before the shutdown
> +      request is written, to let the lines settle.
> +
>    wakeup-source:
>      type: boolean
>      description:
> @@ -102,6 +122,15 @@ allOf:
>          clock-output-names:
>            maxItems: 2
>  
> +dependencies:

If you are going to use dependentSchemas, then use dependentRequired 
here.

> +  power-hold-delay-ms: [ power-hold-gpios ]
> +
> +dependentSchemas:
> +  power-hold-gpios:
> +    anyOf:
> +      - required: [ system-power-controller ]
> +      - required: [ 'rockchip,system-power-controller' ]

Presumably the latter is deprecated. If you are updating a DT to use 
power-hold-gpios, then replace 'rockchip,system-power-controller' with 
'system-power-controller' while you are doing that. Then this can be 
just a dependentRequired entry.

Rob

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2026-10-21  3:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20 14:01 [PATCH v4 0/3] Fix poweroff restarting the board on Firefly-RK3399 Yaozhong Li
2026-10-20 14:01 ` [PATCH v4 1/3] dt-bindings: mfd: rk8xx: add board level power hold GPIOs Yaozhong Li
2026-10-21  3:06   ` Rob Herring [this message]
2026-10-20 14:01 ` [PATCH v4 2/3] mfd: rk8xx: Release the power hold GPIOs before powering off Yaozhong Li
2026-10-20 14:01 ` [PATCH v4 3/3] arm64: dts: rockchip: fix power-off on Firefly-RK3399 Yaozhong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261021030600.GA3816650-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=chenjh@rock-chips.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=krzk+dt@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mfd@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    --cc=yaozhonguwl@gmail.com \
    --cc=zhangqing@rock-chips.com \
    --cc=zyw@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox