Devicetree
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
	broonie@kernel.org, lars@metafoo.de,
	Michael.Hennerich@analog.com, jic23@kernel.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, nuno.sa@analog.com,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/6] dt-bindings: iio: adc: Add AD4000
Date: Wed, 19 Jun 2024 14:04:14 -0300	[thread overview]
Message-ID: <ZnMPjtj1ZhOzKeps@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <38f99355-0186-4c2f-912a-cb03d6e4823c@baylibre.com>

On 06/19, David Lechner wrote:
> On 6/18/24 6:12 PM, Marcelo Schmitt wrote:
> > Add device tree documentation for AD4000 series of ADC devices.
> > 
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad4000-4004-4008.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad4001-4005.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad4002-4006-4010.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad4003-4007-4011.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/ad4020-4021-4022.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4001.pdf
> > Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/adaq4003.pdf
> 
> Datasheets URLs are listed in the patch, so probably don't need them
> in the commit message too.

okay, removed them for v5.

> 
...
> 
> There are data sheets listed for adaq400x but no compatibles.

Ah, that's correct. I missed
      - const: adi,adaq4001
      - const: adi,adaq4003

thanks
> 
...
> > +
> > +  adi,gain-milli:
> > +    description: |
> > +      The hardware gain applied to the ADC input (in milli units).
> > +      The gain provided by the ADC input scaler is defined by the hardware
> > +      connections between chip pins OUT+, R1K-, R1K1-, R1K+, R1K1+, and OUT-.
> > +      If not present, default to 1000 (no actual gain applied).
> > +    $ref: /schemas/types.yaml#/definitions/uint16
> 
> Any particular reason why this needs to be uint16 instead of the more
> common uint32?

The values fit into 16 bits and Nuno asked to make it a 16-bit property.

> 
> > +    enum: [454, 909, 1000, 1900]
> > +    default: 1000
> > +
...
> > +  # The configuration register can only be accessed in '3-wire' mode
> > +  - if:
> > +      not:
> > +        properties:
> > +          adi,spi-mode:
> > +            contains:
> > +              enum:
> > +                - single
> 
> adi,spi-mode is not an array and we are only checking for one value,
> so this could be simplified to:
> 
>   properties:
>     adi,spi-mode:
>       const: single
> 
ok, changed to do the check that way.

...
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +    spi {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        /* Example for a AD devices */
> 
> Comments are a bit redundant since it says "examples:" above and
> the type of the chip in the compatible string.
> 
I like the comments. I think it makes clear we have AD and ADAQ devices but ok,
removing them for v5.

> > +        adc@0 {
> > +            compatible = "adi,ad4020";
> > +            reg = <0>;
> > +            spi-max-frequency = <71000000>;
> > +            vdd-supply = <&supply_1_8V>;
> > +            vio-supply = <&supply_1_8V>;
> > +            ref-supply = <&supply_5V>;
> > +            cnv-gpios = <&gpio0 88 GPIO_ACTIVE_HIGH>;
> > +        };
> > +    };
> > +  - |
> > +    spi {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +        /* Example for a ADAQ devices */
> > +        adc@0 {
> > +            compatible = "adi,adaq4003";
> > +            reg = <0>;
> > +            spi-max-frequency = <80000000>;
> > +            vdd-supply = <&supply_1_8V>;
> > +            vio-supply = <&supply_1_8V>;
> > +            ref-supply = <&supply_5V>;
> > +            adi,high-z-input;
> > +            adi,gain-milli = /bits/ 16 <454>;
> > +            adi,spi-mode = "single";
> > +        };
> > +    };

  reply	other threads:[~2024-06-19 17:02 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 23:10 [PATCH v4 0/6] Add support for AD4000 series of ADCs Marcelo Schmitt
2024-06-18 23:10 ` [PATCH v4 1/6] spi: Enable controllers to extend the SPI protocol with MOSI idle configuration Marcelo Schmitt
2024-06-19 12:07   ` Mark Brown
2024-06-19 12:42     ` Marcelo Schmitt
2024-06-19 12:42       ` Mark Brown
2024-06-19 13:53   ` David Lechner
2024-06-19 18:58     ` Marcelo Schmitt
2024-06-19 20:36       ` David Lechner
2024-06-20 15:12         ` Marcelo Schmitt
2024-06-20 15:52           ` David Lechner
2024-06-20 18:21             ` Marcelo Schmitt
2024-06-20 18:55               ` David Lechner
2024-06-19 21:29       ` Mark Brown
2024-06-20 15:14         ` Marcelo Schmitt
2024-06-19 17:24   ` David Lechner
2024-06-20 14:29     ` Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 2/6] spi: bitbang: Implement support for MOSI idle state configuration Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 3/6] spi: spi-gpio: Add " Marcelo Schmitt
2024-06-18 23:11 ` [PATCH v4 4/6] spi: spi-axi-spi-engine: Add support for MOSI idle configuration Marcelo Schmitt
2024-06-19 13:56   ` David Lechner
2024-06-19 17:27     ` Marcelo Schmitt
2024-06-19 18:20       ` David Lechner
2024-06-18 23:12 ` [PATCH v4 5/6] dt-bindings: iio: adc: Add AD4000 Marcelo Schmitt
2024-06-19 13:13   ` David Lechner
2024-06-19 17:04     ` Marcelo Schmitt [this message]
2024-06-19 19:57   ` David Lechner
2024-06-18 23:12 ` [PATCH v4 6/6] iio: adc: Add support for AD4000 Marcelo Schmitt
2024-06-19 17:02   ` David Lechner
2024-06-20 20:08     ` Jonathan Cameron
2024-06-20 20:02   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnMPjtj1ZhOzKeps@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=nuno.sa@analog.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox