[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170407115754.GA4756@amd>
Date: Fri, 7 Apr 2017 13:57:54 +0200
From: Pavel Machek <pavel@....cz>
To: Felix Brack <fb@...c.ch>
Cc: Jacek Anaszewski <jacek.anaszewski@...il.com>, rpurdie@...ys.net,
mark.rutland@....com, riku.voipio@....fi,
linux-leds@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linus.walleij@...aro.org,
robh@...nel.org
Subject: default-state LED property (was Re: [PATCH v2] Extend pca9532 device
tree support)
Hi!
> >> This seems to look for "pwm0" and "pwm1" strings, which do not seem to
> >> be documented.
> >>
> >> Plus... is it useful to have default-state? We already have default
> >> trigger. If we keep the value by default (on PC, we do something like
> >> that) this patch should not be neccessary?
> >
> > Thanks for the heads-up. Dropping the patch for now.
>
> No, please do not drop the patch.
>
> > I guess that pwm0/1 got propagated to v2 by an omission.
>
> Yes, I agree. However the two strings do not break anything and behave
> analog to the 'on' or 'keep' string. Though this code could be removed
> if absolutely necessary. An alternative would be to add a description
> for the strings. Just to be clear: these strings have nothing to with
> the exposition of device specific registers to the DT.
Well, they should be removed. No need to keep surprises in code.
> > Regarding default-on: Felix, do you have any use case that require
> > default-on set to "keep"?
>
> This patch is not about 'default-on' which is a value that could be
> assigned to the property 'linux,default-trigger' (according to DT
> bindings documentation file 'common.txt').
> My patch does not introduce anything new with the'keep' state, it rather
> completes the existing bindings according to the description in
> Documentation/devicetree/bindings/leds/common.txt which states:
Hmm, that was introduce by 1d1a77ddc8acfa3d506f1958e09a12085e71fc69
. I don't quite like the patch -- it duplicates default-trigger
functionality without good reason.
IMO we should
1) keep the led state by default
2) deprecate the default-state property
3) use default-triggers to emulate the functionality if someone really
needs it.
> One of my use cases is to turn a LED on by U-Boot. This LED must remain
> on until eventually, under certain conditions, some userland code
> changes it's state.
> Setting 'default-state' to 'keep' is how you can sort of tell the
> kernel, or better the driver, 'not to initialize the LED' which would
> turn it off.
Yes, that's reasonable. Perhaps 'keep' should be the default.
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists