diff mbox series

[v2,16/22] dt-bindings: rtc: qcom-pm8xxx: add nvmem-cell offset

Message ID 20230202155448.6715-17-johan+linaro@kernel.org
State Accepted
Headers show
Series rtc: pm8xxx: add support for setting time using nvmem | expand

Commit Message

Johan Hovold Feb. 2, 2023, 3:54 p.m. UTC
On many Qualcomm platforms the PMIC RTC control and time registers are
read-only so that the RTC time can not be updated. Instead an offset
needs be stored in some machine-specific non-volatile memory, which a
driver can take into account.

Add an 'offset' nvmem cell which can be used to store a 32-bit offset
from the Unix epoch so that the RTC time can be updated on such
platforms.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

David Collins Feb. 7, 2023, 3:16 a.m. UTC | #1
On 2/2/23 07:54, Johan Hovold wrote:
> On many Qualcomm platforms the PMIC RTC control and time registers are
> read-only so that the RTC time can not be updated. Instead an offset

s/can not/cannot/

> needs be stored in some machine-specific non-volatile memory, which a
> driver can take into account.
> 
> Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> from the Unix epoch so that the RTC time can be updated on such
> platforms.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
>  1 file changed, 12 insertions(+)

Assuming that the minor commit text comment above is addressed:

Reviewed-by: David Collins <quic_collinsd@quicinc.com>

Take care,
David
Johan Hovold Feb. 7, 2023, 3:24 p.m. UTC | #2
On Mon, Feb 06, 2023 at 07:16:37PM -0800, David Collins wrote:
> On 2/2/23 07:54, Johan Hovold wrote:
> > On many Qualcomm platforms the PMIC RTC control and time registers are
> > read-only so that the RTC time can not be updated. Instead an offset
> 
> s/can not/cannot/

As far as I can tell, 'can not' is still correct even if it's less
commonly used this way compared to 'cannot'.

> > needs be stored in some machine-specific non-volatile memory, which a
> > driver can take into account.
> > 
> > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > from the Unix epoch so that the RTC time can be updated on such
> > platforms.
> > 
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> > ---
> >  .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> 
> Assuming that the minor commit text comment above is addressed:

I'm definitely not resending because of this, but I'll keep it in mind
for future patches. Thanks.

> Reviewed-by: David Collins <quic_collinsd@quicinc.com>

Johan
Alexandre Belloni Feb. 10, 2023, 10:48 p.m. UTC | #3
On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> On many Qualcomm platforms the PMIC RTC control and time registers are
> read-only so that the RTC time can not be updated. Instead an offset
> needs be stored in some machine-specific non-volatile memory, which a
> driver can take into account.
> 
> Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> from the Unix epoch so that the RTC time can be updated on such
> platforms.
> 
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> index 21c8ea08ff0a..b95a69cc9ae0 100644
> --- a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> +++ b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> @@ -40,6 +40,16 @@ properties:
>      description:
>        Indicates that the setting of RTC time is allowed by the host CPU.
>  
> +  nvmem-cells:
> +    items:
> +      - description:
> +          four-byte nvmem cell holding a little-endian offset from the Unix
> +          epoch representing the time when the RTC timer was last reset
> +
> +  nvmem-cell-names:
> +    items:
> +      - const: offset
> +
>    wakeup-source: true

The patch doesn't apply because this part of the context is not
upstream. Can you rebase?

>  
>  required:
> @@ -69,6 +79,8 @@ examples:
>            compatible = "qcom,pm8921-rtc";
>            reg = <0x11d>;
>            interrupts = <0x27 0>;
> +          nvmem-cells = <&rtc_offset>;
> +          nvmem-cell-names = "offset";
>          };
>        };
>      };
> -- 
> 2.39.1
>
Johan Hovold Feb. 11, 2023, 8:22 a.m. UTC | #4
On Fri, Feb 10, 2023 at 11:48:08PM +0100, Alexandre Belloni wrote:
> On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> > On many Qualcomm platforms the PMIC RTC control and time registers are
> > read-only so that the RTC time can not be updated. Instead an offset
> > needs be stored in some machine-specific non-volatile memory, which a
> > driver can take into account.
> > 
> > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > from the Unix epoch so that the RTC time can be updated on such
> > platforms.
> > 
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> > ---
> >  .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > index 21c8ea08ff0a..b95a69cc9ae0 100644
> > --- a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > +++ b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > @@ -40,6 +40,16 @@ properties:
> >      description:
> >        Indicates that the setting of RTC time is allowed by the host CPU.
> >  
> > +  nvmem-cells:
> > +    items:
> > +      - description:
> > +          four-byte nvmem cell holding a little-endian offset from the Unix
> > +          epoch representing the time when the RTC timer was last reset
> > +
> > +  nvmem-cell-names:
> > +    items:
> > +      - const: offset
> > +
> >    wakeup-source: true
> 
> The patch doesn't apply because this part of the context is not
> upstream. Can you rebase?

