linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
@ 2024-01-22 12:49 Rafał Miłecki
  2024-01-22 13:19 ` Matthias Brugger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Rafał Miłecki @ 2024-01-22 12:49 UTC (permalink / raw)
  To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, Eddie Huang,
	Sean Wang, Ran Bi, linux-rtc, devicetree, linux-arm-kernel,
	linux-mediatek, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

This helps validating DTS files. Introduced changes:
1. Reworded title
2. Dropper redundant properties descriptions
3. Added required #include and adjusted "reg" in example

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
 .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
 2 files changed, 39 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt

diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
new file mode 100644
index 000000000000..75624ddf6d4d
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
@@ -0,0 +1,39 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/mediatek,mt2712-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek MT2712 on-SoC RTC
+
+allOf:
+  - $ref: rtc.yaml#
+
+maintainers:
+  - Ran Bi <ran.bi@mediatek.com>
+
+properties:
+  compatible:
+    const: mediatek,mt2712-rtc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    rtc@10011000 {
+        compatible = "mediatek,mt2712-rtc";
+        reg = <0x10011000 0x1000>;
+        interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_LOW>;
+    };
diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt b/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
deleted file mode 100644
index c33d87e5e753..000000000000
--- a/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Device-Tree bindings for MediaTek SoC based RTC
-
-Required properties:
-- compatible	    : Should be "mediatek,mt2712-rtc" : for MT2712 SoC
-- reg 		    : Specifies base physical address and size of the registers;
-- interrupts	    : Should contain the interrupt for RTC alarm;
-
-Example:
-
-rtc: rtc@10011000 {
-	compatible = "mediatek,mt2712-rtc";
-	reg = <0 0x10011000 0 0x1000>;
-	interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_LOW>;
-};
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-22 12:49 [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema Rafał Miłecki
@ 2024-01-22 13:19 ` Matthias Brugger
  2024-01-22 17:40   ` Rafał Miłecki
  2024-01-30 19:23 ` Rob Herring
  2024-02-29 21:21 ` Alexandre Belloni
  2 siblings, 1 reply; 8+ messages in thread
From: Matthias Brugger @ 2024-01-22 13:19 UTC (permalink / raw)
  To: Rafał Miłecki, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: AngeloGioacchino Del Regno, Eddie Huang, Sean Wang, Ran Bi,
	linux-rtc, devicetree, linux-arm-kernel, linux-mediatek,
	Rafał Miłecki



On 22/01/2024 13:49, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> This helps validating DTS files. Introduced changes:
> 1. Reworded title
> 2. Dropper redundant properties descriptions
> 3. Added required #include and adjusted "reg" in example
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>   .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>   .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>   2 files changed, 39 insertions(+), 14 deletions(-)
>   create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>   delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
> 
> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml

In this schema can easily fit "mediatek,mt7622-rtc", so how about renaming it 
and add reference for that RTC as well?

Regards,
Matthias


> new file mode 100644
> index 000000000000..75624ddf6d4d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
> @@ -0,0 +1,39 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/mediatek,mt2712-rtc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: MediaTek MT2712 on-SoC RTC
> +
> +allOf:
> +  - $ref: rtc.yaml#
> +
> +maintainers:
> +  - Ran Bi <ran.bi@mediatek.com>
> +
> +properties:
> +  compatible:
> +    const: mediatek,mt2712-rtc
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - reg
> +  - interrupts
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    rtc@10011000 {
> +        compatible = "mediatek,mt2712-rtc";
> +        reg = <0x10011000 0x1000>;
> +        interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_LOW>;
> +    };
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt b/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
> deleted file mode 100644
> index c33d87e5e753..000000000000
> --- a/Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -Device-Tree bindings for MediaTek SoC based RTC
> -
> -Required properties:
> -- compatible	    : Should be "mediatek,mt2712-rtc" : for MT2712 SoC
> -- reg 		    : Specifies base physical address and size of the registers;
> -- interrupts	    : Should contain the interrupt for RTC alarm;
> -
> -Example:
> -
> -rtc: rtc@10011000 {
> -	compatible = "mediatek,mt2712-rtc";
> -	reg = <0 0x10011000 0 0x1000>;
> -	interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_LOW>;
> -};

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-22 13:19 ` Matthias Brugger
@ 2024-01-22 17:40   ` Rafał Miłecki
  2024-01-23  8:57     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 8+ messages in thread
From: Rafał Miłecki @ 2024-01-22 17:40 UTC (permalink / raw)
  To: Matthias Brugger, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: AngeloGioacchino Del Regno, Eddie Huang, Sean Wang, Ran Bi,
	linux-rtc, devicetree, linux-arm-kernel, linux-mediatek,
	Rafał Miłecki

On 22.01.2024 14:19, Matthias Brugger wrote:
> On 22/01/2024 13:49, Rafał Miłecki wrote:
>> From: Rafał Miłecki <rafal@milecki.pl>
>>
>> This helps validating DTS files. Introduced changes:
>> 1. Reworded title
>> 2. Dropper redundant properties descriptions
>> 3. Added required #include and adjusted "reg" in example
>>
>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>> ---
>>   .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>>   .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>>   2 files changed, 39 insertions(+), 14 deletions(-)
>>   create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>   delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
>>
>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
> 
> In this schema can easily fit "mediatek,mt7622-rtc", so how about renaming it and add reference for that RTC as well?

I see your point but by looking at existing Linux drivers:
drivers/rtc/rtc-mt2712.c
drivers/rtc/rtc-mt7622.c
it seems like quite different hardware blocks.

Different registers, different programming, clk in MT7622.

Should they really share a YAML binding just because they use similar
properties?

-- 
Rafał Miłecki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-22 17:40   ` Rafał Miłecki
@ 2024-01-23  8:57     ` Krzysztof Kozlowski
  2024-01-23 10:40       ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-23  8:57 UTC (permalink / raw)
  To: Rafał Miłecki, Matthias Brugger, Alexandre Belloni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: AngeloGioacchino Del Regno, Eddie Huang, Sean Wang, Ran Bi,
	linux-rtc, devicetree, linux-arm-kernel, linux-mediatek,
	Rafał Miłecki

On 22/01/2024 18:40, Rafał Miłecki wrote:
> On 22.01.2024 14:19, Matthias Brugger wrote:
>> On 22/01/2024 13:49, Rafał Miłecki wrote:
>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>
>>> This helps validating DTS files. Introduced changes:
>>> 1. Reworded title
>>> 2. Dropper redundant properties descriptions
>>> 3. Added required #include and adjusted "reg" in example
>>>
>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>> ---
>>>   .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>>>   .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>>>   2 files changed, 39 insertions(+), 14 deletions(-)
>>>   create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>>   delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>
>> In this schema can easily fit "mediatek,mt7622-rtc", so how about renaming it and add reference for that RTC as well?
> 
> I see your point but by looking at existing Linux drivers:
> drivers/rtc/rtc-mt2712.c
> drivers/rtc/rtc-mt7622.c
> it seems like quite different hardware blocks.
> 
> Different registers, different programming, clk in MT7622.
> 
> Should they really share a YAML binding just because they use similar
> properties?

Hardware aspect matters more, including features not yet present in the
binding, like some power on/off control. Different clock inputs is also
an argument.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-23  8:57     ` Krzysztof Kozlowski
@ 2024-01-23 10:40       ` AngeloGioacchino Del Regno
  2024-01-24 16:10         ` Matthias Brugger
  0 siblings, 1 reply; 8+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-01-23 10:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rafał Miłecki, Matthias Brugger,
	Alexandre Belloni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley
  Cc: Eddie Huang, Sean Wang, Ran Bi, linux-rtc, devicetree,
	linux-arm-kernel, linux-mediatek, Rafał Miłecki

