diff mbox series

[v7,4/5] dt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label

Message ID 20201102142000.68916-4-cristian.pop@analog.com
State Accepted
Commit 7d4156ddf1b838b100a037d02d4bf15ccb3ccd26
Headers show
Series None | expand

Commit Message

Cristian Pop Nov. 2, 2020, 2:19 p.m. UTC
Optional attribute for better identification of the channels.

Signed-off-by: Cristian Pop <cristian.pop@analog.com>
---
Changes in v7:
 - Add "additionalProperties: false" for channel child nodes.
 - Fix "reg" spelling.
 .../bindings/iio/adc/adi,ad7768-1.yaml        | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)

Comments

Rob Herring Nov. 5, 2020, 5:19 p.m. UTC | #1
On Mon, Nov 02, 2020 at 04:19:59PM +0200, Cristian Pop wrote:
> Optional attribute for better identification of the channels.

> 

> Signed-off-by: Cristian Pop <cristian.pop@analog.com>

> ---

> Changes in v7:

>  - Add "additionalProperties: false" for channel child nodes.

>  - Fix "reg" spelling.

>  .../bindings/iio/adc/adi,ad7768-1.yaml        | 32 +++++++++++++++++++

>  1 file changed, 32 insertions(+)


Jonathan's common ADC schema should remove the need for some of this, 
but given it's v7:

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


> 

> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml

> index d3733ad8785a..6be43bf5c1e0 100644

> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml

> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml

> @@ -29,6 +29,12 @@ properties:

>    interrupts:

>      maxItems: 1

>  

> +  '#address-cells':

> +    const: 1

> +

> +  '#size-cells':

> +    const: 0

> +

>    vref-supply:

>      description:

>        ADC reference voltage supply

> @@ -61,6 +67,24 @@ required:

>    - spi-cpha

>    - adi,sync-in-gpios

>  

> +patternProperties:

> +  "^channel@([0-9]|1[0-5])$":

> +    type: object

> +    description: |

> +      Represents the external channels which are connected to the device.

> +

> +    properties:

> +      reg:

> +        description: |

> +          The channel number.

> +

> +      label:

> +        description: |

> +          Unique name to identify which channel this is.

> +    required:

> +      - reg

> +    additionalProperties: false

> +

>  additionalProperties: false

>  

>  examples:

> @@ -84,6 +108,14 @@ examples:

>              reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>;

>              clocks = <&ad7768_mclk>;

>              clock-names = "mclk";

> +

> +            #address-cells = <1>;

> +            #size-cells = <0>;

> +

> +            channel@0 {

> +                reg = <0>;

> +                label = "channel_0";

> +            };

>          };

>      };

>  ...

> -- 

> 2.17.1

>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
index d3733ad8785a..6be43bf5c1e0 100644
--- a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
+++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
@@ -29,6 +29,12 @@  properties:
   interrupts:
     maxItems: 1
 
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
   vref-supply:
     description:
       ADC reference voltage supply
@@ -61,6 +67,24 @@  required:
   - spi-cpha
   - adi,sync-in-gpios
 
+patternProperties:
+  "^channel@([0-9]|1[0-5])$":
+    type: object
+    description: |
+      Represents the external channels which are connected to the device.
+
+    properties:
+      reg:
+        description: |
+          The channel number.
+
+      label:
+        description: |
+          Unique name to identify which channel this is.
+    required:
+      - reg
+    additionalProperties: false
+
 additionalProperties: false
 
 examples:
@@ -84,6 +108,14 @@  examples:
             reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
             clocks = <&ad7768_mclk>;
             clock-names = "mclk";
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            channel@0 {
+                reg = <0>;
+                label = "channel_0";
+            };
         };
     };
 ...