Ah, sorry about that. That's because of commit 51b3802e7960
("dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property") which
is now in Linus's tree (and your rtc-fixes branch).

Do you still want me to rebase or do you prefer to handle the conflict
some other way?

Johan
Alexandre Belloni Feb. 11, 2023, 4:44 p.m. UTC | #5
On 11/02/2023 09:22:54+0100, Johan Hovold wrote:
> On Fri, Feb 10, 2023 at 11:48:08PM +0100, Alexandre Belloni wrote:
> > On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> > > On many Qualcomm platforms the PMIC RTC control and time registers are
> > > read-only so that the RTC time can not be updated. Instead an offset
> > > needs be stored in some machine-specific non-volatile memory, which a
> > > driver can take into account.
> > > 
> > > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > > from the Unix epoch so that the RTC time can be updated on such
> > > platforms.
> > > 
> > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> > > ---
> > >  .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml     | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > > index 21c8ea08ff0a..b95a69cc9ae0 100644
> > > --- a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > > +++ b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
> > > @@ -40,6 +40,16 @@ properties:
> > >      description:
> > >        Indicates that the setting of RTC time is allowed by the host CPU.
> > >  
> > > +  nvmem-cells:
> > > +    items:
> > > +      - description:
> > > +          four-byte nvmem cell holding a little-endian offset from the Unix
> > > +          epoch representing the time when the RTC timer was last reset
> > > +
> > > +  nvmem-cell-names:
> > > +    items:
> > > +      - const: offset
> > > +
> > >    wakeup-source: true
> > 
> > The patch doesn't apply because this part of the context is not
> > upstream. Can you rebase?
> 
> Ah, sorry about that. That's because of commit 51b3802e7960
> ("dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property") which
> is now in Linus's tree (and your rtc-fixes branch).
> 
> Do you still want me to rebase or do you prefer to handle the conflict
> some other way?

Ah yes, my bad, I'll merge rtc-fixes in rtc-next before applying
Johan Hovold Feb. 15, 2023, 4:51 p.m. UTC | #6
On Sat, Feb 11, 2023 at 05:44:39PM +0100, Alexandre Belloni wrote:
> On 11/02/2023 09:22:54+0100, Johan Hovold wrote:
> > On Fri, Feb 10, 2023 at 11:48:08PM +0100, Alexandre Belloni wrote:
> > > On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> > > > On many Qualcomm platforms the PMIC RTC control and time registers are
> > > > read-only so that the RTC time can not be updated. Instead an offset
> > > > needs be stored in some machine-specific non-volatile memory, which a
> > > > driver can take into account.
> > > > 
> > > > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > > > from the Unix epoch so that the RTC time can be updated on such
> > > > platforms.
> > > > 
> > > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

> > > The patch doesn't apply because this part of the context is not
> > > upstream. Can you rebase?
> > 
> > Ah, sorry about that. That's because of commit 51b3802e7960
> > ("dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property") which
> > is now in Linus's tree (and your rtc-fixes branch).
> > 
> > Do you still want me to rebase or do you prefer to handle the conflict
> > some other way?
> 
> Ah yes, my bad, I'll merge rtc-fixes in rtc-next before applying

Sorry about reminding so soon, but with the merge window approaching
fast, will you be able to get this merged for 6.3?

Johan
Johan Hovold Feb. 24, 2023, 8:21 a.m. UTC | #7
Hi Alexandre,

