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: <a5472be7-26c6-486b-834c-2a5f6bfaf982@baylibre.com>
Date: Sat, 7 Sep 2024 09:09:46 -0500
From: David Lechner <dlechner@...libre.com>
To: Alexandru Ardelean <aardelean@...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 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".

> 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