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] [day] [month] [year] [list]
Message-ID: <CA+GgBR9BWcLJ=stqT0F8n2mC=6C0y9ia2W7HFOfkX+0WM82_wA@mail.gmail.com>
Date: Sat, 7 Sep 2024 20:57:46 +0300
From: Alexandru Ardelean <aardelean@...libre.com>
To: David Lechner <dlechner@...libre.com>
Cc: linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org, 
	devicetree@...r.kernel.org, jic23@...nel.org, krzk+dt@...nel.org, 
	robh@...nel.org, lars@...afoo.de, michael.hennerich@...log.com, 
	gstols@...libre.com
Subject: Re: [PATCH v4 7/8] dt-bindings: iio: adc: add docs for
 AD7606C-{16,18} parts

On Sat, Sep 7, 2024 at 5:09 PM David Lechner <dlechner@...libre.com> wrote:
>
> On 9/6/24 11:59 PM, Alexandru Ardelean wrote:
> > On Fri, Sep 6, 2024 at 12:54 AM David Lechner <dlechner@...libre.com> wrote:
> >>
> >> On 9/5/24 3:24 AM, Alexandru Ardelean wrote:
>
> ...
>
> >>> +patternProperties:
> >>> +  "^channel@[1-8]$":
> >>> +    type: object
> >>> +    $ref: adc.yaml
> >>> +    unevaluatedProperties: false
> >>> +
> >>> +    properties:
> >>> +      reg:
> >>> +        description:
> >>> +          The channel number, as specified in the datasheet (from 1 to 8).
> >>> +        minimum: 1
> >>> +        maximum: 8
> >>> +
> >>> +      diff-channels:
> >>> +        description:
> >>> +          Each channel can be configured as a differential bipolar channel.
> >>> +          The ADC uses the same positive and negative inputs for this.
> >>> +          This property must be specified as 'reg' (or the channel number) for
> >>> +          both positive and negative inputs (i.e. diff-channels = <reg reg>).
> >>> +        items:
> >>> +          minimum: 1
> >>> +          maximum: 8
> >>> +
> >>> +      bipolar:
> >>> +        description:
> >>> +          Each channel can be configured as a unipolar or bipolar single-ended.
> >>> +          When this property is not specified, it's unipolar, so the ADC will
> >>> +          have only the positive input wired.
> >>> +          For this ADC the 'diff-channels' & 'bipolar' properties are mutually
> >>> +          exclusive.
> >>> +
> >>> +    required:
> >>> +      - reg
> >>> +
> >>> +    oneOf:
> >>> +      - required:
> >>> +          - diff-channels
> >>> +      - required:
> >>> +          - bipolar
> >>
> >> The datasheet (ad7606c-18.pdf) lists the following combinations:
> >>
> >> * Bipolar single-ended
> >> * Unipolar single-ended
> >> * Bipolar differential
> >>
> >> The logic in the oneOf: doesn't match this.
> >>
> >> This I think this would be sufficient:
> >>
> >> - if:
> >>     required: [diff-channels]
> >>   then:
> >>     required: [bipolar]
> >
> > So here, I am a bit vague.
> > This makes 'bipolar' mandatory if 'diff-channels' is mandatory, right?
> > But then 'bipolar' (on its own) becomes optional?
> > The way I understood the oneOf case is that:
> > 1. if it's 'diff-channels' then it's specified 'bipolar differential'.
>
> diff-channels does not imply bipolar in DT, so we need both properties
> set to specify "bipolar differential".
>

ack
will update then

> > 2. if it's 'bipolar' then it's specified as 'bipolar single-ended'
> > 3. otherwise it's unipolar
> > 4. oneOf enforces that at least 'diff-channels' or 'bipolar' is
> > specified if there is a channel node
> >
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