linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: joeyli <jlee@suse.com>
To: Corentin Chary <corentin.chary@gmail.com>
Cc: platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Matthew Garrett <mjg@redhat.com>,
	linux-input@vger.kernel.org, GLin@suse.com
Subject: Re: Handling special keys in platform drivers
Date: Mon, 09 Jan 2012 15:09:15 +0800	[thread overview]
Message-ID: <1326092955.24116.131.camel@linux-s257.site> (raw)
In-Reply-To: <CAHR064jAJkQCd_Tsrx7NHe_RbaBbNcX4sMwy=zkZCZNUNo=fAw@mail.gmail.com>

Hi Corentin, 

於 一,2012-01-09 於 07:24 +0100,Corentin Chary 提到:
> Hi,
> 
> Some of the platform drivers in platform/x86/ (and probably other) are
> relaying keys to userspace and are also controlling the device
> associated to these key. A simple example is screen brightness,
> keyboard backlight or rfkill.
> 
> In this case the driver send a key to userspace, userspace has to
> handle this key and control the right device.
> 
> Most of the time, this job is done by:
> - ACPI scripts (legacy)
> - DE (gnome-power-manager, kde's solid)
> 
> The real problem is that for keyboard backlight to work, it needs DE
> cooperation, and only gnome as implemented that right now, and other
> (except KDE) will probably neither have the resources to handle all
> the possible keys correctly. And of course, who should handle the keys
> when there is no DE running at all ?
> 
> So I was wondering if we could introduce an "auto" mode for this
> drivers. For example, with this mode enabled, asus-wmi would filter
> the keys and control keyboard backlight directly (and rfkill/screen
> brightness ?).
> 
> What do you think about it ?
> 
> Thanks,
> 

For backlight, 
I think control backlight in platform driver is generally no problem,
but need careful don't keep/change brightness level if BIOS also keep a
variable reflect to brightness level.

Another question is when the "auto" mode disable? Does it possible
disable it from user space?
Currently, like rfkill-input can disabled by ioctl from user space, e.g.
urfkill daemon will disable rfkill-input by ioctl when it launched.


For rfkill,
I am not prefer allow platform driver direct control rfkill.

that might more complex because already have the follow components
involve to it when function key pressed:
	BIOS/EC (ODM backup behavior)
	rfkill-input
	wireless/bluetooth drivers
	user space daemon/applications (e.g. NetworkManager, urfkill...)

Then, will platform driver also involve to rfkill control?

We already have rfkill-input in kernel to control rfkill state, if need
more flexible policy control on rfkill key, put policy logic in user
space will be better.
e.g. User can setup rfkill policy by account.


Thanks a lot!
Joey Lee



  reply	other threads:[~2012-01-09  7:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09  6:24 Handling special keys in platform drivers Corentin Chary
2012-01-09  7:09 ` joeyli [this message]
2012-01-09  7:34   ` Corentin Chary
2012-01-13 22:42 ` Matthew Garrett
2012-01-14  8:58   ` Corentin Chary

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=1326092955.24116.131.camel@linux-s257.site \
    --to=jlee@suse.com \
    --cc=GLin@suse.com \
    --cc=corentin.chary@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /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).