aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc/wistron_btns.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-05-19Input: wistron_btns - switch to using kmemdup()Julia Lawall1-2/+2
Use kmemdup when some other buffer is immediately copied into the allocated region. Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2009-12-29Input: wistron - fix test for CONFIG_PMRakib Mullick1-1/+1
This should fix the following compile warning: drivers/input/misc/wistron_btns.c:1331:5: warning: "CONFIG_PM" is not defined Signed-off-by: Rakib Mullick <rakib.mullick@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-07Input: wistron_btns - switch to using sparse keymap libraryDmitry Torokhov1-134/+44
The keymap manipulation code was split into a library module, so let's make us of it. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-12-04Input: wistron - remove identification strings from DMI tableDmitry Torokhov1-38/+38
The driver does not reference identification strings in DMI table and since these strings are no longer required by DMI core we can safely remove them and save some memory. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-10-18Input: add open and close methods for polled devicesSamu Onkalo1-1/+1
Optional open and close methods for preparing and closing the device. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-10-05Input: wistron_btns - add DMI entry for Medion WIM2030 laptopSebastian Frei1-0/+9
Signed-off-by: Sebastian Frei <dr.nop@gmx.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-09-13Input: wistron_btns - add keymap for AOpen 1557Dmitry Torokhov1-1/+17
This one does not have anything useful in DMI either so again we need to use: force=1 keymap=aopen1557 Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-08-27Merge commit 'v2.6.31-rc8' into nextDmitry Torokhov1-0/+16
2009-08-08Input: wistron_btns - switch to using dev_pm_opsDmitry Torokhov1-29/+37
Also start using 'bool' where it makes sense. Tested-by: Giuseppe Mazzotta <g.mazzotta@iragan.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-08-05Input: wistron_btns - support Prestigio Wifi RF kill buttonTJ1-0/+16
The Prestigio 157, an old no-name clone laptop uses input keys very similar to the Wistron 1557/MS2141 with the addition of BIOS-controlled wireless radio frequency kill switch. This patch adds support for the RF kill switch control and adds manual identification of the model. The Prestigio does not expose any recognisable identity via dmidecode and so requires manual selection at module init using force=1 keymap=prestigio Signed-off-by: TJ <ubuntu@tjworld.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2009-07-12Input: wistron_btns - recognize Maxdata Pro 7000 notebooksGiuseppe Mazzotta1-0/+9
This patch adds DMI information to automatically load the correct layout for the Maxdata Pro 7000X/DX notebook models. Such notebooks are clones of Fujitsu Amilo V2000, the hook for the v2000 is being used and I have tested that perfectly works. The immediate result of integrating this patch is that the five special buttons will work on these specific notebook models and that the RF killswitch will not be activated after suspend. This patch definitively obsoletes the fsam7400 module which I was still needing to enable wifi and to fix the RF killswitch suspend problem; in the current 2.6.30 kernel it is necessary to load the wistron_btns module with options 'force=1 keymap=1557/MS2141', which was not anyway a complete workaround. Signed-off-by: Giuseppe Mazzotta <g.mazzotta@iragan.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-08-08Input: wistron - add support for Fujitsu-Siemens Amilo Pro v3505Remi Herilier1-0/+19
Wistron button support for Fujitsu-Siemens Amilo Pro Edition V3505. Signed-off-by: Remi Herilier <rherilier@yahoo.fr> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2008-06-30Input: wistron - generate normal key event if bluetooth or wifi not presentÉric Piel1-1/+18
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>
2008-02-07leds: Standardise LED naming schemeRichard Purdie1-2/+2
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>
2007-10-09drivers/firmware: const-ify DMI API and internalsJeff Garzik1-1/+1
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>
2007-07-10Input: wistron - add support for querying/changing keymapDmitry Torokhov1-34/+87
Implement getkeycode and setkeycode methods for the device so EVIOCGKEYCODE and EVIOCSKEYCODE ioctls will work. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: wistron - convert to use input-polldevDmitry Torokhov1-99/+101
Switch to using input-polldev skeleton instead of implementing polling loop by itself. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2007-07-10Input: wistron - add LED supportEric Piel1-1/+87
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>
2007-07-10Input: wriston - reduce polling frequencyEric Piel1-4/+14
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>
2007-04-29Input: wistron - fix typo in keymap for Acer TM610Eric Piel1-1/+1
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>
2007-04-12Input: wistron - declare keymaps as initdataEric Piel1-27/+49
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>
2007-04-12Input: wistron - introduce generic keymapEric Piel1-2/+40
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>
2007-04-12Input: wistron - add acerhk laptop databaseEric Piel1-72/+523
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>
2007-03-07Input: wistron - add support for TravelMate 610Eric Piel1-0/+24
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>
2007-02-10Input: wistron - add support for Fujitsu-Siemens Amilo D88x0Michael Leun1-0/+20
Tested on a Amilo D8820. Signed-off-by: Michael Leun <ml@newton.leun.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-10-11[PATCH] Use linux/io.h instead of asm/io.hMatthew Wilcox1-1/+1
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>
2006-10-01Input: wistron - add support for Acer TravelMate 2424NWXCiAshutosh Naik1-1/+10
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>
2006-10-01Input: wistron - fix setting up special buttonsReiner Herrmann1-5/+2
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>
2006-08-23Input: wistron - fix crash due to referencing __initdataDmitry Torokhov1-8/+8
Remove __initdata markings from keymaps as they are used during normal driver operations. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-07-06Input: wistron - fix section reference mismatchesAndrew Morton1-10/+10
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-06-27Input: wistron - add mapping for Wistron MS 2111Frank de Lange1-0/+19
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>
2006-05-29Input: wistron - add support for AOpen Barebook 1559asmasc@theaterzentrum.at1-0/+19
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-04-05Input: wistron - add support for Fujitsu N3510John Reed Riley1-0/+21
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-04-05Input: wistron - add signature for Amilo M7400Stefan Rompf1-0/+9
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2006-01-10Input: wistron - do not crash if BIOS does not support interfaceMiloslav Trmac1-3/+3
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>
2005-12-28Input: wistron - convert to the new platform device interfaceDmitry Torokhov1-46/+68
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>
2005-12-20Manual merge with Linus (conflict in drivers/input/misc/wistron_bnts.c)Dmitry Torokhov1-1/+1
2005-12-15[PATCH] drivers/input/misc/wistron_btns.c NULL noise removalAl Viro1-1/+1
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-12-11Input: wistron - add Acer TravelMate 240 to DMI tableAshutosh Naik1-0/+19
Signed-off-by: Ashutosh Naik <ashutosh.naik@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2005-11-20Input: wistron - disable wifi/bluetooth on suspendMiloslav Trmac1-0/+6
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>
2005-11-20Input: wistron - add PM supportDmitry Torokhov1-5/+57
Register wistron-bios as a platform device, restore WIFI and Bluetooth state upon resume. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2005-11-20Input: wistron - convert to dynamic input_dev allocationDmitry Torokhov1-16/+37
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
2005-11-20Input: wistron - add support for Acer Aspire 1500 notebooksBernhard Rosenkraenzer1-20/+59
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>
2005-11-20Input: add Wistron driverDmitry Torokhov1-0/+443
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>