diff mbox series

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

Message ID 20201113113451.52355-2-zhang.lyra@gmail.com
State Changes Requested, archived
Headers show
Series None | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 2 warnings, 44 lines checked
robh/dt-meta-schema fail build log

Commit Message

Chunyan Zhang Nov. 13, 2020, 11:34 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  | 44 +++++++++++++++++++
 2 files changed, 44 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 Nov. 16, 2020, 2:54 p.m. UTC | #1
On Fri, 13 Nov 2020 19:34:50 +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  | 44 +++++++++++++++++++
>  2 files changed, 44 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
> 


My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml: 'additionalProperties' is a required property
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml: ignoring, error in schema: 
warning: no schema found in file: ./Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml


See https://patchwork.ozlabs.org/patch/1399724

The base for the patch is generally the last rc1. Any dependencies
should be noted.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Chunyan Zhang Nov. 17, 2020, 3:34 a.m. UTC | #2
On Mon, 16 Nov 2020 at 22:54, Rob Herring <robh@kernel.org> wrote:
>
> On Fri, 13 Nov 2020 19:34:50 +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  | 44 +++++++++++++++++++
> >  2 files changed, 44 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
> >
>
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml: 'additionalProperties' is a required property
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml: ignoring, error in schema:
> warning: no schema found in file: ./Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
>
>
> See https://patchwork.ozlabs.org/patch/1399724
>
> The base for the patch is generally the last rc1. Any dependencies

When trying to reproduce the error, I found there's an error on rc1
along with a lot of unrelated warnings, but rc2 is good.

$ make -k dt_binding_check
DT_SCHEMA_FILES=Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
  LINT    Documentation/devicetree/bindings

[snip...]

make[1]: *** [Documentation/devicetree/bindings/Makefile:59:
Documentation/devicetree/bindings/processed-schema-examples.json]
Error 123
  DTEX    Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.example.dts
make[1]: Target '__build' not remade because of errors.
make: *** [Makefile:1364: dt_binding_check] Error 2

> should be noted.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.

Ok, thanks for pointing this out.

Chunyan
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..abdf459d9141
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/sprd,sc27xx-vibrator.yaml
@@ -0,0 +1,44 @@ 
+# 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
+
+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>;
+      };
+    };