Re: [RFC PATCH 5/5] dt-bindings: iio: adc: add bindings for TI ADS1262

From: Conor Dooley
Date: Thu May 01 2025 - 10:51:53 EST


On Thu, May 01, 2025 at 03:30:43PM +0530, Sayyad Abid wrote:

> +properties:
> + compatible:
> + enum:
> + - ti,ads1262

How different is the ads1263? Do we get support for both "for free"?

> + spi-cpha:
> + type: boolean
> + description: Required for SPI mode 1 operation

This should just collapse to "spi-cpha: true", cos the definition of it
comes from spi-peripheral-props.yaml.

> +
> + reset-gpios:
> + maxItems: 1
> + description: GPIO specifier for the reset pin (active low)
> +
> + vref-supply:
> + description: |
> + The regulator supply for ADC reference voltage. If not specified,
> + the internal 2.5V reference will be used.

I looked this device up, I don't see an input pin called "vref" and
there appear to be multiple reference inputs. All supplies should be
documented.

> + ti,gain:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 0
> + maximum: 5
> + description: |
> + PGA gain setting. Not applicable for temperature sensor (channel 11).
> + 0: 1 (default)
> + 1: 2
> + 2: 4
> + 3: 8
> + 4: 16
> + 5: 32

Why can't the gain be in it's actual unit, rather than what I am
guessing is a register value?

> + ti,data-rate:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + minimum: 0
> + maximum: 15
> + description: |
> + Data acquisition rate in samples per second
> + 0: 2.5
> + 1: 5
> + 2: 10
> + 3: 16.6
> + 4: 20
> + 5: 50
> + 6: 60
> + 7: 100
> + 8: 400
> + 9: 1200
> + 10: 2400
> + 11: 4800
> + 12: 7200
> + 13: 14400
> + 14: 19200
> + 15: 38400

Same applies here really, except that the fractional per second rate
would only work if the base unit was samples-per-<something sub second>,
which might or might not be worth it.

> +examples:
> + - |
> + #include <dt-bindings/gpio/gpio.h>
> +
> + spi {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + ads1262: adc@0 {

The label here is unused AFAICT and should be dropped.

Cheers,
Conor.

> + compatible = "ti,ads1262";
> + reg = <0>;
> + spi-max-frequency = <7372800>;
> + vref-supply = <&adc_vref>;
> + spi-cpha;
> + reset-gpios = <&gpio1 16 GPIO_ACTIVE_LOW>;
> + ti,pga-bypass;
> + ti,data-rate = <15>; /* 38400 SPS */
> +
> + #address-cells = <1>;
> + #size-cells = <0>;
> + #io-channel-cells = <1>;
> +
> + /* Single-ended channel */
> + channel@0 {
> + reg = <0>;
> + };
> +
> + /* Differential channel */
> + channel@1 {
> + reg = <1>;
> + diff-channels = <1 2>;
> + ti,gain = <2>; /* Gain of 4 */
> + };
> +
> + /* Temperature sensor */
> + channel@11 {
> + reg = <11>;
> + };
> + };
> + };
> +...
> --
> 2.39.5
>

Attachment: signature.asc
Description: PGP signature