On Wed, Feb 15, 2023 at 05:51:20PM +0100, Johan Hovold wrote:
> On Sat, Feb 11, 2023 at 05:44:39PM +0100, Alexandre Belloni wrote:
> > On 11/02/2023 09:22:54+0100, Johan Hovold wrote:
> > > On Fri, Feb 10, 2023 at 11:48:08PM +0100, Alexandre Belloni wrote:
> > > > On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> > > > > On many Qualcomm platforms the PMIC RTC control and time registers are
> > > > > read-only so that the RTC time can not be updated. Instead an offset
> > > > > needs be stored in some machine-specific non-volatile memory, which a
> > > > > driver can take into account.
> > > > > 
> > > > > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > > > > from the Unix epoch so that the RTC time can be updated on such
> > > > > platforms.
> > > > > 
> > > > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> 
> > > > The patch doesn't apply because this part of the context is not
> > > > upstream. Can you rebase?
> > > 
> > > Ah, sorry about that. That's because of commit 51b3802e7960
> > > ("dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property") which
> > > is now in Linus's tree (and your rtc-fixes branch).
> > > 
> > > Do you still want me to rebase or do you prefer to handle the conflict
> > > some other way?
> > 
> > Ah yes, my bad, I'll merge rtc-fixes in rtc-next before applying
> 
> Sorry about reminding so soon, but with the merge window approaching
> fast, will you be able to get this merged for 6.3?

Looks like these last two patches adding support for the nvmem offset
has not been applied yet. Still hoping you can get them merged for 6.3
even if this one does not apply cleanly unless you first merge your
rtc-fixes branch.

Johan
Alexandre Belloni Feb. 24, 2023, 9:18 a.m. UTC | #8
On 24/02/2023 09:21:07+0100, Johan Hovold wrote:
> Hi Alexandre,
> 
> On Wed, Feb 15, 2023 at 05:51:20PM +0100, Johan Hovold wrote:
> > On Sat, Feb 11, 2023 at 05:44:39PM +0100, Alexandre Belloni wrote:
> > > On 11/02/2023 09:22:54+0100, Johan Hovold wrote:
> > > > On Fri, Feb 10, 2023 at 11:48:08PM +0100, Alexandre Belloni wrote:
> > > > > On 02/02/2023 16:54:42+0100, Johan Hovold wrote:
> > > > > > On many Qualcomm platforms the PMIC RTC control and time registers are
> > > > > > read-only so that the RTC time can not be updated. Instead an offset
> > > > > > needs be stored in some machine-specific non-volatile memory, which a
> > > > > > driver can take into account.
> > > > > > 
> > > > > > Add an 'offset' nvmem cell which can be used to store a 32-bit offset
> > > > > > from the Unix epoch so that the RTC time can be updated on such
> > > > > > platforms.
> > > > > > 
> > > > > > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> > 
> > > > > The patch doesn't apply because this part of the context is not
> > > > > upstream. Can you rebase?
> > > > 
> > > > Ah, sorry about that. That's because of commit 51b3802e7960
> > > > ("dt-bindings: rtc: qcom-pm8xxx: allow 'wakeup-source' property") which
> > > > is now in Linus's tree (and your rtc-fixes branch).
> > > > 
> > > > Do you still want me to rebase or do you prefer to handle the conflict
> > > > some other way?
> > > 
> > > Ah yes, my bad, I'll merge rtc-fixes in rtc-next before applying
> > 
> > Sorry about reminding so soon, but with the merge window approaching
> > fast, will you be able to get this merged for 6.3?
> 
> Looks like these last two patches adding support for the nvmem offset
> has not been applied yet. Still hoping you can get them merged for 6.3
> even if this one does not apply cleanly unless you first merge your
> rtc-fixes branch.

This is still my plan, I'm travelling right now but they will be sent for
6.3
Johan Hovold Feb. 24, 2023, 9:24 a.m. UTC | #9
On Fri, Feb 24, 2023 at 10:18:54AM +0100, Alexandre Belloni wrote:
> On 24/02/2023 09:21:07+0100, Johan Hovold wrote:

> > Looks like these last two patches adding support for the nvmem offset
> > has not been applied yet. Still hoping you can get them merged for 6.3
> > even if this one does not apply cleanly unless you first merge your
> > rtc-fixes branch.
> 
> This is still my plan, I'm travelling right now but they will be sent for
> 6.3

Perfect, thanks!

Johan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
index 21c8ea08ff0a..b95a69cc9ae0 100644
--- a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
@@ -40,6 +40,16 @@  properties:
     description:
       Indicates that the setting of RTC time is allowed by the host CPU.
 
+  nvmem-cells:
+    items:
+      - description:
+          four-byte nvmem cell holding a little-endian offset from the Unix
+          epoch representing the time when the RTC timer was last reset
+
+  nvmem-cell-names:
+    items:
+      - const: offset
+
   wakeup-source: true
 
 required:
@@ -69,6 +79,8 @@  examples:
           compatible = "qcom,pm8921-rtc";
           reg = <0x11d>;
           interrupts = <0x27 0>;
+          nvmem-cells = <&rtc_offset>;
+          nvmem-cell-names = "offset";
         };
       };
     };