diff mbox series

[v2,2/3] dt-bindings: rtc: Add Mstar SSD202D RTC

Message ID 20230913151606.69494-3-romain.perier@gmail.com (mailing list archive)
State New, archived
Headers show
Series Add RTC for MStar SSD20xD SoCs | expand

Commit Message

Romain Perier Sept. 13, 2023, 3:16 p.m. UTC
Add YAML bindings for Mstar SSD202D RTC.

Signed-off-by: Romain Perier <romain.perier@gmail.com>
---
 .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml

Comments

Conor Dooley Sept. 13, 2023, 6:30 p.m. UTC | #1
On Wed, Sep 13, 2023 at 05:16:05PM +0200, Romain Perier wrote:
> Add YAML bindings for Mstar SSD202D RTC.
> 
> Signed-off-by: Romain Perier <romain.perier@gmail.com>
> ---
>  .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> new file mode 100644
> index 000000000000..4c1f22ef5a2c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mstar SSD202D Real Time Clock
> +
> +maintainers:
> +  - Daniel Palmer <daniel@0x0f.com>
> +  - Romain Perier <romain.perier@gmail.com>
> +
> +allOf:
> +  - $ref: rtc.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - mstar,ssd202d-rtc
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg

So, this seems fine to me in isolation, but isn't this now the sort of
thing that can be documented in trivial-rtc.yaml?
Its only got compatible & reg, which seems to fit the bill for that.

Apologies if I am missing something,
Conor.

> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    rtc@6800 {
> +        compatible = "mstar,ssd202d-rtc";
> +        reg = <0x6800 0x200>;
> +    };
> +...
> -- 
> 2.39.2
>
Romain Perier Sept. 14, 2023, 7:08 a.m. UTC | #2
Le mer. 13 sept. 2023 à 20:30, Conor Dooley <conor@kernel.org> a écrit :
>
> On Wed, Sep 13, 2023 at 05:16:05PM +0200, Romain Perier wrote:
> > Add YAML bindings for Mstar SSD202D RTC.
> >
> > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > ---
> >  .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
> >  1 file changed, 35 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > new file mode 100644
> > index 000000000000..4c1f22ef5a2c
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > @@ -0,0 +1,35 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Mstar SSD202D Real Time Clock
> > +
> > +maintainers:
> > +  - Daniel Palmer <daniel@0x0f.com>
> > +  - Romain Perier <romain.perier@gmail.com>
> > +
> > +allOf:
> > +  - $ref: rtc.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - mstar,ssd202d-rtc
> > +  reg:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
>

Hi,

> So, this seems fine to me in isolation, but isn't this now the sort of
> thing that can be documented in trivial-rtc.yaml?
> Its only got compatible & reg, which seems to fit the bill for that.
>

With the current state, it might make sense. However, currently, the
RTC hw block is mostly
reverse-engineered, the driver is not complete yet, things like
external irq or wakeup irq might arrive later (once we know how it is
wired up and used).
So the content of the dt-bindings might change and differ from a
simple "compatible & reg" requirement.

What do you think ?

> Apologies if I am missing something,

No problem, I am open to suggestions :)

Thanks,
Regards,
Romain



> Conor.
>
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    rtc@6800 {
> > +        compatible = "mstar,ssd202d-rtc";
> > +        reg = <0x6800 0x200>;
> > +    };
> > +...
> > --
> > 2.39.2
> >
Conor Dooley Sept. 14, 2023, 8:28 a.m. UTC | #3
On Thu, Sep 14, 2023 at 09:08:52AM +0200, Romain Perier wrote:
> Le mer. 13 sept. 2023 à 20:30, Conor Dooley <conor@kernel.org> a écrit :
> >
> > On Wed, Sep 13, 2023 at 05:16:05PM +0200, Romain Perier wrote:
> > > Add YAML bindings for Mstar SSD202D RTC.
> > >
> > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > ---
> > >  .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
> > >  1 file changed, 35 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > new file mode 100644
> > > index 000000000000..4c1f22ef5a2c
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > @@ -0,0 +1,35 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: Mstar SSD202D Real Time Clock
> > > +
> > > +maintainers:
> > > +  - Daniel Palmer <daniel@0x0f.com>
> > > +  - Romain Perier <romain.perier@gmail.com>
> > > +
> > > +allOf:
> > > +  - $ref: rtc.yaml#
> > > +
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - mstar,ssd202d-rtc
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> >
> 
> Hi,
> 
> > So, this seems fine to me in isolation, but isn't this now the sort of
> > thing that can be documented in trivial-rtc.yaml?
> > Its only got compatible & reg, which seems to fit the bill for that.
> >
> 
> With the current state, it might make sense. However, currently, the
> RTC hw block is mostly
> reverse-engineered, the driver is not complete yet, things like
> external irq or wakeup irq might arrive later (once we know how it is
> wired up and used).
> So the content of the dt-bindings might change and differ from a
> simple "compatible & reg" requirement.

