Re: [PATCH v3 2/5] dt-bindings: hwmon: Add possible new properties to max31827 bindings

From: Conor Dooley
Date: Fri Sep 15 2023 - 11:59:06 EST


On Fri, Sep 15, 2023 at 03:31:13PM +0000, Matyas, Daniel wrote:
> > -----Original Message-----
> > From: Conor Dooley <conor@xxxxxxxxxx>
> > On Thu, Sep 14, 2023 at 10:59:45AM +0300, Daniel Matyas wrote:

> > > + adi,alrm-pol:
> >
> > Characters are not at a premium, is there a reason not to use the full
> > words? "flt-q" in particular would be quite cryptic if I saw it in a dts.
> >
> > > + description:
> > > + Sets the alarms active state.
> > > + - 0 = active low
> > > + - 1 = active high
> > > + For max31827 and max31828 the default alarm polarity is low. For
> > max31829
> > > + it is high.
> >
> > This constraint can be expressed in the binding, rather than in free form
> > text like done here. Ditto below.

> Ok, but how? The default values are different depending on the compatible string. I searched for similar examples, but I found nothing...
>
> Some bindings use 'default: ' to declare the default values, but this is the default for every chip.

Something like
allOf:
- if:
properties:
compatible:
contains:
const: adi,max31829
then:
properties:
adi,alrm-pol:
default: 1
else:
properties:
adi,alrm-pol:
default: 0

Cheers,
Conor.

Attachment: signature.asc
Description: PGP signature