diff mbox series

[v2,2/3] dt-bindings: input: Convert sc27xx-vibra.txt to json-schema

Message ID 20201117034949.47877-3-zhang.lyra@gmail.com
State New
Headers show
Series Add support for sc2730 and sc2721 | expand

Commit Message

Chunyan Zhang Nov. 17, 2020, 3:49 a.m. UTC
From: Chunyan Zhang <chunyan.zhang@unisoc.com>

Convert the sprd sc27xx vibrator binding to DT schema using json-schema.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 .../bindings/input/sprd,sc27xx-vibra.txt      | 23 ----------
 .../bindings/input/sprd,sc27xx-vibrator.yaml  | 46 +++++++++++++++++++
 2 files changed, 46 insertions(+), 23 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt
 create mode 100644 Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml

Comments

Rob Herring (Arm) Dec. 7, 2020, 7:35 p.m. UTC | #1
On Tue, 17 Nov 2020 11:49:48 +0800, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@unisoc.com>

> 

> Convert the sprd sc27xx vibrator binding to DT schema using json-schema.

> 

> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>

> ---

>  .../bindings/input/sprd,sc27xx-vibra.txt      | 23 ----------

>  .../bindings/input/sprd,sc27xx-vibrator.yaml  | 46 +++++++++++++++++++

>  2 files changed, 46 insertions(+), 23 deletions(-)

>  delete mode 100644 Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt

>  create mode 100644 Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml

> 


Reviewed-by: Rob Herring <robh@kernel.org>
Dmitry Torokhov Dec. 12, 2020, 3 a.m. UTC | #2
On Tue, Nov 17, 2020 at 11:49:48AM +0800, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@unisoc.com>

> 

> Convert the sprd sc27xx vibrator binding to DT schema using json-schema.

> 

> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>


Applied, thank you.

-- 
Dmitry
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt
deleted file mode 100644
index f2ec0d4f2dff..000000000000
--- a/Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt
+++ /dev/null
@@ -1,23 +0,0 @@ 
-Spreadtrum SC27xx PMIC Vibrator
-
-Required properties:
-- compatible: should be "sprd,sc2731-vibrator".
-- reg: address of vibrator control register.
-
-Example :
-
-	sc2731_pmic: pmic@0 {
-		compatible = "sprd,sc2731";
-		reg = <0>;
-		spi-max-frequency = <26000000>;
-		interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		vibrator@eb4 {
-			compatible = "sprd,sc2731-vibrator";
-			reg = <0xeb4>;
-		};
-	};
diff --git a/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
new file mode 100644
index 000000000000..b8a3f23ee3dd
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
@@ -0,0 +1,46 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2020 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/sprd,sc27xx-vibrator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Spreadtrum SC27xx PMIC Vibrator Device Tree Bindings
+
+maintainers:
+  - Orson Zhai <orsonzhai@gmail.com>
+  - Baolin Wang <baolin.wang7@gmail.com>
+  - Chunyan Zhang <zhang.lyra@gmail.com>
+
+properties:
+  compatible:
+    enum:
+      - sprd,sc2731-vibrator
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    sc2731_pmic: pmic@0 {
+      compatible = "sprd,sc2731";
+      reg = <0 0>;
+      spi-max-frequency = <26000000>;
+      interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-controller;
+      #interrupt-cells = <2>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      vibrator@eb4 {
+        compatible = "sprd,sc2731-vibrator";
+        reg = <0xeb4>;
+      };
+    };