Il 23/01/24 09:57, Krzysztof Kozlowski ha scritto:
> On 22/01/2024 18:40, Rafał Miłecki wrote:
>> On 22.01.2024 14:19, Matthias Brugger wrote:
>>> On 22/01/2024 13:49, Rafał Miłecki wrote:
>>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>>
>>>> This helps validating DTS files. Introduced changes:
>>>> 1. Reworded title
>>>> 2. Dropper redundant properties descriptions
>>>> 3. Added required #include and adjusted "reg" in example
>>>>
>>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>>> ---
>>>>    .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>>>>    .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>>>>    2 files changed, 39 insertions(+), 14 deletions(-)
>>>>    create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>>>    delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>>
>>> In this schema can easily fit "mediatek,mt7622-rtc", so how about renaming it and add reference for that RTC as well?
>>
>> I see your point but by looking at existing Linux drivers:
>> drivers/rtc/rtc-mt2712.c
>> drivers/rtc/rtc-mt7622.c
>> it seems like quite different hardware blocks.
>>
>> Different registers, different programming, clk in MT7622.
>>
>> Should they really share a YAML binding just because they use similar
>> properties?
> 
> Hardware aspect matters more, including features not yet present in the
> binding, like some power on/off control. Different clock inputs is also
> an argument.
> 

I agree - those IPs are different, we should have two bindings for the two
(very) different IP versions.

Cheers,
Angelo


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-23 10:40       ` AngeloGioacchino Del Regno
@ 2024-01-24 16:10         ` Matthias Brugger
  0 siblings, 0 replies; 8+ messages in thread
