devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v6 4/4] dt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label
       [not found] ` <20200921133020.62978-4-cristian.pop@analog.com>
@ 2020-09-25 12:04   ` Jonathan Cameron
  0 siblings, 0 replies; only message in thread
From: Jonathan Cameron @ 2020-09-25 12:04 UTC (permalink / raw)
  To: Cristian Pop; +Cc: linux-iio, linux-kernel, Rob Herring, devicetree

On Mon, 21 Sep 2020 16:30:20 +0300
Cristian Pop <cristian.pop@analog.com> wrote:

Hi Cristian,

> Optional attribute for better identification of the channels.
Dt-bindings need to be sent to the dt-binding maintainer and
list.
+CC.

I'll definitely be looking for a review from Rob on this one as we are defining
a new generic binding.

@Rob, the only new bit in here is the label for an individual channel.
The rest has been defined for a while to allow us to control channel
specific aspects of an ADC.

We should also look to add it to the top level docs.

In this case, probably
Documentation/device-tree/bindings/iio/adc/adc.txt

Currently only ADCs have a channel description to add this to.
We can look at making this more generic if it turns out to make sense
for other types of IIO device.

Thanks,

Jonathan


> 
> Signed-off-by: Cristian Pop <cristian.pop@analog.com>
> ---
>  .../bindings/iio/adc/adi,ad7768-1.yaml        | 31 +++++++++++++++++++
>  1 file changed, 31 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
> index d3733ad8785a..0c75ce73ffe9 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,23 @@ 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:
> +      - rega
rega?  Also, one I learnt the other day.  Need to have

       additionalProperties: false

for child nodes as well as the base node.

> +
>  additionalProperties: false
>  
>  examples:
> @@ -84,6 +107,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";
> +            };
>          };
>      };
>  ...


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-25 12:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200921133020.62978-1-cristian.pop@analog.com>
     [not found] ` <20200921133020.62978-4-cristian.pop@analog.com>
2020-09-25 12:04   ` [PATCH v6 4/4] dt-bindings:iio:adc:adi,ad7768-1: Add documentation for channel label Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).