lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250130162152.0000470a@huawei.com>
Date: Thu, 30 Jan 2025 16:21:52 +0000
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: David Lechner <dlechner@...libre.com>
CC: Jonathan Santos <Jonathan.Santos@...log.com>, <linux-iio@...r.kernel.org>,
	<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<lars@...afoo.de>, <Michael.Hennerich@...log.com>,
	<marcelo.schmitt@...log.com>, <jic23@...nel.org>, <robh@...nel.org>,
	<krzk+dt@...nel.org>, <conor+dt@...nel.org>, <jonath4nns@...il.com>,
	<marcelo.schmitt1@...il.com>
Subject: Re: [PATCH v2 04/16] dt-bindings: iio: adc: ad7768-1: add VMC
 output property

On Mon, 27 Jan 2025 19:28:10 -0600
David Lechner <dlechner@...libre.com> wrote:

> 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@...log.com>
> > ---
> > 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 need to represent the analog front end (likely we do as will affect scaling
etc) then regulator makes sense.  That front end will need a driver. Perhaps
an extension of drivers/iio/afe/iio-rescale.c

> 
> 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 */  
> 
> 
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