From: Jonathan Cameron <jic23@kernel.org>
To: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
Cc: <andy.shevchenko@gmail.com>, <linux-iio@vger.kernel.org>,
<Nuno.Sa@analog.com>, <Nurettin.Bolucu@analog.com>
Subject: Re: [PATCH v2 3/3] dt-bindings: iio: adc: add adi,max11410.yaml
Date: Thu, 7 Jul 2022 16:48:10 +0100 [thread overview]
Message-ID: <20220707164810.7811fbb0@jic23-huawei> (raw)
In-Reply-To: <20220707083126.181-3-Ibrahim.Tilki@analog.com>
On Thu, 7 Jul 2022 08:31:26 +0000
Ibrahim Tilki <Ibrahim.Tilki@analog.com> wrote:
> Adding devicetree binding documentation for max11410 adc.
>
> Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
> Reviewed-by: Nurettin Bolucu <Nurettin.Bolucu@analog.com>
Hi.
A few questions inline. Mostly stuff I couldn't figure out from a quick
scan through the datasheet.
> ---
> .../bindings/iio/adc/adi,max11410.yaml | 168 ++++++++++++++++++
> 1 file changed, 168 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml b/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
> new file mode 100644
> index 000000000..f28d29fb2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,max11410.yaml
> @@ -0,0 +1,168 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright 2022 Analog Devices Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/adi,max11410.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices MAX11410 ADC device driver
> +
> +maintainers:
> + - Ibrahim Tilki <ibrahim.tilki@analog.com>
> +
> +description: |
> + Bindings for the Analog Devices MAX11410 ADC device. Datasheet can be
> + found here:
> + https://datasheets.maximintegrated.com/en/ds/MAX11410.pdf
> +
> +properties:
> + compatible:
> + enum:
> + - adi,max11410
> +
> + reg:
> + description: SPI chip select number for the device
Description not needed as same for all SPI devices.
> + maxItems: 1
> +
> + interrupts:
> + description: IRQ line for the ADC
The description doesn't tell us anything so drop it.
There is no need to provide description lines for self documenting
items like this.
> + maxItems: 1
> +
> + '#address-cells':
> + const: 1
> +
> + '#size-cells':
> + const: 0
> +
> + avdd-supply:
> + description: avdd supply can be used as reference for conversion.
Mention it's also a necessary power supply. As mentioned in driver review
I'd suggest you actually treat this as 'no explicit reference supplied'.
That simplifies the meaning of the adi,reference below.
> +
> + vref0p-supply:
> + description: vref0p supply can be used as reference for conversion.
> +
> + vref1p-supply:
> + description: vref1p supply can be used as reference for conversion.
> +
> + vref2p-supply:
> + description: vref2p supply can be used as reference for conversion.
> +
> + vref0n-supply:
> + description: vref0n supply can be used as reference for conversion.
> +
> + vref1n-supply:
> + description: vref1n supply can be used as reference for conversion.
> +
> + vref2n-supply:
> + description: vref2n supply can be used as reference for conversion.
> +
> + spi-max-frequency:
> + maximum: 8000000
> +
> +required:
> + - compatible
> + - reg
> + - avdd-supply
> +
> +patternProperties:
> + "^channel(@[0-9a-f]+)?$":
> + $ref: "adc.yaml"
> + type: object
> + description: Represents the external channels which are connected to the ADC.
> +
> + properties:
> + reg:
> + description: The channel number in single-ended mode.
> + minimum: 0
> + maximum: 10
> +
> + adi,reference:
> + description: |
> + Select the reference source to use when converting on
> + the specific channel. Valid values are:
> + 0: REF0P/REF0N
VREF0P etc to match namign above.
> + 1: REF1P/REF1N
> + 2: REF2P/REF2N
> + 3: AVDD/AGND
> + 4: REF0P/AGND
> + 5: REF1P/AGND
> + 6: REF2P/AGND
Is it valid to use REF0P/AGND for a differential channel? If not
I would reduce this list to 0-2 only. If it is valid (so actually
useful to do so) then we are stuck with this. That does make me wonder
if there is a difference between 3 and 7? If not, just don't list 7
> + 7: AVDD/AGND
> + If this field is left empty, AVDD/AGND is selected.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [0, 1, 2, 3, 4, 5, 6, 7]
> + default: 7
> +
> + adi,input-mode:
> + description: |
> + Select signal path of input channels. When PGA path is selected,
> + hardwaregain property is enabled for channel. Valid values are:
> + 0: Buffered, low-power, unity-gain path (default)
> + 1: Bypass path
> + 2: PGA path
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [0, 1, 2]
> + default: 0
> +
> + diff-channels: true
> +
> + bipolar: true
> +
> + settling-time-us: true
> +
> + adi,buffered-vrefp:
> + description: Enable buffered mode for positive reference.
> + type: boolean
> +
> + adi,buffered-vrefn:
> + description: Enable buffered mode for negative reference.
> + type: boolean
> +
> + required:
> + - reg
> +
> + additionalProperties: false
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + adc@0 {
> + compatible = "adi,max11410";
> + reg = <0>;
> + spi-max-frequency = <8000000>;
> + interrupts = <25 2>;
> + interrupt-parent = <&gpio>;
> +
> + avdd-supply = <&adc_avdd>;
> +
> + vref1p-supply = <&adc_vref1p>;
> + vref1n-supply = <&adc_vref1n>;
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + channel@0 {
> + reg = <0>;
> + };
> +
> + channel@1 {
> + reg = <1>;
> + diff-channels = <2 3>;
> + adi,reference = <1>;
> + bipolar;
> + settling-time-us = <100000>;
> + };
> +
> + channel@2 {
> + reg = <2>;
> + diff-channels = <7 9>;
> + adi,reference = <5>;
> + adi,input-mode = <2>;
> + settling-time-us = <50000>;
> + };
> + };
> + };
next prev parent reply other threads:[~2022-07-07 15:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 8:31 [PATCH v2 1/3] iio: adc: add max11410 adc driver Ibrahim Tilki
2022-07-07 8:31 ` [PATCH v2 2/3] Documentation: ABI: testing: add max11410 doc Ibrahim Tilki
2022-07-07 8:31 ` [PATCH v2 3/3] dt-bindings: iio: adc: add adi,max11410.yaml Ibrahim Tilki
2022-07-07 15:48 ` Jonathan Cameron [this message]
2022-07-19 14:59 ` Ibrahim Tilki
2022-07-31 19:37 ` Jonathan Cameron
2022-07-07 16:47 ` [PATCH v2 1/3] iio: adc: add max11410 adc driver Jonathan Cameron
2022-07-19 14:59 ` Ibrahim Tilki
2022-07-20 9:25 ` Nuno Sá
2022-07-31 19:59 ` 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=20220707164810.7811fbb0@jic23-huawei \
--to=jic23@kernel.org \
--cc=Ibrahim.Tilki@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=Nurettin.Bolucu@analog.com \
--cc=andy.shevchenko@gmail.com \
--cc=linux-iio@vger.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;
as well as URLs for NNTP newsgroup(s).