It's always possible to move from that to a fully fledged binding at a
later date. re: interrupts, trivial-rtc permits a single interrupt, so
it'd still be suitable if the device only has one.

Thanks,
Conor.
Romain Perier Sept. 14, 2023, 11:31 a.m. UTC | #4
Le jeu. 14 sept. 2023 à 10:28, Conor Dooley
<conor.dooley@microchip.com> a écrit :
>
> On Thu, Sep 14, 2023 at 09:08:52AM +0200, Romain Perier wrote:
> > Le mer. 13 sept. 2023 à 20:30, Conor Dooley <conor@kernel.org> a écrit :
> > >
> > > On Wed, Sep 13, 2023 at 05:16:05PM +0200, Romain Perier wrote:
> > > > Add YAML bindings for Mstar SSD202D RTC.
> > > >
> > > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > > ---
> > > >  .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
> > > >  1 file changed, 35 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > > new file mode 100644
> > > > index 000000000000..4c1f22ef5a2c
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > > @@ -0,0 +1,35 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Mstar SSD202D Real Time Clock
> > > > +
> > > > +maintainers:
> > > > +  - Daniel Palmer <daniel@0x0f.com>
> > > > +  - Romain Perier <romain.perier@gmail.com>
> > > > +
> > > > +allOf:
> > > > +  - $ref: rtc.yaml#
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    enum:
> > > > +      - mstar,ssd202d-rtc
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > >
> >
> > Hi,
> >
> > > So, this seems fine to me in isolation, but isn't this now the sort of
> > > thing that can be documented in trivial-rtc.yaml?
> > > Its only got compatible & reg, which seems to fit the bill for that.
> > >
> >
> > With the current state, it might make sense. However, currently, the
> > RTC hw block is mostly
> > reverse-engineered, the driver is not complete yet, things like
> > external irq or wakeup irq might arrive later (once we know how it is
> > wired up and used).
> > So the content of the dt-bindings might change and differ from a
> > simple "compatible & reg" requirement.
>
> It's always possible to move from that to a fully fledged binding at a
> later date. re: interrupts, trivial-rtc permits a single interrupt, so
> it'd still be suitable if the device only has one.

I agree, good point. Yes, we can make the change later, sure. I will
fix it in the next patch series.

Thanks,
Romain
Romain Perier Nov. 8, 2023, 1:27 p.m. UTC | #5
Hi,

Alexandre seems to be okay with the current (merged) dt-binding, what
do I do ? I can send a v3 for trivial-rtc.yaml that's not a problem
for me but both of you seem to
be disagree :)

Regards,
Romain


