If the subsystem is not present, instead of not doing anything, report
the key press as a normal key. This is done by modifying at
initialization the copied key entry table.
Signed-off-by: Eric Piel <Eric.Piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
As discussed on LKML some notion of 'function' is needed in
LED naming. This patch adds this to the documentation and
standardises existing LED drivers.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Three main sets of changes:
1) dmi_get_system_info() return value should have been marked const,
since callers should not be changing that data.
2) const-ify DMI internals, since DMI firmware tables should,
whenever possible, be marked const to ensure we never ever write to
that data area.
3) const-ify DMI API, to enable marking tables const where possible
in low-level drivers.
And if we're really lucky, this might enable some additional
optimizations on the part of the compiler.
The bulk of the changes are #2 and #3, which are interrelated. #1 could
have been a separate patch, but it was so small compared to the others,
it was easier to roll it into this changeset.
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Implement getkeycode and setkeycode methods for the device so
EVIOCGKEYCODE and EVIOCSKEYCODE ioctls will work.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add support to wistron_btns for leds that come with the multimedia keys.
Mail and wifi leds are supported, on laptops which have them.
Depending on the laptop, wifi subsystem may control just the led, or both
the led and the wifi card. Wifi led interface is activated only for the
former type of laptops, as the latter type is already managed. Leds are
controled by the interface in /sys/class/leds.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Reduces the polling frequency from 10 Hz to 2 Hz, which should be less a burden
for laptops wrt energy saving. As it is multimedia keys, 500ms (maximum) of
latency should be still fine for the user. In order to keep fluent the feeling
when the user is pressing several keys in a raw (such as changing the volume),
the frequency is increased for a short duration after a key is pressed.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch fixes typo that prevented PROG2 key from working
on Acer Travelmate 610.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
As the number of keymaps increases and is very unlikely to
reduce, this patch helps to reduce memory consumption by
declaring all keymaps as __initdata and copying right keymap
during DMI detection. On x86 this make the module size at
runtime going from 10616 to 9428: a bit more than 1kb saved.
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
It turns out that the keymaps in the wistron driver are almost the
same, the main difference being some keys which may not exist and
leds which might not be present. Therefore it's possible to write
a generic keymap which would allow the use of an unknown keyboard
with little drawbacks. The user can select it specifying the parameter
"keymap=generic".
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acerhk supports already a lot of laptops. Lets import its database so
that everyone can benefit of the work of Olaf Tauber. Only the "tm_new"
laptops were imported. "tm_old" laptops could be possible but requires
more testing and probably only few laptops are still alive. "dritek"
laptops should probably be imported into a different driver. Also compress
the keymaps by fitting each entry on an int. Most of the dmi matching was
written based on google searches, so it's rather prone to errors. That's
why I'm asking people to confirm it works.
Support to generate switch input events was added as some laptops indicate
lid open/close through this interface.
This adds the following hardware:
Acer TravelMate 370
Acer TravelMate 380
Acer TravelMate C300
Acer TravelMate C100
Acer TravelMate C110
Acer TravelMate 250
Acer TravelMate 350
Acer TravelMate 620
Acer TravelMate 630
Acer TravelMate 220
Acer TravelMate 230
Acer TravelMate 260
Acer TravelMate 280
Acer TravelMate 360
Acer TravelMate 2100
Acer TravelMate 2410
Acer Aspire 1500
Acer Aspire 1600
Acer Aspire 3020
Acer Aspire 5020
Medion MD 2900
Medion MD 40100
Medion MD 95400
Medion MD 96500
Fujitsu Siemens Amilo 7820
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add support for Acer TravelMate 610 to wistron_btns. All special keys
are detected, but the 2 leds are not handled (yet).
Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
In preparation for moving check_signature, change these users from asm/io.h
to linux/io.h
Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The key mappings are the same as the older Acer TravelMate 240.
Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
If either wifi or bluetooth button has been detected, the code
would break off the loop. But there are laptops that have both
types of buttons, so the loop has to continue checking.
Signed-off-by: Reiner Herrmann <reiner@reiner-h.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Wistron MS 2111 (aka Medion 'Titanium' MD 9783, aka ALDI PC,
aka Fujitsu-Siemens AMILO D7800, aka ...) has 5 extra buttons,
map them. Unfortunately we only have DMI data for the Medion
box.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
offset can never be < 0 because it has type size_t. The driver
currently oopses on insmod if BIOS does not support the interface,
instead of refusing to load.
Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Do not use platform_device_register_simple() as it is going away,
implement ->probe() and ->remove() functions so manual binding and
unbinding would work.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Try to save battery power by disabling wifi and bluetooth on suspend.
Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Also fix a potential issue with some notebooks:
The current code assumes the response to bios_wifi_get_default_setting is
either 1 (disabled) or 3 (enabled), or wifi isn't supported. The BIOS
response appears to be a bit field w/ 0x1 indicating hardware presence, 0x2
indicating actiation status, and the other 6 bits being unknown/reserved --
with the patch, these 6 bits are ignored.
Signed-off-by: Bernhard Rosenkraenzer <bero@arklinux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
A driver for laptop buttons using an x86 BIOS interface that is
apparently used on quite a few laptops and seems to be originating
from Wistron.
This driver currently "knows" only about Fujitsu-Siemens Amilo Pro V2000
(i.e. it can detect the laptop using DMI and it contains the
keycode->key meaning mapping for this laptop) and Xeron SonicPro X 155G
(probably can't be reliably autodetected, requires a module parameter),
adding other laptops should be easy.
In addition to reporting button presses to the input layer the driver
also allows enabling/disabling the embedded wireless NIC (using the
"Wifi" button); this is done using the same BIOS interface, so it seems
only logical to keep the implementation together. Any flexibility
possibly gained by allowing users to remap the function of the "Wifi"
button is IMHO not worth it when weighted against the necessity to run
an user-space daemon to convert button presses to wifi state changes.
Signed-off-by: Miloslav Trmac <mitr@volny.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>