From: Matthias Brugger @ 2024-01-24 16:10 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	Rafał Miłecki, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: Eddie Huang, Sean Wang, Ran Bi, linux-rtc, devicetree,
	linux-arm-kernel, linux-mediatek, Rafał Miłecki



On 23/01/2024 11:40, AngeloGioacchino Del Regno wrote:
> Il 23/01/24 09:57, Krzysztof Kozlowski ha scritto:
>> On 22/01/2024 18:40, Rafał Miłecki wrote:
>>> On 22.01.2024 14:19, Matthias Brugger wrote:
>>>> On 22/01/2024 13:49, Rafał Miłecki wrote:
>>>>> From: Rafał Miłecki <rafal@milecki.pl>
>>>>>
>>>>> This helps validating DTS files. Introduced changes:
>>>>> 1. Reworded title
>>>>> 2. Dropper redundant properties descriptions
>>>>> 3. Added required #include and adjusted "reg" in example
>>>>>
>>>>> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
>>>>> ---
>>>>>    .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>>>>>    .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>>>>>    2 files changed, 39 insertions(+), 14 deletions(-)
>>>>>    create mode 100644 
>>>>> Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>>>>    delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml 
>>>>> b/Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>>>>
>>>> In this schema can easily fit "mediatek,mt7622-rtc", so how about renaming 
>>>> it and add reference for that RTC as well?
>>>
>>> I see your point but by looking at existing Linux drivers:
>>> drivers/rtc/rtc-mt2712.c
>>> drivers/rtc/rtc-mt7622.c
>>> it seems like quite different hardware blocks.
>>>
>>> Different registers, different programming, clk in MT7622.
>>>
>>> Should they really share a YAML binding just because they use similar
>>> properties?
>>
>> Hardware aspect matters more, including features not yet present in the
>> binding, like some power on/off control. Different clock inputs is also
>> an argument.
>>
> 
> I agree - those IPs are different, we should have two bindings for the two
> (very) different IP versions.
> 

Makes sense. Then for this patch:
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-22 12:49 [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema Rafał Miłecki
  2024-01-22 13:19 ` Matthias Brugger
@ 2024-01-30 19:23 ` Rob Herring
  2024-02-29 21:21 ` Alexandre Belloni
  2 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2024-01-30 19:23 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-arm-kernel, Matthias Brugger, Rafał Miłecki,
	devicetree, linux-rtc, Ran Bi, Conor Dooley, Krzysztof Kozlowski,
	Rob Herring, linux-mediatek, AngeloGioacchino Del Regno,
	Eddie Huang, Sean Wang, Alexandre Belloni


On Mon, 22 Jan 2024 13:49:49 +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> This helps validating DTS files. Introduced changes:
> 1. Reworded title
> 2. Dropper redundant properties descriptions
> 3. Added required #include and adjusted "reg" in example
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/rtc/mediatek,mt2712-rtc.yaml     | 39 +++++++++++++++++++
>  .../devicetree/bindings/rtc/rtc-mt2712.txt    | 14 -------
>  2 files changed, 39 insertions(+), 14 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/rtc/mediatek,mt2712-rtc.yaml
>  delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-mt2712.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema
  2024-01-22 12:49 [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema Rafał Miłecki
  2024-01-22 13:19 ` Matthias Brugger
  2024-01-30 19:23 ` Rob Herring
@ 2024-02-29 21:21 ` Alexandre Belloni
  2 siblings, 0 replies; 8+ messages in thread
From: Alexandre Belloni @ 2024-02-29 21:21 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Rafał Miłecki
  Cc: Matthias Brugger, AngeloGioacchino Del Regno, Eddie Huang,
	Sean Wang, Ran Bi, linux-rtc, devicetree, linux-arm-kernel,
	linux-mediatek, Rafał Miłecki

On Mon, 22 Jan 2024 13:49:49 +0100, Rafał Miłecki wrote:
> This helps validating DTS files. Introduced changes:
> 1. Reworded title
> 2. Dropper redundant properties descriptions
> 3. Added required #include and adjusted "reg" in example
> 
> 

Applied, thanks!

[1/1] dt-bindings: rtc: convert MT2717 RTC to the json-schema
      https://git.kernel.org/abelloni/c/e8c0498505b0

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-29 21:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 12:49 [PATCH] dt-bindings: rtc: convert MT2717 RTC to the json-schema Rafał Miłecki
2024-01-22 13:19 ` Matthias Brugger
2024-01-22 17:40   ` Rafał Miłecki
2024-01-23  8:57     ` Krzysztof Kozlowski
2024-01-23 10:40       ` AngeloGioacchino Del Regno
2024-01-24 16:10         ` Matthias Brugger
2024-01-30 19:23 ` Rob Herring
2024-02-29 21:21 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).