diff mbox series

[v2] dt-bindings: iio: adc: convert sd modulator to json-schema

Message ID 20191206100058.26767-1-olivier.moysan@st.com (mailing list archive)
State Mainlined
Commit 57b8879c0c1af5ac4cfc9dd1260d40b13dd6027d
Headers show
Series [v2] dt-bindings: iio: adc: convert sd modulator to json-schema | expand

Commit Message

Olivier MOYSAN Dec. 6, 2019, 10 a.m. UTC
Convert the sigma delta modulator bindings
to DT schema format using json-schema.

Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
---
Changes since v1:
- add additionalProperties
- remove unit-address in example
---
 .../iio/adc/sigma-delta-modulator.txt         | 13 -------
 .../iio/adc/sigma-delta-modulator.yaml        | 37 +++++++++++++++++++
 2 files changed, 37 insertions(+), 13 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml

Comments

Rob Herring Dec. 18, 2019, 10:30 p.m. UTC | #1
On Fri, 6 Dec 2019 11:00:58 +0100, Olivier Moysan wrote:
> Convert the sigma delta modulator bindings
> to DT schema format using json-schema.
> 
> Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
> ---
> Changes since v1:
> - add additionalProperties
> - remove unit-address in example
> ---
>  .../iio/adc/sigma-delta-modulator.txt         | 13 -------
>  .../iio/adc/sigma-delta-modulator.yaml        | 37 +++++++++++++++++++
>  2 files changed, 37 insertions(+), 13 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> 

Reviewed-by: Rob Herring <robh@kernel.org>
Jonathan Cameron Dec. 23, 2019, 6:01 p.m. UTC | #2
On Wed, 18 Dec 2019 16:30:32 -0600
Rob Herring <robh@kernel.org> wrote:

> On Fri, 6 Dec 2019 11:00:58 +0100, Olivier Moysan wrote:
> > Convert the sigma delta modulator bindings
> > to DT schema format using json-schema.
> > 
> > Signed-off-by: Olivier Moysan <olivier.moysan@st.com>
> > ---
> > Changes since v1:
> > - add additionalProperties
> > - remove unit-address in example
> > ---
> >  .../iio/adc/sigma-delta-modulator.txt         | 13 -------
> >  .../iio/adc/sigma-delta-modulator.yaml        | 37 +++++++++++++++++++
> >  2 files changed, 37 insertions(+), 13 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
> >  create mode 100644 Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
deleted file mode 100644
index 59b92cd32552..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt
+++ /dev/null
@@ -1,13 +0,0 @@ 
-Device-Tree bindings for sigma delta modulator
-
-Required properties:
-- compatible: should be "ads1201", "sd-modulator". "sd-modulator" can be use
-	as a generic SD modulator if modulator not specified in compatible list.
-- #io-channel-cells = <0>: See the IIO bindings section "IIO consumers".
-
-Example node:
-
-	ads1202: adc {
-		compatible = "sd-modulator";
-		#io-channel-cells = <0>;
-	};
diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
new file mode 100644
index 000000000000..a390343d0c2a
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.yaml
@@ -0,0 +1,37 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/sigma-delta-modulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Device-Tree bindings for sigma delta modulator
+
+maintainers:
+  - Arnaud Pouliquen <arnaud.pouliquen@st.com>
+
+properties:
+  compatible:
+    description: |
+      "sd-modulator" can be used as a generic SD modulator,
+      if the modulator is not specified in the compatible list.
+    enum:
+      - sd-modulator
+      - ads1201
+
+  '#io-channel-cells':
+    const: 0
+
+required:
+  - compatible
+  - '#io-channel-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    ads1202: adc {
+      compatible = "sd-modulator";
+      #io-channel-cells = <0>;
+    };
+
+...