Bug 5749

Summary: Generic hotkey support
Product: Drivers Reporter: Luming Yu (luming.yu)
Component: PlatformAssignee: Luming Yu (luming.yu)
Status: CLOSED CODE_FIX    
Severity: normal CC: acpi-bugzilla, ismail, stefan.seyfried, thoenig
Priority: P2    
Hardware: i386   
OS: Linux   
Kernel Version: 2.6.14 Subsystem:
Regression: --- Bisected commit-id:
Attachments: acpi hotkey enhancement -pach-1
acpi hotkey enhancement -pach-2
sony hotkey support: SNY5001
Panasonic hotkey support : MAT0019
Asus hotkey support: ATK0100
acpi hotkey enhancement patch against latest acpi-test git tree
hotkey sysfs support
Luming's generic hotkey patch against 2.6.14.7
backlight sysfs support for acpi video driver
backlight sysfs support for acpi video driver
[patch 1/3] vidoe sysfs support: Add dev argument for baclight sys dev
[patch 2/3] Add display output class support
[patch 3/3] backlight and output sysfs support for acpi video driver

Description Luming Yu 2005-12-16 00:49:32 UTC
There are several brands of Lapotp have dedicated acpi device objects.

For example:
ASUS: _HID "ATK0100"
Panasonic: _HID "MAT0019"
Sony: _HID "SNY5001"
Fujitsu Lifebook: "Fuj02B1"

And most of them have dedicated AML method for hot-keys.
So, the existing hotkey.c in 2.6.14 need to be expand to support them in a
generic way.
Comment 1 Luming Yu 2005-12-16 00:53:00 UTC
Created attachment 6839 [details]
acpi hotkey enhancement -pach-1
Comment 2 Luming Yu 2005-12-16 00:54:16 UTC
Created attachment 6840 [details]
acpi hotkey enhancement -pach-2
Comment 3 Luming Yu 2005-12-16 00:56:50 UTC
Created attachment 6841 [details]
sony hotkey support:  SNY5001
Comment 4 Luming Yu 2005-12-16 00:58:45 UTC
Created attachment 6842 [details]
Panasonic hotkey support : MAT0019
Comment 5 Luming Yu 2005-12-16 01:00:29 UTC
Created attachment 6843 [details]
Asus hotkey support:  ATK0100
Comment 6 Luming Yu 2005-12-16 01:06:02 UTC
*** Bug 5502 has been marked as a duplicate of this bug. ***
Comment 7 Luming Yu 2005-12-16 01:07:08 UTC
*** Bug 4195 has been marked as a duplicate of this bug. ***
Comment 8 Luming Yu 2005-12-16 01:10:02 UTC
*** Bug 4876 has been marked as a duplicate of this bug. ***
Comment 9 Luming Yu 2006-01-18 00:07:16 UTC
Created attachment 7060 [details]
acpi hotkey enhancement patch against latest acpi-test git tree

1. Enhance generic hotkey driver with a more flexible configure interface to
support sony,panasonic and asus Laptop.
2. Add configrue data for asus:"ATK010", panasonic:"MAT0019", Sony:"SNY5001"
and Fujitsu: "FUJ02B1"
3. Add brightness configure data for asus, panasonic, sony, and fujitsu laptops
with these well-known PNP IDs and Method names.
-----------------
 Makefile |    2
 hotkey.c |  539
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 scan.c   |    2
 3 files changed, 527 insertions(+), 16 deletions(-)
----------------
Signed-off-by Luming Yu<luming.yu@intel.com>

I got some config Data about ASUS laptop from asus_acpi.c written by 
"Karol Kozimor" <sziwan@hell.org.pl>

I copy some config Data about Sony laptop from sony acpi driver written by 
Stelian Pop <stelian@popies.net>,

I copy some config Data and package handling code about Panasonic laptop from
panasonic acpi driver written by Timo Hoenig <thoenig@suse.de>
Comment 10 Luming Yu 2006-01-18 00:09:40 UTC
Created attachment 7061 [details]
hotkey sysfs support

