On Thu, Sep 5, 2024 at 9:39 AM Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote: > > On Wed, Sep 04, 2024 at 10:27:15AM +0300, Alexandru Ardelean wrote: > > @@ -114,6 +124,45 @@ properties: > > assumed that the pins are hardwired to VDD. > > type: boolean > > > > +patternProperties: > > + "^channel@([1-8])$": > > Drop () > > > + 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. > > + > > + oneOf: > > + - required: > > + - reg > > + - diff-channels > > + - required: > > + - reg > > + - bipolar > > rather: > > required: > - reg > > oneOf: > - required: > - diff-channels > - required: > - bipolar Ack > > > + > > required: > > - compatible > > - reg > > @@ -170,6 +219,17 @@ allOf: > > adi,conversion-start-gpios: > > maxItems: 1 > > > > + - if: > > + not: > > + properties: > > + compatible: > > + enum: > > + - adi,ad7606c-16 > > + - adi,ad7606c-18 > > + then: > > + patternProperties: > > + "^channel@[1-8]+$": false > > > You have two different patterns here and in top-level. Please keep one: > ^channel@[1-8]$ Ah. Good point. > > > Best regards, > Krzysztof >