diff mbox series

[3/4] dt-bindings: rtc: digicolor-rtc: convert to dtschema

Message ID 20240323-rtc-yaml-v1-3-0c5d12b1b89d@gmail.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: rtc: convert multiple devices to dtschema | expand

Commit Message

Javier Carrasco March 23, 2024, 10:46 p.m. UTC
Convert existing binding to dtschema to support validation.

The binding has been renamed to match its compatible. Apart from that,
it is a direct conversion with no additions.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
 .../devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml  | 37 ++++++++++++++++++++++
 .../devicetree/bindings/rtc/digicolor-rtc.txt      | 17 ----------
 2 files changed, 37 insertions(+), 17 deletions(-)

Comments

Rob Herring (Arm) March 25, 2024, 4:01 p.m. UTC | #1
On Sat, Mar 23, 2024 at 11:46:15PM +0100, Javier Carrasco wrote:
> Convert existing binding to dtschema to support validation.
> 
> The binding has been renamed to match its compatible. Apart from that,
> it is a direct conversion with no additions.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
>  .../devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml  | 37 ++++++++++++++++++++++
>  .../devicetree/bindings/rtc/digicolor-rtc.txt      | 17 ----------
>  2 files changed, 37 insertions(+), 17 deletions(-)

This could probably just go into trivial-rtc.yaml.

Rob
Javier Carrasco March 25, 2024, 7:46 p.m. UTC | #2
On 3/25/24 17:01, Rob Herring wrote:
> On Sat, Mar 23, 2024 at 11:46:15PM +0100, Javier Carrasco wrote:
>> Convert existing binding to dtschema to support validation.
>>
>> The binding has been renamed to match its compatible. Apart from that,
>> it is a direct conversion with no additions.
>>
>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>> ---
>>  .../devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml  | 37 ++++++++++++++++++++++
>>  .../devicetree/bindings/rtc/digicolor-rtc.txt      | 17 ----------
>>  2 files changed, 37 insertions(+), 17 deletions(-)
> 
> This could probably just go into trivial-rtc.yaml.
> 
> Rob

Does it make no difference if the reg property is a single address or
address + size? trivial-rtc.yaml does no specify that ('an address' is
mentioned), and I don't know if it is obvious for someone who wants to
use this device.

Best regards,
Javier Carrasco
Krzysztof Kozlowski March 25, 2024, 8:03 p.m. UTC | #3
On 25/03/2024 20:46, Javier Carrasco wrote:
> On 3/25/24 17:01, Rob Herring wrote:
>> On Sat, Mar 23, 2024 at 11:46:15PM +0100, Javier Carrasco wrote:
>>> Convert existing binding to dtschema to support validation.
>>>
>>> The binding has been renamed to match its compatible. Apart from that,
>>> it is a direct conversion with no additions.
>>>
>>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>>> ---
>>>  .../devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml  | 37 ++++++++++++++++++++++
>>>  .../devicetree/bindings/rtc/digicolor-rtc.txt      | 17 ----------
>>>  2 files changed, 37 insertions(+), 17 deletions(-)
>>
>> This could probably just go into trivial-rtc.yaml.
>>
>> Rob
> 
> Does it make no difference if the reg property is a single address or
> address + size? trivial-rtc.yaml does no specify that ('an address' is
> mentioned), and I don't know if it is obvious for someone who wants to
> use this device.

First, you can answer to this by yourself: where do you have the "size"
documented? You will see that nowhere, because your description is
actually redundant and should be dropped. So if "nowhere", then your
binding is the same as trivial-rtc.

The presence of size is defined by the bus, not by this binding.
Therefore you do not have to tell anyone that it is address+size,
because it is obvious from the bus. And from device datasheet (bindings
are not replacement of datasheets).

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml b/Documentation/devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml
new file mode 100644
index 000000000000..bdd6f0718b0a
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/cnxt,cx92755-rtc.yaml
@@ -0,0 +1,37 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/cnxt,cx92755-rtc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Conexant Digicolor Real Time Clock Controller
+
+maintainers:
+  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
+
+properties:
+  compatible:
+    const: cnxt,cx92755-rtc
+
+  reg:
+    description:
+      Base address and length of the register region.
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    rtc@f0000c30 {
+        compatible = "cnxt,cx92755-rtc";
+        reg = <0xf0000c30 0x18>;
+        interrupts = <25>;
+    };
diff --git a/Documentation/devicetree/bindings/rtc/digicolor-rtc.txt b/Documentation/devicetree/bindings/rtc/digicolor-rtc.txt
deleted file mode 100644
index d464986012cd..000000000000
--- a/Documentation/devicetree/bindings/rtc/digicolor-rtc.txt
+++ /dev/null
@@ -1,17 +0,0 @@ 
-Conexant Digicolor Real Time Clock controller
-
-This binding currently supports the CX92755 SoC.
-
-Required properties:
-- compatible: should be "cnxt,cx92755-rtc"
-- reg: physical base address of the controller and length of memory mapped
-  region.
-- interrupts: rtc alarm interrupt
-
-Example:
-
-	rtc@f0000c30 {
-		compatible = "cnxt,cx92755-rtc";
-		reg = <0xf0000c30 0x18>;
-		interrupts = <25>;
-	};