hotkey sysfs support
Comment 11 Luming Yu 2006-01-18 00:12:20 UTC
Please apply patch filed at comment#9 and comment#10 sequentially.

Comment 12 Jayakumar 2006-03-12 22:50:20 UTC
Adding link to the discussion about Atlas ACPI and it's hotkey/LCD brightness
issue (although it's not a laptop) to this bug. 

http://marc.theaimsgroup.com/?l=linux-acpi&m=114050385107273&w=2

Comment 13 Jayakumar 2006-03-13 18:58:03 UTC
Created attachment 7573 [details]
Luming's generic hotkey patch against 2.6.14.7

I applied Luming's patches for generic hotkey support. I've attached the diff
that I got for a tree with those patches applied versus a tree with vanilla
2.6.14.7. This is the patch that needs to be applied before applying the Atlas
diff as posted here http://lkml.org/lkml/2006/3/13/410/index.html
Comment 14 Len Brown 2006-07-26 19:26:02 UTC
RE: sysfs API
/sys/hotkey -- unclear if everything should live here,
but okay for a prototype, need to make the values generic
so a user-program can understand on every system:

This API must be available with CONFIG_ACPI=n also.
 
/sys/class/graphics/ (first guess)
   available_displays: lcd, crt, tv other...
   current_display = set to one of above

   brightness_max = # maximum on this box
   brightness_min = # minimum on this box
   brighness = # current brightness within range above
   zoom_max = # maximum zoom level
   zoom_min = # ...
   zoom= # current zoom level

/sys/class/device/sound/audio (first guess)
   volume_min = #
   volume_max = #
   volume = #
----------
Re: /proc
Every use of /proc in this driver should be #ifdef DEBUG
make DEBUG a sub-CONFIG option of CONFIG_ACPI_HOTKEY
even better, have hotkey_debug.c link in, and not even
be in the production source.

hotkeylib.c: needs to make private functions static to avoid
name space pollution.  Needs new name, or to be split up
into multiple places.
--------
Documentation/acpi-hotkey.c
delete this, nobody can understand it, and it is DEBUG only.
or at least make it clear it is for development only
and that in production use /proc is unused.
-----------
replace acpi_bus_generate_event() with input_report_key() in hotkey.c 
new use of /proc/acpi/event should not be added with this driver.
linux/input.h has the scancodes to use.
Comment 15 Len Brown 2006-07-26 20:33:00 UTC
Looks like there is generic backlight framework
under drivers/video/backlight/

So ACPI code that wants to display backlight properties
in sysfs should depend on CONFIG_BACKLIGHT_CLASS_DEVICE
and use the sysfs API already defined by backlight.c
brightness, max_brightness etc.
Comment 16 Luming Yu 2006-08-16 07:39:21 UTC
Created attachment 8800 [details]
backlight sysfs support for acpi video driver
Comment 17 Luming Yu 2006-08-16 07:43:27 UTC
Created attachment 8801 [details]
backlight sysfs support for acpi video driver
Comment 18 Luming Yu 2006-10-16 10:14:18 UTC
Created attachment 9265 [details]
[patch 1/3] vidoe sysfs support: Add dev argument for baclight sys dev
Comment 19 Luming Yu 2006-10-16 10:16:23 UTC
Created attachment 9266 [details]
[patch 2/3] Add display output class support
Comment 20 Luming Yu 2006-10-16 10:17:52 UTC
Created attachment 9267 [details]
[patch 3/3] backlight and output sysfs support for acpi video driver
Comment 21 Len Brown 2007-08-19 00:00:38 UTC
Luming,
Are any of these patches still interesting post 2.6.22?
Comment 22 Fu Michael 2007-10-10 00:47:28 UTC
resolve this bug.
Comment 23 Len Brown 2008-01-10 19:57:23 UTC
the backlight class code shipped in 2.6.21
closed.