[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdYQvqB7FzfQ4Yf2m-QFz_6inEFvMs_NjJmRg3BeA-O6Wg@mail.gmail.com>
Date: Mon, 11 Jul 2022 14:21:07 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Pali Rohár <pali@...nel.org>
Cc: Rob Herring <robh@...nel.org>, Pavel Machek <pavel@....cz>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Marek Behún <kabel@...nel.org>,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: leds: register-bit-led: Add value property
On Mon, Jul 11, 2022 at 2:10 PM Pali Rohár <pali@...nel.org> wrote:
> On Monday 11 July 2022 14:06:50 Linus Walleij wrote:
> > On Wed, Jul 6, 2022 at 6:23 PM Pali Rohár <pali@...nel.org> wrote:
> > > On Wednesday 06 July 2022 10:21:11 Rob Herring wrote:
> > > > On Wed, Jul 06, 2022 at 01:28:27PM +0200, Pali Rohár wrote:
> > > > > Allow to define inverted logic (0 - enable LED, 1 - disable LED) via value
> > > > > property. This property name is already used by other syscon drivers, e.g.
> > > > > syscon-reboot.
> > > >
> > > > Yes, but those are potentially multi-bit values. This is a single bit
> > > > value, and the only value that's ever needed is 0. Why not just use
> > > > 'active-low' here?
> > >
> > > Just because to have uniform definitions across more syscon nodes.
> >
> > But what happens if he mask and value don't line up?
> >
> > mask = 0x10;
> > value = 0x08;
>
> Same what would happen in other drivers, no?
>
> Only those value bits are take into account which are also sets in the mask.
Two wrongs does not make one right. I.e. just because this bad
pattern is used in other syscon drivers we do not need to repeat their
mistakes. Also, in this case we can only specify one bit due to the
way the enum is designed, other drivers may specify multiple bits.
This also becomes a bit confusing:
+ enum:
+ [ 0x0,
What you do is add 0 at the beginning of the enum but that represent
a low bit of any from 0-31. I just get confused, active-low is crystal clear.
Yours,
Linus Walleij
Powered by blists - more mailing lists