Re: [PATCH v2 04/16] dt-bindings: iio: adc: ad7768-1: add VMC output property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/27/25 9:12 AM, Jonathan Santos wrote:
> The AD7768-1 provides a buffered common-mode voltage output
> on the VCM pin that can be used to bias analog input signals.
> 
> Add adi,vcm-output to enable the configuration of the VCM output
> circuit.
> 
> Signed-off-by: Jonathan Santos <Jonathan.Santos@xxxxxxxxxx>
> ---
> v2 Changes:
> * New patch in v2.
> ---
>  .../bindings/iio/adc/adi,ad7768-1.yaml           | 10 ++++++++++
>  include/dt-bindings/iio/adc/adi,ad7768-1.h       | 16 ++++++++++++++++
>  2 files changed, 26 insertions(+)
>  create mode 100644 include/dt-bindings/iio/adc/adi,ad7768-1.h
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
> index da05c8448530..e26513a9469b 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
> @@ -59,6 +59,15 @@ properties:
>        In the absence of this property, Synchronization over SPI will be
>        enabled.
>  
> +  adi,vcm-output:
> +    description: |
> +      Configures the Common-Mode Voltage Output. The VCM is provided by an
> +      amplifier external to the AD7768-1 and can be used as common-mode voltage
> +      by the ADC. There are 8 output voltage options available, and the macros
> +      for these values can be found at dt-bindings/iio/adi,ad7768-1.h
> +    items:
> +        enum: [0, 1, 2, 3, 4, 5, 6, 7]
> +

I was expecting this to use regulator provider bindings rather than using a
custom property. Then the regulator consumer could request the voltage that
they need. But maybe that is more complicated than what is practical.

If we don't need regulator bindings, then this should be vcm-microvolt to use
standard units [1].

[1]: https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml

>    reset-gpios:
>      maxItems: 1
>  
> @@ -132,6 +141,7 @@ examples:
>              gpio-controller;
>              #gpio-cells = <2>;
>              vref-supply = <&adc_vref>;
> +            adi,vcm-output = <AD7768_VCM_OUTPUT_AVDD1_AVSS_2>;
>              interrupts = <25 IRQ_TYPE_EDGE_RISING>;
>              interrupt-parent = <&gpio>;
>              adi,sync-in-gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
> diff --git a/include/dt-bindings/iio/adc/adi,ad7768-1.h b/include/dt-bindings/iio/adc/adi,ad7768-1.h
> new file mode 100644
> index 000000000000..469ea724c0d5
> --- /dev/null
> +++ b/include/dt-bindings/iio/adc/adi,ad7768-1.h
> @@ -0,0 +1,16 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +
> +#ifndef _DT_BINDINGS_ADI_AD7768_1_H
> +#define _DT_BINDINGS_ADI_AD7768_1_H
> +
> +/* Sets VCM output to (AVDD1 − AVSS)/2 */
> +#define AD7768_VCM_OUTPUT_AVDD1_AVSS_2	0x00
> +#define AD7768_VCM_OUTPUT_2_5V		0x01
> +#define AD7768_VCM_OUTPUT_2_05V		0x02
> +#define AD7768_VCM_OUTPUT_1_9V		0x03
> +#define AD7768_VCM_OUTPUT_1_65V		0x04
> +#define AD7768_VCM_OUTPUT_1_1V		0x05
> +#define AD7768_VCM_OUTPUT_0_9V		0x06
> +#define AD7768_VCM_OUTPUT_OFF		0x07
> +
> +#endif /* _DT_BINDINGS_ADI_AD7768_1_H */





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux