From: Nick Crews <ncrews@chromium.org>
To: Pavel Machek <pavel@ucw.cz>
Cc: Dmitry Torokhov <dtor@chromium.org>,
Enric Balletbo i Serra <enric.balletbo@collabora.com>,
Benson Leung <bleung@chromium.org>,
linux-leds@vger.kernel.org, jacek.anaszewski@gmail.com,
lkml <linux-kernel@vger.kernel.org>,
Duncan Laurie <dlaurie@chromium.org>,
Daniel Erat <derat@google.com>, Guenter Roeck <groeck@google.com>
Subject: Re: [PATCH] platform/chrome: Add Wilco EC keyboard backlight LEDs support
Date: Tue, 12 Mar 2019 10:05:38 -0600 [thread overview]
Message-ID: <CAHX4x85Ve+AHvcO1dPN9x6P3X8RV=rSzoWbYp=S-OeDnjGmOaQ@mail.gmail.com> (raw)
In-Reply-To: <20190308221307.GB16125@amd>
> > > Some Wilco devices do not support a keyboard backlight. This
> > > is checked in probe(), and in this case the sysfs entry will
> > > not appear, and everything will behave normally.
> >
> > It would be even better if we did not register platform device if EC
> > does not support backlight.
Good point Dmitry. I would imagine this would entail exposing the
keyboard_leds_exist() function. What is the best practice for doing that?
I could either imagine EXPORT_SYMBOL_GPL()ing that function, but
that would require making the core driver dependent upon this keyboard
backlight driver in a circular dependency, so there would have to be some
refactoring. The other option I see would be to add this entire driver to
the core module.
Just so I learn something, I don't see performance or stability
concerns with adding one unused platform device, is your rationale
that it would just be cleaner code?
> >
> > > + data->led.brightness_set = keyboard_led_set_brightness;
> > > + data->led.brightness_get = keyboard_led_get_brightness;
> >
> > wilco_ec_mailbox() may sleep, so you need to assign it to
> > led.brightness_set_blocking.
Yes, thanks for the catch.
>
> Hmm. Seeing get method there... can the EC change the brightness
> without command from kernel?
No, the EC will never do that, good point. Therefore it looks like
I can just remove the get_brightness() function and the core
library will do the right thing.
Thanks,
Nick
prev parent reply other threads:[~2019-03-12 16:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 20:38 [PATCH] platform/chrome: Add Wilco EC keyboard backlight LEDs support Nick Crews
2019-03-08 21:08 ` Pavel Machek
2019-03-11 15:29 ` Nick Crews
2019-04-04 11:24 ` Pavel Machek
2019-04-04 14:11 ` Nick Crews
2019-04-04 16:13 ` Dmitry Torokhov
2019-04-04 19:03 ` Pavel Machek
2019-04-04 19:09 ` Dmitry Torokhov
2019-04-04 19:23 ` Pavel Machek
2019-04-04 20:07 ` Dmitry Torokhov
2019-04-04 20:11 ` Pavel Machek
2019-04-04 20:22 ` Dmitry Torokhov
2019-04-04 20:34 ` Pavel Machek
2019-03-08 22:01 ` Dmitry Torokhov
2019-03-08 22:13 ` Pavel Machek
[not found] ` <CAHX4x84pgHeseVphBUq0HLJ70KU-Fz1TQtaq1=iz=mFCDZuJkw@mail.gmail.com>
2019-03-11 21:52 ` Pavel Machek
2019-03-12 16:05 ` Nick Crews [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHX4x85Ve+AHvcO1dPN9x6P3X8RV=rSzoWbYp=S-OeDnjGmOaQ@mail.gmail.com' \
--to=ncrews@chromium.org \
--cc=bleung@chromium.org \
--cc=derat@google.com \
--cc=dlaurie@chromium.org \
--cc=dtor@chromium.org \
--cc=enric.balletbo@collabora.com \
--cc=groeck@google.com \
--cc=jacek.anaszewski@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).