Message ID | 20230516132225.3012541-3-sean@geanix.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp441143vqo; Tue, 16 May 2023 06:49:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7awT4r016GI0IvY6EeSLXUZ+ukjrljXJjVYexvdyJ/FcMB/KYGY9Pjw5wAntdGKw2DxH43 X-Received: by 2002:a05:6a20:a11e:b0:104:242a:9a78 with SMTP id q30-20020a056a20a11e00b00104242a9a78mr21893096pzk.2.1684244964970; Tue, 16 May 2023 06:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684244964; cv=none; d=google.com; s=arc-20160816; b=W1lLQe6i328UMxwQgW8qpZPtSJtykxTRMwUS2bqN6WwOGv14Q21Mw+LB0B0tE/7CYf 9qngXsUMmz7KhzeIsoIHAjZ7NQygVgkYWdgwHBMLBDnmFHc8Hmmccrh9Q4ee0vUOqRDv Z3/NKSmcO61MQw5x99zSiyjAJGL5gxrC/YGLpa3rFtD80vEwVpXJHvsjXisLG0ZybH1Z dsuUp0DF1lg8Y+SzSt13Qbgs6Zm3IgfAF5TmWFtMe5Ue6XqDd2CnP7CFQ4+oliEAKuub J2wVs3KNvdJ2wEFzexY2JbXsI6rRPSie2TusRike/8N+EbS7RbnUn/bWfJhAicu3r6Yp mJqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Tc4N6cacmpKk5k4on8VEF7pB3edhIp5X8MzTz70xu0Q=; b=AuVT0odbZ0XoExPJlOPbvma0/e/fFqMPJvoD+xOld4aCkAO88N/FeES4Azdm8UMeD4 aWytMOdAMuc6MBBHoEaxlc+RHkau77WbN8UBFUbKuW0FJsdWKX0LmaeBv/hMy6ZjmWe6 gpzPtIPwQqtFGmxjXqscdifJhZ6XvjmCYqo/ZtqC/z2SJjE8uGP6VonjnwfCXHWpFpXm bN/qoUQoJVqxz4+WIyRbMsG8PEqdEGDlvR5o6xdv0SBsm9AqdhSEOZ73RYJ2wMbYouNn JVJocqpegHTKrZMxYC3/UwF8tL3pABv9OGAlBu8Oc2Ei20fWBaF+sxvSXQ2ylsLb27w5 x0Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=V4ydLiGb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x26-20020aa7941a000000b00643652c8879si19848398pfo.326.2023.05.16.06.49.10; Tue, 16 May 2023 06:49:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=default2211 header.b=V4ydLiGb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233648AbjEPNiJ (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Tue, 16 May 2023 09:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233298AbjEPNiG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 16 May 2023 09:38:06 -0400 Received: from www530.your-server.de (www530.your-server.de [188.40.30.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1086CA; Tue, 16 May 2023 06:38:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=geanix.com; s=default2211; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID; bh=Tc4N6cacmpKk5k4on8VEF7pB3edhIp5X8MzTz70xu0Q=; b=V4ydLiGbTg7AztiSATz1zSo8dd DlIqofKsUzJRdOOOpdJkrzr2lEM6WLJUl85oHIz7IEhdy0L+1m3enmVBD8rqHhx7IMz/0rPeDb4IS uz4zS3Q3eaVS8qxMrJPKO0CtQdJzn3GyeAswiDYe28gMofn0hyBOvKM79cwYKmDTQt8ChzlHd5/lG hVzYTnuPZtlfEEybVZDjanyl9Y4fVsvDdgjvQNEeg9O3DMjclBjVYYYylhCE1ppgrYwU/w99xYO77 jJsgQTdV0hPKWRkgF3vMNiDOkyHqfhTBB0VllVO6OAHqiOuV/w1aPTyc+oJtYj4vr9kkqKFcniFk3 mPWZNKmg==; Received: from sslproxy03.your-server.de ([88.198.220.132]) by www530.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <sean@geanix.com>) id 1pyudb-000AJG-94; Tue, 16 May 2023 15:22:47 +0200 Received: from [185.17.218.86] (helo=zen..) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <sean@geanix.com>) id 1pyuda-000NS5-RA; Tue, 16 May 2023 15:22:46 +0200 From: Sean Nyekjaer <sean@geanix.com> To: robh+dt@kernel.org, Lee Jones <lee@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, pascal Paillet <p.paillet@foss.st.com> Cc: devicetree@vger.kernel.org, Sean Nyekjaer <sean@geanix.com>, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] dt-bindings: mfd: stpmic1: add fsl,pmic-poweroff property Date: Tue, 16 May 2023 15:22:24 +0200 Message-Id: <20230516132225.3012541-3-sean@geanix.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230516132225.3012541-1-sean@geanix.com> References: <20230516132225.3012541-1-sean@geanix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Authenticated-Sender: sean@geanix.com X-Virus-Scanned: Clear (ClamAV 0.103.8/26908/Tue May 16 09:24:20 2023) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766058848545318138?= X-GMAIL-MSGID: =?utf-8?q?1766058848545318138?= |
Series |
[v2,1/3] mfd: stpmic1: fixup main control register and bits naming
|
|
Commit Message
Sean Nyekjaer
May 16, 2023, 1:22 p.m. UTC
Document the new optional "fsl,pmic-poweroff" property.
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
Hey Sean, On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: > Document the new optional "fsl,pmic-poweroff" property. > > Signed-off-by: Sean Nyekjaer <sean@geanix.com> > --- > Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > index 9573e4af949e..5183a7c660d2 100644 > --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > @@ -26,6 +26,14 @@ properties: > > interrupt-controller: true > > + st,pmic-poweroff: > + $ref: /schemas/types.yaml#/definitions/flag > + description: | > + if present, configure the PMIC to shutdown all power rails when > + power off sequence have finished. > + Use this option if the SoC should be powered off by external power management > + IC (PMIC). Just reading this description, this is sounding quite like a "software behaviour" type of property, which are not permitted, rather than describing some element of the hardware. Clearly you are trying to solve an actual problem though, so try re-phrasing the description (and property name) to focus on what exact hardware configuration it is that you are trying to special-case. Krzysztof suggested that the samsung,s2mps11-acokb-ground property in samsung,s2mps11.yaml is addressing a similar problem, so that could be good to look at. Also, the dt-binding patch should go before the patch adding the property to the driver. Thanks, Conor.
Hey Conor, > On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: > > Hey Sean, > > On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >> Document the new optional "fsl,pmic-poweroff" property. >> >> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >> --- >> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >> index 9573e4af949e..5183a7c660d2 100644 >> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >> @@ -26,6 +26,14 @@ properties: >> >> interrupt-controller: true >> >> + st,pmic-poweroff: >> + $ref: /schemas/types.yaml#/definitions/flag >> + description: | >> + if present, configure the PMIC to shutdown all power rails when >> + power off sequence have finished. >> + Use this option if the SoC should be powered off by external power management >> + IC (PMIC). > > Just reading this description, this is sounding quite like a "software > behaviour" type of property, which are not permitted, rather than > describing some element of the hardware. Clearly you are trying to solve > an actual problem though, so try re-phrasing the description (and > property name) to focus on what exact hardware configuration it is that > you are trying to special-case. > Krzysztof suggested that the samsung,s2mps11-acokb-ground property in > samsung,s2mps11.yaml is addressing a similar problem, so that could be > good to look at. Better wording? Indicates that the power management IC (PMIC) is used to power off the board. So as the last step in the power off sequence set the SWOFF bit in the main control register (MAIN_CR) register, to shutdown all power rails. > > Also, the dt-binding patch should go before the patch adding the > property to the driver. > I will switch them around. > Thanks, > Conor. /Sean
On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: > > On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: > > On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: > >> Document the new optional "fsl,pmic-poweroff" property. > >> > >> Signed-off-by: Sean Nyekjaer <sean@geanix.com> > >> --- > >> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ > >> 1 file changed, 8 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >> index 9573e4af949e..5183a7c660d2 100644 > >> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >> @@ -26,6 +26,14 @@ properties: > >> > >> interrupt-controller: true > >> > >> + st,pmic-poweroff: > >> + $ref: /schemas/types.yaml#/definitions/flag > >> + description: | > >> + if present, configure the PMIC to shutdown all power rails when > >> + power off sequence have finished. > >> + Use this option if the SoC should be powered off by external power management > >> + IC (PMIC). > > > > Just reading this description, this is sounding quite like a "software > > behaviour" type of property, which are not permitted, rather than > > describing some element of the hardware. Clearly you are trying to solve > > an actual problem though, so try re-phrasing the description (and > > property name) to focus on what exact hardware configuration it is that > > you are trying to special-case. > > Krzysztof suggested that the samsung,s2mps11-acokb-ground property in > > samsung,s2mps11.yaml is addressing a similar problem, so that could be > > good to look at. > > Better wording? > Indicates that the power management IC (PMIC) is used to power off the board. > So as the last step in the power off sequence set the SWOFF bit in the > main control register (MAIN_CR) register, to shutdown all power rails. The description for the property that Krzysztof mentioned is samsung,s2mps11-acokb-ground: description: | Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will trigger power off. In other words, I am asking what (abnormal?) scenario there is that means you need the property, rather than what setting the property does. Or am I totally off, and this is the only way this PMIC works? Cheers, Conor.
Hi Conor, > On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: > > On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: >>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: >>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >>>> Document the new optional "fsl,pmic-poweroff" property. >>>> >>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >>>> --- >>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >>>> 1 file changed, 8 insertions(+) >>>> >>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>> index 9573e4af949e..5183a7c660d2 100644 >>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>> @@ -26,6 +26,14 @@ properties: >>>> >>>> interrupt-controller: true >>>> >>>> + st,pmic-poweroff: >>>> + $ref: /schemas/types.yaml#/definitions/flag >>>> + description: | >>>> + if present, configure the PMIC to shutdown all power rails when >>>> + power off sequence have finished. >>>> + Use this option if the SoC should be powered off by external power management >>>> + IC (PMIC). >>> >>> Just reading this description, this is sounding quite like a "software >>> behaviour" type of property, which are not permitted, rather than >>> describing some element of the hardware. Clearly you are trying to solve >>> an actual problem though, so try re-phrasing the description (and >>> property name) to focus on what exact hardware configuration it is that >>> you are trying to special-case. >>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in >>> samsung,s2mps11.yaml is addressing a similar problem, so that could be >>> good to look at. >> >> Better wording? >> Indicates that the power management IC (PMIC) is used to power off the board. >> So as the last step in the power off sequence set the SWOFF bit in the >> main control register (MAIN_CR) register, to shutdown all power rails. > > The description for the property that Krzysztof mentioned is > samsung,s2mps11-acokb-ground: > description: | > Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so > the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the > power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes > low, the rising ACOKB will trigger power off. > > In other words, I am asking what (abnormal?) scenario there is that means > you need the property, rather than what setting the property does. > Or am I totally off, and this is the only way this PMIC works? Indicates that the power management IC (PMIC) turn-off condition is met by setting the SWOFF bit in the main control register (MAIN_CR) register. Turn-off condition can still be reached by the PONKEY input. ? I must admit I’m somewhat lost here :) /Sean
On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: > Hi Conor, > > > On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: > > > > On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: > >>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: > >>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: > >>>> Document the new optional "fsl,pmic-poweroff" property. > >>>> > >>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> > >>>> --- > >>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ > >>>> 1 file changed, 8 insertions(+) > >>>> > >>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>> index 9573e4af949e..5183a7c660d2 100644 > >>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>> @@ -26,6 +26,14 @@ properties: > >>>> > >>>> interrupt-controller: true > >>>> > >>>> + st,pmic-poweroff: > >>>> + $ref: /schemas/types.yaml#/definitions/flag > >>>> + description: | > >>>> + if present, configure the PMIC to shutdown all power rails when > >>>> + power off sequence have finished. > >>>> + Use this option if the SoC should be powered off by external power management > >>>> + IC (PMIC). > >>> > >>> Just reading this description, this is sounding quite like a "software > >>> behaviour" type of property, which are not permitted, rather than > >>> describing some element of the hardware. Clearly you are trying to solve > >>> an actual problem though, so try re-phrasing the description (and > >>> property name) to focus on what exact hardware configuration it is that > >>> you are trying to special-case. > >>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in > >>> samsung,s2mps11.yaml is addressing a similar problem, so that could be > >>> good to look at. > >> > >> Better wording? > >> Indicates that the power management IC (PMIC) is used to power off the board. > >> So as the last step in the power off sequence set the SWOFF bit in the > >> main control register (MAIN_CR) register, to shutdown all power rails. > > > > The description for the property that Krzysztof mentioned is > > samsung,s2mps11-acokb-ground: > > description: | > > Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so > > the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the > > power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes > > low, the rising ACOKB will trigger power off. > > > > In other words, I am asking what (abnormal?) scenario there is that means > > you need the property, rather than what setting the property does. > > Or am I totally off, and this is the only way this PMIC works? > > Indicates that the power management IC (PMIC) turn-off condition is met > by setting the SWOFF bit in the main control register (MAIN_CR) register. > Turn-off condition can still be reached by the PONKEY input. > > ? > > I must admit I’m somewhat lost here :) Sorry about that. I'm trying to understand what is different about your hardware that it needs the property rather than what adding the property does. If you look at the samsung one, it describes both the configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to the ground") and how that is different from normal ("Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will trigger power off.") Looking at your datasheet, you don't have such a pin though - just the sw poweroff bit & the PONKEY stuff. My angle is just that I am trying to figure out why you need this property when it has not been needed before. Or why you would not always want to "shutdown all power rails when power-off sequence have finished". I'm sorry if these are silly questions.
> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: > > On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: >> Hi Conor, >> >>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: >>> >>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: >>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: >>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >>>>>> Document the new optional "fsl,pmic-poweroff" property. >>>>>> >>>>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >>>>>> --- >>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >>>>>> 1 file changed, 8 insertions(+) >>>>>> >>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>> index 9573e4af949e..5183a7c660d2 100644 >>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>> @@ -26,6 +26,14 @@ properties: >>>>>> >>>>>> interrupt-controller: true >>>>>> >>>>>> + st,pmic-poweroff: >>>>>> + $ref: /schemas/types.yaml#/definitions/flag >>>>>> + description: | >>>>>> + if present, configure the PMIC to shutdown all power rails when >>>>>> + power off sequence have finished. >>>>>> + Use this option if the SoC should be powered off by external power management >>>>>> + IC (PMIC). >>>>> >>>>> Just reading this description, this is sounding quite like a "software >>>>> behaviour" type of property, which are not permitted, rather than >>>>> describing some element of the hardware. Clearly you are trying to solve >>>>> an actual problem though, so try re-phrasing the description (and >>>>> property name) to focus on what exact hardware configuration it is that >>>>> you are trying to special-case. >>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in >>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be >>>>> good to look at. >>>> >>>> Better wording? >>>> Indicates that the power management IC (PMIC) is used to power off the board. >>>> So as the last step in the power off sequence set the SWOFF bit in the >>>> main control register (MAIN_CR) register, to shutdown all power rails. >>> >>> The description for the property that Krzysztof mentioned is >>> samsung,s2mps11-acokb-ground: >>> description: | >>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so >>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the >>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes >>> low, the rising ACOKB will trigger power off. >>> >>> In other words, I am asking what (abnormal?) scenario there is that means >>> you need the property, rather than what setting the property does. >>> Or am I totally off, and this is the only way this PMIC works? >> >> Indicates that the power management IC (PMIC) turn-off condition is met >> by setting the SWOFF bit in the main control register (MAIN_CR) register. >> Turn-off condition can still be reached by the PONKEY input. >> >> ? >> >> I must admit I’m somewhat lost here :) > > Sorry about that. I'm trying to understand what is different about your > hardware that it needs the property rather than what adding the property > does. If you look at the samsung one, it describes both the > configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to > the ground") and how that is different from normal ("Usually the ACOKB is > pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will > trigger power off.") > > Looking at your datasheet, you don't have such a pin though - just the > sw poweroff bit & the PONKEY stuff. My angle is just that I am trying > to figure out why you need this property when it has not been needed > before. Or why you would not always want to "shutdown all power rails > when power-off sequence have finished". I'm sorry if these are silly > questions. > No silly questions, maybe they trick me to come up with the correct answer :D Basically without this, you won’t be able to power off the system other than hitting the PONKEY. So it’s a new feature that wasn’t supported before. Maybe this feature should not be optional? If st,pmic-poweroff == true: System will power off as the last step in the power off sequence. If st,pmic-powerof == false: System will reboot in the last step in the power off sequence. I thought of this, as an always on system failsafe. /Sean
Hey Sean, Lee, On Wed, May 24, 2023 at 12:30:59PM +0200, Sean Nyekjaer wrote: > > On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: > > On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: > >>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: > >>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: > >>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: > >>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: > >>>>>> + st,pmic-poweroff: > >>>>>> + $ref: /schemas/types.yaml#/definitions/flag > >>>>>> + description: | > >>>>>> + if present, configure the PMIC to shutdown all power rails when > >>>>>> + power off sequence have finished. > >>>>>> + Use this option if the SoC should be powered off by external power management > >>>>>> + IC (PMIC). > >>>>> > >>>>> Just reading this description, this is sounding quite like a "software > >>>>> behaviour" type of property, which are not permitted, rather than > >>>>> describing some element of the hardware. Clearly you are trying to solve > >>>>> an actual problem though, so try re-phrasing the description (and > >>>>> property name) to focus on what exact hardware configuration it is that > >>>>> you are trying to special-case. > >>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in > >>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be > >>>>> good to look at. > >>> The description for the property that Krzysztof mentioned is > >>> samsung,s2mps11-acokb-ground: > >>> description: | > >>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so > >>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the > >>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes > >>> low, the rising ACOKB will trigger power off. > >>> > >>> In other words, I am asking what (abnormal?) scenario there is that means > >>> you need the property, rather than what setting the property does. > >>> Or am I totally off, and this is the only way this PMIC works? > >> > >> Indicates that the power management IC (PMIC) turn-off condition is met > >> by setting the SWOFF bit in the main control register (MAIN_CR) register. > >> Turn-off condition can still be reached by the PONKEY input. > >> > >> ? > >> > >> I must admit I’m somewhat lost here :) > > > > Sorry about that. I'm trying to understand what is different about your > > hardware that it needs the property rather than what adding the property > > does. If you look at the samsung one, it describes both the > > configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to > > the ground") and how that is different from normal ("Usually the ACOKB is > > pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will > > trigger power off.") > > > > Looking at your datasheet, you don't have such a pin though - just the > > sw poweroff bit & the PONKEY stuff. My angle is just that I am trying > > to figure out why you need this property when it has not been needed > > before. Or why you would not always want to "shutdown all power rails > > when power-off sequence have finished". I'm sorry if these are silly > > questions. > > > > No silly questions, maybe they trick me to come up with the correct answer :D > > Basically without this, you won’t be able to power off the system > other than hitting the PONKEY. > So it’s a new feature that wasn’t supported before. > Maybe this feature should not be optional? Yeah, I suppose that is the rabbit-hole that the silly questions lead down. I don't know the answer to that though. Maybe Lee does? > If st,pmic-poweroff == true: > System will power off as the last step in the power off sequence. > If st,pmic-powerof == false: > System will reboot in the last step in the power off sequence. > > I thought of this, as an always on system failsafe. > > /Sean
On 24/05/2023 12:30, Sean Nyekjaer wrote: > > >> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: >> >> On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: >>> Hi Conor, >>> >>>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: >>>> >>>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: >>>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: >>>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >>>>>>> Document the new optional "fsl,pmic-poweroff" property. >>>>>>> >>>>>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >>>>>>> --- >>>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >>>>>>> 1 file changed, 8 insertions(+) >>>>>>> >>>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>> index 9573e4af949e..5183a7c660d2 100644 >>>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>> @@ -26,6 +26,14 @@ properties: >>>>>>> >>>>>>> interrupt-controller: true >>>>>>> >>>>>>> + st,pmic-poweroff: >>>>>>> + $ref: /schemas/types.yaml#/definitions/flag >>>>>>> + description: | >>>>>>> + if present, configure the PMIC to shutdown all power rails when >>>>>>> + power off sequence have finished. >>>>>>> + Use this option if the SoC should be powered off by external power management >>>>>>> + IC (PMIC). >>>>>> >>>>>> Just reading this description, this is sounding quite like a "software >>>>>> behaviour" type of property, which are not permitted, rather than >>>>>> describing some element of the hardware. Clearly you are trying to solve >>>>>> an actual problem though, so try re-phrasing the description (and >>>>>> property name) to focus on what exact hardware configuration it is that >>>>>> you are trying to special-case. >>>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in >>>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be >>>>>> good to look at. >>>>> >>>>> Better wording? >>>>> Indicates that the power management IC (PMIC) is used to power off the board. >>>>> So as the last step in the power off sequence set the SWOFF bit in the >>>>> main control register (MAIN_CR) register, to shutdown all power rails. >>>> >>>> The description for the property that Krzysztof mentioned is >>>> samsung,s2mps11-acokb-ground: >>>> description: | >>>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so >>>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the >>>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes >>>> low, the rising ACOKB will trigger power off. >>>> >>>> In other words, I am asking what (abnormal?) scenario there is that means >>>> you need the property, rather than what setting the property does. >>>> Or am I totally off, and this is the only way this PMIC works? >>> >>> Indicates that the power management IC (PMIC) turn-off condition is met >>> by setting the SWOFF bit in the main control register (MAIN_CR) register. >>> Turn-off condition can still be reached by the PONKEY input. >>> >>> ? >>> >>> I must admit I’m somewhat lost here :) >> >> Sorry about that. I'm trying to understand what is different about your >> hardware that it needs the property rather than what adding the property >> does. If you look at the samsung one, it describes both the >> configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to >> the ground") and how that is different from normal ("Usually the ACOKB is >> pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will >> trigger power off.") >> >> Looking at your datasheet, you don't have such a pin though - just the >> sw poweroff bit & the PONKEY stuff. My angle is just that I am trying >> to figure out why you need this property when it has not been needed >> before. Or why you would not always want to "shutdown all power rails >> when power-off sequence have finished". I'm sorry if these are silly >> questions. >> > > No silly questions, maybe they trick me to come up with the correct answer :D > > Basically without this, you won’t be able to power off the system > other than hitting the PONKEY. > So it’s a new feature that wasn’t supported before. > Maybe this feature should not be optional? You are still describing what driver should do with registers. What you are missing is describing real cause for this. It's exactly the same case as was with s2mps11. Best regards, Krzysztof
Hi Krzysztof, > On 1 Jun 2023, at 09.12, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 24/05/2023 12:30, Sean Nyekjaer wrote: >> >> >>> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: >>> >>> On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: >>>> Hi Conor, >>>> >>>>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: >>>>> >>>>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: >>>>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: >>>>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >>>>>>>> Document the new optional "fsl,pmic-poweroff" property. >>>>>>>> >>>>>>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >>>>>>>> --- >>>>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >>>>>>>> 1 file changed, 8 insertions(+) >>>>>>>> >>>>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>> index 9573e4af949e..5183a7c660d2 100644 >>>>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>> @@ -26,6 +26,14 @@ properties: >>>>>>>> >>>>>>>> interrupt-controller: true >>>>>>>> >>>>>>>> + st,pmic-poweroff: >>>>>>>> + $ref: /schemas/types.yaml#/definitions/flag >>>>>>>> + description: | >>>>>>>> + if present, configure the PMIC to shutdown all power rails when >>>>>>>> + power off sequence have finished. >>>>>>>> + Use this option if the SoC should be powered off by external power management >>>>>>>> + IC (PMIC). >>>>>>> >>>>>>> Just reading this description, this is sounding quite like a "software >>>>>>> behaviour" type of property, which are not permitted, rather than >>>>>>> describing some element of the hardware. Clearly you are trying to solve >>>>>>> an actual problem though, so try re-phrasing the description (and >>>>>>> property name) to focus on what exact hardware configuration it is that >>>>>>> you are trying to special-case. >>>>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in >>>>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be >>>>>>> good to look at. >>>>>> >>>>>> Better wording? >>>>>> Indicates that the power management IC (PMIC) is used to power off the board. >>>>>> So as the last step in the power off sequence set the SWOFF bit in the >>>>>> main control register (MAIN_CR) register, to shutdown all power rails. >>>>> >>>>> The description for the property that Krzysztof mentioned is >>>>> samsung,s2mps11-acokb-ground: >>>>> description: | >>>>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so >>>>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the >>>>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes >>>>> low, the rising ACOKB will trigger power off. >>>>> >>>>> In other words, I am asking what (abnormal?) scenario there is that means >>>>> you need the property, rather than what setting the property does. >>>>> Or am I totally off, and this is the only way this PMIC works? >>>> >>>> Indicates that the power management IC (PMIC) turn-off condition is met >>>> by setting the SWOFF bit in the main control register (MAIN_CR) register. >>>> Turn-off condition can still be reached by the PONKEY input. >>>> >>>> ? >>>> >>>> I must admit I’m somewhat lost here :) >>> >>> Sorry about that. I'm trying to understand what is different about your >>> hardware that it needs the property rather than what adding the property >>> does. If you look at the samsung one, it describes both the >>> configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to >>> the ground") and how that is different from normal ("Usually the ACOKB is >>> pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will >>> trigger power off.") >>> >>> Looking at your datasheet, you don't have such a pin though - just the >>> sw poweroff bit & the PONKEY stuff. My angle is just that I am trying >>> to figure out why you need this property when it has not been needed >>> before. Or why you would not always want to "shutdown all power rails >>> when power-off sequence have finished". I'm sorry if these are silly >>> questions. >>> >> >> No silly questions, maybe they trick me to come up with the correct answer :D >> >> Basically without this, you won’t be able to power off the system >> other than hitting the PONKEY. >> So it’s a new feature that wasn’t supported before. >> Maybe this feature should not be optional? > > You are still describing what driver should do with registers. What you > are missing is describing real cause for this. It's exactly the same > case as was with s2mps11. I didn’t mention anything with registers in the patch: if present, configure the PMIC to shutdown all power rails when power off sequence have finished. Use this option if the SoC should be powered off by external power management IC (PMIC). ^^ That’s is exactly what is happening if the option is enabled. Do you have a suggestion wording? What do you think about removing this option and make it default behaviour? /Sean > > Best regards, > Krzysztof >
On 01/06/2023 16:05, Sean Nyekjaer wrote: > Hi Krzysztof, > >> On 1 Jun 2023, at 09.12, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >> >> On 24/05/2023 12:30, Sean Nyekjaer wrote: >>> >>> >>>> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: >>>> >>>> On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: >>>>> Hi Conor, >>>>> >>>>>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: >>>>>> >>>>>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: >>>>>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: >>>>>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: >>>>>>>>> Document the new optional "fsl,pmic-poweroff" property. >>>>>>>>> >>>>>>>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> >>>>>>>>> --- >>>>>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ >>>>>>>>> 1 file changed, 8 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>>> index 9573e4af949e..5183a7c660d2 100644 >>>>>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml >>>>>>>>> @@ -26,6 +26,14 @@ properties: >>>>>>>>> >>>>>>>>> interrupt-controller: true >>>>>>>>> >>>>>>>>> + st,pmic-poweroff: >>>>>>>>> + $ref: /schemas/types.yaml#/definitions/flag >>>>>>>>> + description: | >>>>>>>>> + if present, configure the PMIC to shutdown all power rails when >>>>>>>>> + power off sequence have finished. >>>>>>>>> + Use this option if the SoC should be powered off by external power management >>>>>>>>> + IC (PMIC). >>>>>>>> >>>>>>>> Just reading this description, this is sounding quite like a "software >>>>>>>> behaviour" type of property, which are not permitted, rather than >>>>>>>> describing some element of the hardware. Clearly you are trying to solve >>>>>>>> an actual problem though, so try re-phrasing the description (and >>>>>>>> property name) to focus on what exact hardware configuration it is that >>>>>>>> you are trying to special-case. >>>>>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in >>>>>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be >>>>>>>> good to look at. >>>>>>> >>>>>>> Better wording? >>>>>>> Indicates that the power management IC (PMIC) is used to power off the board. >>>>>>> So as the last step in the power off sequence set the SWOFF bit in the >>>>>>> main control register (MAIN_CR) register, to shutdown all power rails. >>>>>> >>>>>> The description for the property that Krzysztof mentioned is >>>>>> samsung,s2mps11-acokb-ground: >>>>>> description: | >>>>>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so >>>>>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the >>>>>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes >>>>>> low, the rising ACOKB will trigger power off. >>>>>> >>>>>> In other words, I am asking what (abnormal?) scenario there is that means >>>>>> you need the property, rather than what setting the property does. >>>>>> Or am I totally off, and this is the only way this PMIC works? >>>>> >>>>> Indicates that the power management IC (PMIC) turn-off condition is met >>>>> by setting the SWOFF bit in the main control register (MAIN_CR) register. >>>>> Turn-off condition can still be reached by the PONKEY input. >>>>> >>>>> ? >>>>> >>>>> I must admit I’m somewhat lost here :) >>>> >>>> Sorry about that. I'm trying to understand what is different about your >>>> hardware that it needs the property rather than what adding the property >>>> does. If you look at the samsung one, it describes both the >>>> configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to >>>> the ground") and how that is different from normal ("Usually the ACOKB is >>>> pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will >>>> trigger power off.") >>>> >>>> Looking at your datasheet, you don't have such a pin though - just the >>>> sw poweroff bit & the PONKEY stuff. My angle is just that I am trying >>>> to figure out why you need this property when it has not been needed >>>> before. Or why you would not always want to "shutdown all power rails >>>> when power-off sequence have finished". I'm sorry if these are silly >>>> questions. >>>> >>> >>> No silly questions, maybe they trick me to come up with the correct answer :D >>> >>> Basically without this, you won’t be able to power off the system >>> other than hitting the PONKEY. >>> So it’s a new feature that wasn’t supported before. >>> Maybe this feature should not be optional? >> >> You are still describing what driver should do with registers. What you >> are missing is describing real cause for this. It's exactly the same >> case as was with s2mps11. > > I didn’t mention anything with registers in the patch: > > if present, configure the PMIC to shutdown all power rails when > power off sequence have finished. > Use this option if the SoC should be powered off by external power management > IC (PMIC). > > ^^ That’s is exactly what is happening if the option is enabled. > > Do you have a suggestion wording? > What do you think about removing this option and make it default behaviour? Again - you write what the driver should do ("configure the PMIC") when something in Linux happens ("power off sequence have finished"). Exactly the same case as s2mps11. Look how it was worded there. You need to find the real cause, why such actions are required on which board. Otherwise it does not warrant DT property and just perform it always. Best regards, Krzysztof
Not trimming any of this in case Lee wants to chime in and needs the context... On Thu, Jun 01, 2023 at 05:25:21PM +0200, Krzysztof Kozlowski wrote: > On 01/06/2023 16:05, Sean Nyekjaer wrote: > >> On 1 Jun 2023, at 09.12, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 24/05/2023 12:30, Sean Nyekjaer wrote: > >>>> On 24 May 2023, at 12.08, Conor Dooley <conor.dooley@microchip.com> wrote: > >>>> On Wed, May 24, 2023 at 10:16:13AM +0200, Sean Nyekjær wrote: > >>>>>> On 23 May 2023, at 19.29, Conor Dooley <conor@kernel.org> wrote: > >>>>>> On Tue, May 23, 2023 at 11:55:50AM +0200, Sean Nyekjær wrote: > >>>>>>>> On 16 May 2023, at 20.06, Conor Dooley <conor@kernel.org> wrote: > >>>>>>>> On Tue, May 16, 2023 at 03:22:24PM +0200, Sean Nyekjaer wrote: > >>>>>>>>> Document the new optional "fsl,pmic-poweroff" property. > >>>>>>>>> > >>>>>>>>> Signed-off-by: Sean Nyekjaer <sean@geanix.com> > >>>>>>>>> --- > >>>>>>>>> Documentation/devicetree/bindings/mfd/st,stpmic1.yaml | 8 ++++++++ > >>>>>>>>> 1 file changed, 8 insertions(+) > >>>>>>>>> > >>>>>>>>> diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>>>>>>> index 9573e4af949e..5183a7c660d2 100644 > >>>>>>>>> --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>>>>>>> +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml > >>>>>>>>> @@ -26,6 +26,14 @@ properties: > >>>>>>>>> > >>>>>>>>> interrupt-controller: true > >>>>>>>>> > >>>>>>>>> + st,pmic-poweroff: > >>>>>>>>> + $ref: /schemas/types.yaml#/definitions/flag > >>>>>>>>> + description: | > >>>>>>>>> + if present, configure the PMIC to shutdown all power rails when > >>>>>>>>> + power off sequence have finished. > >>>>>>>>> + Use this option if the SoC should be powered off by external power management > >>>>>>>>> + IC (PMIC). > >>>>>>>> > >>>>>>>> Just reading this description, this is sounding quite like a "software > >>>>>>>> behaviour" type of property, which are not permitted, rather than > >>>>>>>> describing some element of the hardware. Clearly you are trying to solve > >>>>>>>> an actual problem though, so try re-phrasing the description (and > >>>>>>>> property name) to focus on what exact hardware configuration it is that > >>>>>>>> you are trying to special-case. > >>>>>>>> Krzysztof suggested that the samsung,s2mps11-acokb-ground property in > >>>>>>>> samsung,s2mps11.yaml is addressing a similar problem, so that could be > >>>>>>>> good to look at. > >>>>>>> > >>>>>>> Better wording? > >>>>>>> Indicates that the power management IC (PMIC) is used to power off the board. > >>>>>>> So as the last step in the power off sequence set the SWOFF bit in the > >>>>>>> main control register (MAIN_CR) register, to shutdown all power rails. > >>>>>> > >>>>>> The description for the property that Krzysztof mentioned is > >>>>>> samsung,s2mps11-acokb-ground: > >>>>>> description: | > >>>>>> Indicates that ACOKB pin of S2MPS11 PMIC is connected to the ground so > >>>>>> the PMIC must manually set PWRHOLD bit in CTRL1 register to turn off the > >>>>>> power. Usually the ACOKB is pulled up to VBATT so when PWRHOLD pin goes > >>>>>> low, the rising ACOKB will trigger power off. > >>>>>> > >>>>>> In other words, I am asking what (abnormal?) scenario there is that means > >>>>>> you need the property, rather than what setting the property does. > >>>>>> Or am I totally off, and this is the only way this PMIC works? > >>>>> > >>>>> Indicates that the power management IC (PMIC) turn-off condition is met > >>>>> by setting the SWOFF bit in the main control register (MAIN_CR) register. > >>>>> Turn-off condition can still be reached by the PONKEY input. > >>>>> > >>>>> ? > >>>>> > >>>>> I must admit I’m somewhat lost here :) > >>>> > >>>> Sorry about that. I'm trying to understand what is different about your > >>>> hardware that it needs the property rather than what adding the property > >>>> does. If you look at the samsung one, it describes both the > >>>> configuration of the hardware ("ACOKB pin of S2MPS11 PMIC is connected to > >>>> the ground") and how that is different from normal ("Usually the ACOKB is > >>>> pulled up to VBATT so when PWRHOLD pin goes low, the rising ACOKB will > >>>> trigger power off.") > >>>> > >>>> Looking at your datasheet, you don't have such a pin though - just the > >>>> sw poweroff bit & the PONKEY stuff. My angle is just that I am trying > >>>> to figure out why you need this property when it has not been needed > >>>> before. Or why you would not always want to "shutdown all power rails > >>>> when power-off sequence have finished". I'm sorry if these are silly > >>>> questions. > >>>> > >>> > >>> No silly questions, maybe they trick me to come up with the correct answer :D > >>> > >>> Basically without this, you won’t be able to power off the system > >>> other than hitting the PONKEY. > >>> So it’s a new feature that wasn’t supported before. > >>> Maybe this feature should not be optional? [1] > >> > >> You are still describing what driver should do with registers. What you > >> are missing is describing real cause for this. It's exactly the same > >> case as was with s2mps11. > > > > I didn’t mention anything with registers in the patch: > > > > if present, configure the PMIC to shutdown all power rails when > > power off sequence have finished. > > Use this option if the SoC should be powered off by external power management > > IC (PMIC). > > > > ^^ That’s is exactly what is happening if the option is enabled. > > > > Do you have a suggestion wording? > > What do you think about removing this option and make it default behaviour? > > Again - you write what the driver should do ("configure the PMIC") when > something in Linux happens ("power off sequence have finished"). Exactly > the same case as s2mps11. Look how it was worded there. You need to find > the real cause, why such actions are required on which board. > > Otherwise it does not warrant DT property and just perform it always. Yeah, Sean asked that a few messages back up [1] & having looked at the datasheet I am kinda struggling to see why you would not just always want to do this. There does not seem to be an equivalent pin in this PMIC as your Samsung one, so this patch isn't working around some flaw in a board design, but rather seems to be looking to implement the actual functionality. I vote for do it always, obviously unless Less disagrees, and if that causes problems we can revisit the dt property with more understanding of whatever use case breaks if this is done unilaterally. Cheers, Conor.
diff --git a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml index 9573e4af949e..5183a7c660d2 100644 --- a/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +++ b/Documentation/devicetree/bindings/mfd/st,stpmic1.yaml @@ -26,6 +26,14 @@ properties: interrupt-controller: true + st,pmic-poweroff: + $ref: /schemas/types.yaml#/definitions/flag + description: | + if present, configure the PMIC to shutdown all power rails when + power off sequence have finished. + Use this option if the SoC should be powered off by external power management + IC (PMIC). + onkey: type: object