Linux-IIO Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings
@ 2019-05-16 12:15 Alexandru Ardelean
  2019-05-16 13:29 ` Rob Herring
  2019-05-16 13:36 ` [PATCH V2] " Alexandru Ardelean
  0 siblings, 2 replies; 7+ messages in thread
From: Alexandru Ardelean @ 2019-05-16 12:15 UTC (permalink / raw)
  To: linux-iio, devicetree; +Cc: robh+dt, Alexandru Ardelean

The ADX345 supports both I2C & SPI bindings.
This change switches from old text bindings, to YAML bindings, and also
tries to make use of the recent multiple-examples support.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 .../bindings/iio/accel/adi,adxl345.yaml       | 74 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
 2 files changed, 74 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/adxl345.txt

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
new file mode 100644
index 000000000000..47cdfb3b8182
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+description: |
+  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
+  both I2C & SPI interfaces.
+    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
+    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adxl345
+      - adi,adxl375
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+
+  spi-cpol: true
+
+  interrupt-parent: true
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a I2C device node */
+        accelerometer@2a {
+            compatible = "adi,adxl345";
+            reg = <0x53>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a SPI device node */
+        accelerometer@0 {
+            compatible = "adi,adxl345";
+            reg = <0>;
+            spi-max-frequency = <5000000>;
+            spi-cpol;
+            spi-cpha;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
deleted file mode 100644
index f9525f6e3d43..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
-
-http://www.analog.com/en/products/mems/accelerometers/adxl345.html
-http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
-
-Required properties:
- - compatible : should be one of
-		"adi,adxl345"
-		"adi,adxl375"
- - reg : the I2C address or SPI chip select number of the sensor
-
-Required properties for SPI bus usage:
- - spi-max-frequency : set maximum clock frequency, must be 5000000
- - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI mode 3
-
-Optional properties:
- - interrupts: interrupt mapping for IRQ as documented in
-   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-
-Example for a I2C device node:
-
-	accelerometer@2a {
-		compatible = "adi,adxl345";
-		reg = <0x53>;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-Example for a SPI device node:
-
-	accelerometer@0 {
-		compatible = "adi,adxl345";
-		reg = <0>;
-		spi-max-frequency = <5000000>;
-		spi-cpol;
-		spi-cpha;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-16 12:15 [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings Alexandru Ardelean
@ 2019-05-16 13:29 ` Rob Herring
  2019-05-16 13:34   ` Ardelean, Alexandru
  2019-05-16 13:36 ` [PATCH V2] " Alexandru Ardelean
  1 sibling, 1 reply; 7+ messages in thread
From: Rob Herring @ 2019-05-16 13:29 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On Thu, May 16, 2019 at 7:15 AM Alexandru Ardelean
<alexandru.ardelean@analog.com> wrote:
>
> The ADX345 supports both I2C & SPI bindings.
> This change switches from old text bindings, to YAML bindings, and also
> tries to make use of the recent multiple-examples support.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
>  .../bindings/iio/accel/adi,adxl345.yaml       | 74 +++++++++++++++++++
>  .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
>  2 files changed, 74 insertions(+), 39 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
>  delete mode 100644 Documentation/devicetree/bindings/iio/accel/adxl345.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> new file mode 100644
> index 000000000000..47cdfb3b8182
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> @@ -0,0 +1,74 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> +
> +maintainers:
> +  - Michael Hennerich <michael.hennerich@analog.com>
> +
> +description: |
> +  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
> +  both I2C & SPI interfaces.
> +    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> +    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,adxl345
> +      - adi,adxl375
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cpha: true
> +
> +  spi-cpol: true
> +
> +  interrupt-parent: true

You don't need to document interrupt-parent. It is implied. With that dropped,

Reviewed-by: Rob Herring <robh@kernel.org>

> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Example for a I2C device node */
> +        accelerometer@2a {
> +            compatible = "adi,adxl345";
> +            reg = <0x53>;
> +            interrupt-parent = <&gpio0>;
> +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +        };
> +    };
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    spi0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Example for a SPI device node */
> +        accelerometer@0 {
> +            compatible = "adi,adxl345";
> +            reg = <0>;
> +            spi-max-frequency = <5000000>;
> +            spi-cpol;
> +            spi-cpha;
> +            interrupt-parent = <&gpio0>;
> +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> deleted file mode 100644
> index f9525f6e3d43..000000000000
> --- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> -
> -http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> -http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> -
> -Required properties:
> - - compatible : should be one of
> -               "adi,adxl345"
> -               "adi,adxl375"
> - - reg : the I2C address or SPI chip select number of the sensor
> -
> -Required properties for SPI bus usage:
> - - spi-max-frequency : set maximum clock frequency, must be 5000000
> - - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI mode 3
> -
> -Optional properties:
> - - interrupts: interrupt mapping for IRQ as documented in
> -   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -
> -Example for a I2C device node:
> -
> -       accelerometer@2a {
> -               compatible = "adi,adxl345";
> -               reg = <0x53>;
> -               interrupt-parent = <&gpio1>;
> -               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> -       };
> -
> -Example for a SPI device node:
> -
> -       accelerometer@0 {
> -               compatible = "adi,adxl345";
> -               reg = <0>;
> -               spi-max-frequency = <5000000>;
> -               spi-cpol;
> -               spi-cpha;
> -               interrupt-parent = <&gpio1>;
> -               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> -       };
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-16 13:29 ` Rob Herring
@ 2019-05-16 13:34   ` Ardelean, Alexandru
  0 siblings, 0 replies; 7+ messages in thread
From: Ardelean, Alexandru @ 2019-05-16 13:34 UTC (permalink / raw)
  To: robh+dt; +Cc: linux-iio, devicetree

On Thu, 2019-05-16 at 08:29 -0500, Rob Herring wrote:
> [External]
> 
> 
> On Thu, May 16, 2019 at 7:15 AM Alexandru Ardelean
> <alexandru.ardelean@analog.com> wrote:
> > 
> > The ADX345 supports both I2C & SPI bindings.
> > This change switches from old text bindings, to YAML bindings, and also
> > tries to make use of the recent multiple-examples support.
> > 
> > Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> > ---
> >  .../bindings/iio/accel/adi,adxl345.yaml       | 74 +++++++++++++++++++
> >  .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
> >  2 files changed, 74 insertions(+), 39 deletions(-)
> >  create mode 100644
> > Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> >  delete mode 100644
> > Documentation/devicetree/bindings/iio/accel/adxl345.txt
> > 
> > diff --git
> > a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> > b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> > new file mode 100644
> > index 000000000000..47cdfb3b8182
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> > @@ -0,0 +1,74 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +%YAML 1.2
> > +---
> > +$id: 
> > http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> > +
> > +maintainers:
> > +  - Michael Hennerich <michael.hennerich@analog.com>
> > +
> > +description: |
> > +  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that
> > supports
> > +  both I2C & SPI interfaces.
> > +    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> > +    
> > http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - adi,adxl345
> > +      - adi,adxl375
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  spi-cpha: true
> > +
> > +  spi-cpol: true
> > +
> > +  interrupt-parent: true
> 
> You don't need to document interrupt-parent. It is implied. With that
> dropped,

I'll send a V2 dropping it.

Thanks
Alex

> 
> Reviewed-by: Rob Herring <robh@kernel.org>
> 
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    i2c0 {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        /* Example for a I2C device node */
> > +        accelerometer@2a {
> > +            compatible = "adi,adxl345";
> > +            reg = <0x53>;
> > +            interrupt-parent = <&gpio0>;
> > +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> > +        };
> > +    };
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    spi0 {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        /* Example for a SPI device node */
> > +        accelerometer@0 {
> > +            compatible = "adi,adxl345";
> > +            reg = <0>;
> > +            spi-max-frequency = <5000000>;
> > +            spi-cpol;
> > +            spi-cpha;
> > +            interrupt-parent = <&gpio0>;
> > +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> > +        };
> > +    };
> > diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> > b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> > deleted file mode 100644
> > index f9525f6e3d43..000000000000
> > --- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> > +++ /dev/null
> > @@ -1,39 +0,0 @@
> > -Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> > -
> > -http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> > -
> > http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> > -
> > -Required properties:
> > - - compatible : should be one of
> > -               "adi,adxl345"
> > -               "adi,adxl375"
> > - - reg : the I2C address or SPI chip select number of the sensor
> > -
> > -Required properties for SPI bus usage:
> > - - spi-max-frequency : set maximum clock frequency, must be 5000000
> > - - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI
> > mode 3
> > -
> > -Optional properties:
> > - - interrupts: interrupt mapping for IRQ as documented in
> > -   Documentation/devicetree/bindings/interrupt-
> > controller/interrupts.txt
> > -
> > -Example for a I2C device node:
> > -
> > -       accelerometer@2a {
> > -               compatible = "adi,adxl345";
> > -               reg = <0x53>;
> > -               interrupt-parent = <&gpio1>;
> > -               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> > -       };
> > -
> > -Example for a SPI device node:
> > -
> > -       accelerometer@0 {
> > -               compatible = "adi,adxl345";
> > -               reg = <0>;
> > -               spi-max-frequency = <5000000>;
> > -               spi-cpol;
> > -               spi-cpha;
> > -               interrupt-parent = <&gpio1>;
> > -               interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> > -       };
> > --
> > 2.17.1
> > 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH V2] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-16 12:15 [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings Alexandru Ardelean
  2019-05-16 13:29 ` Rob Herring
@ 2019-05-16 13:36 ` " Alexandru Ardelean
  2019-05-16 13:53   ` Rob Herring
  2019-05-17 15:44   ` [PATCH][V3] " Alexandru Ardelean
  1 sibling, 2 replies; 7+ messages in thread
From: Alexandru Ardelean @ 2019-05-16 13:36 UTC (permalink / raw)
  To: linux-iio, devicetree; +Cc: robh+dt, Alexandru Ardelean

The ADX345 supports both I2C & SPI bindings.
This change switches from old text bindings, to YAML bindings, and also
tries to make use of the recent multiple-examples support.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
Changelog v1 -> v2:
* dropped interrupt-parent from DT, as suggested by Rob

 .../bindings/iio/accel/adi,adxl345.yaml       | 72 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
 2 files changed, 72 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/adxl345.txt

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
new file mode 100644
index 000000000000..7ba167e2e1ea
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+description: |
+  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
+  both I2C & SPI interfaces.
+    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
+    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adxl345
+      - adi,adxl375
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+
+  spi-cpol: true
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a I2C device node */
+        accelerometer@2a {
+            compatible = "adi,adxl345";
+            reg = <0x53>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a SPI device node */
+        accelerometer@0 {
+            compatible = "adi,adxl345";
+            reg = <0>;
+            spi-max-frequency = <5000000>;
+            spi-cpol;
+            spi-cpha;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
deleted file mode 100644
index f9525f6e3d43..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
-
-http://www.analog.com/en/products/mems/accelerometers/adxl345.html
-http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
-
-Required properties:
- - compatible : should be one of
-		"adi,adxl345"
-		"adi,adxl375"
- - reg : the I2C address or SPI chip select number of the sensor
-
-Required properties for SPI bus usage:
- - spi-max-frequency : set maximum clock frequency, must be 5000000
- - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI mode 3
-
-Optional properties:
- - interrupts: interrupt mapping for IRQ as documented in
-   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-
-Example for a I2C device node:
-
-	accelerometer@2a {
-		compatible = "adi,adxl345";
-		reg = <0x53>;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-Example for a SPI device node:
-
-	accelerometer@0 {
-		compatible = "adi,adxl345";
-		reg = <0>;
-		spi-max-frequency = <5000000>;
-		spi-cpol;
-		spi-cpha;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-16 13:36 ` [PATCH V2] " Alexandru Ardelean
@ 2019-05-16 13:53   ` Rob Herring
  2019-05-17 15:44   ` [PATCH][V3] " Alexandru Ardelean
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2019-05-16 13:53 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: open list:IIO SUBSYSTEM AND DRIVERS, devicetree

On Thu, May 16, 2019 at 8:36 AM Alexandru Ardelean
<alexandru.ardelean@analog.com> wrote:
>
> The ADX345 supports both I2C & SPI bindings.
> This change switches from old text bindings, to YAML bindings, and also
> tries to make use of the recent multiple-examples support.
>
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> ---
> Changelog v1 -> v2:
> * dropped interrupt-parent from DT, as suggested by Rob

Please add acks/reviewed-by tags when posting new versions.

Rob

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH][V3] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-16 13:36 ` [PATCH V2] " Alexandru Ardelean
  2019-05-16 13:53   ` Rob Herring
@ 2019-05-17 15:44   ` " Alexandru Ardelean
  2019-05-18 10:27     ` Jonathan Cameron
  1 sibling, 1 reply; 7+ messages in thread
From: Alexandru Ardelean @ 2019-05-17 15:44 UTC (permalink / raw)
  To: linux-iio, devicetree; +Cc: robh+dt, Alexandru Ardelean

From: Alexandru Ardelean <alexandru.ardelean@analog.com>

The ADX345 supports both I2C & SPI bindings.
This change switches from old text bindings, to YAML bindings, and also
tries to make use of the recent multiple-examples support.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---

Changelog v1 -> v2:
* dropped interrupt-parent from DT, as suggested by Rob

Changelog v2 -> v3:
* add Rob's Reviewed-by tag
* add YAML file to MAINTAINERS - main reason for this V3

 .../bindings/iio/accel/adi,adxl345.yaml       | 72 +++++++++++++++++++
 .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
 MAINTAINERS                                   |  1 +
 3 files changed, 73 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/accel/adxl345.txt

diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
new file mode 100644
index 000000000000..7ba167e2e1ea
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
+
+maintainers:
+  - Michael Hennerich <michael.hennerich@analog.com>
+
+description: |
+  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
+  both I2C & SPI interfaces.
+    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
+    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
+
+properties:
+  compatible:
+    enum:
+      - adi,adxl345
+      - adi,adxl375
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+
+  spi-cpol: true
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a I2C device node */
+        accelerometer@2a {
+            compatible = "adi,adxl345";
+            reg = <0x53>;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    spi0 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        /* Example for a SPI device node */
+        accelerometer@0 {
+            compatible = "adi,adxl345";
+            reg = <0>;
+            spi-max-frequency = <5000000>;
+            spi-cpol;
+            spi-cpha;
+            interrupt-parent = <&gpio0>;
+            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
deleted file mode 100644
index f9525f6e3d43..000000000000
--- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
-
-http://www.analog.com/en/products/mems/accelerometers/adxl345.html
-http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
-
-Required properties:
- - compatible : should be one of
-		"adi,adxl345"
-		"adi,adxl375"
- - reg : the I2C address or SPI chip select number of the sensor
-
-Required properties for SPI bus usage:
- - spi-max-frequency : set maximum clock frequency, must be 5000000
- - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI mode 3
-
-Optional properties:
- - interrupts: interrupt mapping for IRQ as documented in
-   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-
-Example for a I2C device node:
-
-	accelerometer@2a {
-		compatible = "adi,adxl345";
-		reg = <0x53>;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-Example for a SPI device node:
-
-	accelerometer@0 {
-		compatible = "adi,adxl345";
-		reg = <0>;
-		spi-max-frequency = <5000000>;
-		spi-cpol;
-		spi-cpha;
-		interrupt-parent = <&gpio1>;
-		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
-	};
diff --git a/MAINTAINERS b/MAINTAINERS
index 43a9cebb2c19..54c8e14fae98 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -551,6 +551,7 @@ W:	http://wiki.analog.com/ADXL345
 W:	http://ez.analog.com/community/linux-device-drivers
 S:	Supported
 F:	drivers/input/misc/adxl34x.c
+F:	Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
 
 ADXL372 THREE-AXIS DIGITAL ACCELEROMETER DRIVER
 M:	Stefan Popa <stefan.popa@analog.com>
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH][V3] dt-bindings: iio: accel: adxl345: switch to YAML bindings
  2019-05-17 15:44   ` [PATCH][V3] " Alexandru Ardelean
@ 2019-05-18 10:27     ` Jonathan Cameron
  0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2019-05-18 10:27 UTC (permalink / raw)
  To: Alexandru Ardelean; +Cc: linux-iio, devicetree, robh+dt, Alexandru Ardelean

On Fri, 17 May 2019 18:44:41 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> From: Alexandru Ardelean <alexandru.ardelean@analog.com>
> 
> The ADX345 supports both I2C & SPI bindings.
> This change switches from old text bindings, to YAML bindings, and also
> tries to make use of the recent multiple-examples support.
> 
> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
> 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

> ---
> 
> Changelog v1 -> v2:
> * dropped interrupt-parent from DT, as suggested by Rob
> 
> Changelog v2 -> v3:
> * add Rob's Reviewed-by tag
> * add YAML file to MAINTAINERS - main reason for this V3
> 
>  .../bindings/iio/accel/adi,adxl345.yaml       | 72 +++++++++++++++++++
>  .../devicetree/bindings/iio/accel/adxl345.txt | 39 ----------
>  MAINTAINERS                                   |  1 +
>  3 files changed, 73 insertions(+), 39 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
>  delete mode 100644 Documentation/devicetree/bindings/iio/accel/adxl345.txt
> 
> diff --git a/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> new file mode 100644
> index 000000000000..7ba167e2e1ea
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/accelerometers/adi,adxl345.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> +
> +maintainers:
> +  - Michael Hennerich <michael.hennerich@analog.com>
> +
> +description: |
> +  Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers that supports
> +  both I2C & SPI interfaces.
> +    http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> +    http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,adxl345
> +      - adi,adxl375
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cpha: true
> +
> +  spi-cpol: true
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    i2c0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Example for a I2C device node */
> +        accelerometer@2a {
> +            compatible = "adi,adxl345";
> +            reg = <0x53>;
> +            interrupt-parent = <&gpio0>;
> +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +        };
> +    };
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    spi0 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        /* Example for a SPI device node */
> +        accelerometer@0 {
> +            compatible = "adi,adxl345";
> +            reg = <0>;
> +            spi-max-frequency = <5000000>;
> +            spi-cpol;
> +            spi-cpha;
> +            interrupt-parent = <&gpio0>;
> +            interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> +        };
> +    };
> diff --git a/Documentation/devicetree/bindings/iio/accel/adxl345.txt b/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> deleted file mode 100644
> index f9525f6e3d43..000000000000
> --- a/Documentation/devicetree/bindings/iio/accel/adxl345.txt
> +++ /dev/null
> @@ -1,39 +0,0 @@
> -Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
> -
> -http://www.analog.com/en/products/mems/accelerometers/adxl345.html
> -http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
> -
> -Required properties:
> - - compatible : should be one of
> -		"adi,adxl345"
> -		"adi,adxl375"
> - - reg : the I2C address or SPI chip select number of the sensor
> -
> -Required properties for SPI bus usage:
> - - spi-max-frequency : set maximum clock frequency, must be 5000000
> - - spi-cpol and spi-cpha : must be defined for adxl345 to enable SPI mode 3
> -
> -Optional properties:
> - - interrupts: interrupt mapping for IRQ as documented in
> -   Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
> -
> -Example for a I2C device node:
> -
> -	accelerometer@2a {
> -		compatible = "adi,adxl345";
> -		reg = <0x53>;
> -		interrupt-parent = <&gpio1>;
> -		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> -
> -Example for a SPI device node:
> -
> -	accelerometer@0 {
> -		compatible = "adi,adxl345";
> -		reg = <0>;
> -		spi-max-frequency = <5000000>;
> -		spi-cpol;
> -		spi-cpha;
> -		interrupt-parent = <&gpio1>;
> -		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 43a9cebb2c19..54c8e14fae98 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -551,6 +551,7 @@ W:	http://wiki.analog.com/ADXL345
>  W:	http://ez.analog.com/community/linux-device-drivers
>  S:	Supported
>  F:	drivers/input/misc/adxl34x.c
> +F:	Documentation/devicetree/bindings/iio/accel/adi,adxl345.yaml
>  
>  ADXL372 THREE-AXIS DIGITAL ACCELEROMETER DRIVER
>  M:	Stefan Popa <stefan.popa@analog.com>


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16 12:15 [PATCH] dt-bindings: iio: accel: adxl345: switch to YAML bindings Alexandru Ardelean
2019-05-16 13:29 ` Rob Herring
2019-05-16 13:34   ` Ardelean, Alexandru
2019-05-16 13:36 ` [PATCH V2] " Alexandru Ardelean
2019-05-16 13:53   ` Rob Herring
2019-05-17 15:44   ` [PATCH][V3] " Alexandru Ardelean
2019-05-18 10:27     ` Jonathan Cameron

Linux-IIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-iio/0 linux-iio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-iio linux-iio/ https://lore.kernel.org/linux-iio \
		linux-iio@vger.kernel.org linux-iio@archiver.kernel.org
	public-inbox-index linux-iio


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-iio


AGPL code for this site: git clone https://public-inbox.org/ public-inbox