Le jeu. 14 sept. 2023 à 10:28, Conor Dooley
<conor.dooley@microchip.com> a écrit :
>
> On Thu, Sep 14, 2023 at 09:08:52AM +0200, Romain Perier wrote:
> > Le mer. 13 sept. 2023 à 20:30, Conor Dooley <conor@kernel.org> a écrit :
> > >
> > > On Wed, Sep 13, 2023 at 05:16:05PM +0200, Romain Perier wrote:
> > > > Add YAML bindings for Mstar SSD202D RTC.
> > > >
> > > > Signed-off-by: Romain Perier <romain.perier@gmail.com>
> > > > ---
> > > >  .../bindings/rtc/mstar,ssd202d-rtc.yaml       | 35 +++++++++++++++++++
> > > >  1 file changed, 35 insertions(+)
> > > >  create mode 100644 Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > > new file mode 100644
> > > > index 000000000000..4c1f22ef5a2c
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
> > > > @@ -0,0 +1,35 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: Mstar SSD202D Real Time Clock
> > > > +
> > > > +maintainers:
> > > > +  - Daniel Palmer <daniel@0x0f.com>
> > > > +  - Romain Perier <romain.perier@gmail.com>
> > > > +
> > > > +allOf:
> > > > +  - $ref: rtc.yaml#
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    enum:
> > > > +      - mstar,ssd202d-rtc
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > >
> >
> > Hi,
> >
> > > So, this seems fine to me in isolation, but isn't this now the sort of
> > > thing that can be documented in trivial-rtc.yaml?
> > > Its only got compatible & reg, which seems to fit the bill for that.
> > >
> >
> > With the current state, it might make sense. However, currently, the
> > RTC hw block is mostly
> > reverse-engineered, the driver is not complete yet, things like
> > external irq or wakeup irq might arrive later (once we know how it is
> > wired up and used).
> > So the content of the dt-bindings might change and differ from a
> > simple "compatible & reg" requirement.
>
> It's always possible to move from that to a fully fledged binding at a
> later date. re: interrupts, trivial-rtc permits a single interrupt, so
> it'd still be suitable if the device only has one.
>
> Thanks,
> Conor.
Conor Dooley Nov. 8, 2023, 3:44 p.m. UTC | #6
On Wed, Nov 08, 2023 at 02:27:37PM +0100, Romain Perier wrote:
> Hi,
> 
> Alexandre seems to be okay with the current (merged) dt-binding, what
> do I do ? I can send a v3 for trivial-rtc.yaml that's not a problem
> for me but both of you seem to disagree :)

Meh, I wouldn't waste your time moving it.
Romain Perier Nov. 8, 2023, 4:55 p.m. UTC | #7
Le mer. 8 nov. 2023 à 16:44, Conor Dooley <conor@kernel.org> a écrit :
>
> On Wed, Nov 08, 2023 at 02:27:37PM +0100, Romain Perier wrote:
> > Hi,
> >
> > Alexandre seems to be okay with the current (merged) dt-binding, what
> > do I do ? I can send a v3 for trivial-rtc.yaml that's not a problem
> > for me but both of you seem to disagree :)
>
> Meh, I wouldn't waste your time moving it.

Ok, so I will just send a v3 with an update of the MAINTAINERS file
for the driver (I have completely forgot, my bad)

Regards,
Romain
Alexandre Belloni Nov. 8, 2023, 5:17 p.m. UTC | #8
On 08/11/2023 17:55:06+0100, Romain Perier wrote:
> Le mer. 8 nov. 2023 à 16:44, Conor Dooley <conor@kernel.org> a écrit :
> >
> > On Wed, Nov 08, 2023 at 02:27:37PM +0100, Romain Perier wrote:
> > > Hi,
> > >
> > > Alexandre seems to be okay with the current (merged) dt-binding, what
> > > do I do ? I can send a v3 for trivial-rtc.yaml that's not a problem
> > > for me but both of you seem to disagree :)
> >
> > Meh, I wouldn't waste your time moving it.
> 
> Ok, so I will just send a v3 with an update of the MAINTAINERS file
> for the driver (I have completely forgot, my bad)
> 

v2 is already upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/rtc/rtc-ssd202d.c?id=ebf6255868e6141c737cacb8d62b0b347f344877

> Regards,
> Romain
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
new file mode 100644
index 000000000000..4c1f22ef5a2c
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/mstar,ssd202d-rtc.yaml
@@ -0,0 +1,35 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/mstar,ssd202d-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mstar SSD202D Real Time Clock
+
+maintainers:
+  - Daniel Palmer <daniel@0x0f.com>
+  - Romain Perier <romain.perier@gmail.com>
+
+allOf:
+  - $ref: rtc.yaml#
+
+properties:
+  compatible:
+    enum:
+      - mstar,ssd202d-rtc
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    rtc@6800 {
+        compatible = "mstar,ssd202d-rtc";
+        reg = <0x6800 0x200>;
+    };
+...