[v1,1/3] dt-bindings: rtc: convert haoyu,hym8563.txt to yaml

Message ID f7127f87-05fd-5e20-eb2d-a3fd04674229@gmail.com
State New
Headers
Series [v1,1/3] dt-bindings: rtc: convert haoyu,hym8563.txt to yaml |

Commit Message

Johan Jonker Oct. 26, 2022, 10:58 p.m. UTC
  Convert haoyu,hym8563.txt to yaml.

Changed:
  Add clock-frequency property

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 .../devicetree/bindings/rtc/haoyu,hym8563.txt | 30 ----------
 .../bindings/rtc/haoyu,hym8563.yaml           | 60 +++++++++++++++++++
 2 files changed, 60 insertions(+), 30 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/haoyu,hym8563.yaml

--
2.20.1
  

Comments

Krzysztof Kozlowski Oct. 27, 2022, 3 p.m. UTC | #1
On 26/10/2022 18:58, Johan Jonker wrote:
> Convert haoyu,hym8563.txt to yaml.
> 
> Changed:
>   Add clock-frequency property
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  .../devicetree/bindings/rtc/haoyu,hym8563.txt | 30 ----------
>  .../bindings/rtc/haoyu,hym8563.yaml           | 60 +++++++++++++++++++

https://lore.kernel.org/all/20221024165549.74574-7-sebastian.reichel@collabora.com/

Best regards,
Krzysztof
  
Johan Jonker Oct. 27, 2022, 4 p.m. UTC | #2
On 10/27/22 17:00, Krzysztof Kozlowski wrote:
> On 26/10/2022 18:58, Johan Jonker wrote:
>> Convert haoyu,hym8563.txt to yaml.
>>
>> Changed:
>>   Add clock-frequency property
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>> ---
>>  .../devicetree/bindings/rtc/haoyu,hym8563.txt | 30 ----------
>>  .../bindings/rtc/haoyu,hym8563.yaml           | 60 +++++++++++++++++++
> 

> https://lore.kernel.org/all/20221024165549.74574-7-sebastian.reichel@collabora.com/

Ooops, didn't see that one...
Needed it for the rk3128-evb board to pass without notifications.

Johan

> 
> Best regards,
> Krzysztof
>
  

Patch

diff --git a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
deleted file mode 100644
index a8934fe2a..000000000
--- a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.txt
+++ /dev/null
@@ -1,30 +0,0 @@ 
-Haoyu Microelectronics HYM8563 Real Time Clock
-
-The HYM8563 provides basic rtc and alarm functionality
-as well as a clock output of up to 32kHz.
-
-Required properties:
-- compatible: should be: "haoyu,hym8563"
-- reg: i2c address
-- #clock-cells: the value should be 0
-
-Optional properties:
-- clock-output-names: From common clock binding
-- interrupts: rtc alarm/event interrupt
-
-Example:
-
-hym8563: hym8563@51 {
-	compatible = "haoyu,hym8563";
-	reg = <0x51>;
-
-	interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
-
-	#clock-cells = <0>;
-};
-
-device {
-...
-	clocks = <&hym8563>;
-...
-};
diff --git a/Documentation/devicetree/bindings/rtc/haoyu,hym8563.yaml b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.yaml
new file mode 100644
index 000000000..57729443f
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/haoyu,hym8563.yaml
@@ -0,0 +1,60 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/haoyu,hym8563.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Haoyu Microelectronics HYM8563 Real Time Clock (RTC)
+
+description:
+  The HYM8563 provides basic RTC and alarm functionality
+  as well as a clock output of up to 32kHz.
+
+maintainers:
+  - Heiko Stuebner <heiko@sntech.de>
+
+allOf:
+  - $ref: "rtc.yaml#"
+
+properties:
+  compatible:
+    const: haoyu,hym8563
+
+  reg:
+    const: 0x51
+
+  interrupts:
+    maxItems: 1
+
+  clock-frequency:
+    enum: [1, 32, 1024, 32768]
+
+  clock-output-names:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - "#clock-cells"
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        hym8563: rtc@51 {
+            compatible = "haoyu,hym8563";
+            reg = <0x51>;
+            interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+            clock-frequency = <32768>;
+            clock-output-names = "xin32k";
+            #clock-cells = <0>;
+        };
+    };