2005-11-20 05:50:06 +00:00
|
|
|
/*
|
|
|
|
* Wistron laptop button driver
|
|
|
|
* Copyright (C) 2005 Miloslav Trmac <mitr@volny.cz>
|
2005-11-20 05:50:37 +00:00
|
|
|
* Copyright (C) 2005 Bernhard Rosenkraenzer <bero@arklinux.org>
|
2005-11-20 05:50:58 +00:00
|
|
|
* Copyright (C) 2005 Dmitry Torokhov <dtor@mail.ru>
|
2005-11-20 05:50:06 +00:00
|
|
|
*
|
|
|
|
* You can redistribute and/or modify this program under the terms of the
|
|
|
|
* GNU General Public License version 2 as published by the Free Software
|
|
|
|
* Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
|
|
|
* Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
2006-10-11 08:22:01 +00:00
|
|
|
#include <linux/io.h>
|
2005-11-20 05:50:06 +00:00
|
|
|
#include <linux/dmi.h>
|
|
|
|
#include <linux/init.h>
|
2007-05-23 03:48:39 +00:00
|
|
|
#include <linux/input-polldev.h>
|
2009-12-04 18:22:24 +00:00
|
|
|
#include <linux/input/sparse-keymap.h>
|
2005-11-20 05:50:06 +00:00
|
|
|
#include <linux/interrupt.h>
|
2007-05-21 04:46:22 +00:00
|
|
|
#include <linux/jiffies.h>
|
2005-11-20 05:50:06 +00:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/mc146818rtc.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/preempt.h>
|
|
|
|
#include <linux/string.h>
|
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
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>
2010-03-24 08:04:11 +00:00
|
|
|
#include <linux/slab.h>
|
2005-11-20 05:50:06 +00:00
|
|
|
#include <linux/types.h>
|
2005-11-20 05:50:58 +00:00
|
|
|
#include <linux/platform_device.h>
|
2007-05-21 04:46:31 +00:00
|
|
|
#include <linux/leds.h>
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
/* How often we poll keys - msecs */
|
|
|
|
#define POLL_INTERVAL_DEFAULT 500 /* when idle */
|
|
|
|
#define POLL_INTERVAL_BURST 100 /* when a key was recently pressed */
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2005-11-20 05:50:37 +00:00
|
|
|
/* BIOS subsystem IDs */
|
|
|
|
#define WIFI 0x35
|
|
|
|
#define BLUETOOTH 0x34
|
2007-05-21 04:46:31 +00:00
|
|
|
#define MAIL_LED 0x31
|
2005-11-20 05:50:37 +00:00
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
MODULE_AUTHOR("Miloslav Trmac <mitr@volny.cz>");
|
|
|
|
MODULE_DESCRIPTION("Wistron laptop button driver");
|
|
|
|
MODULE_LICENSE("GPL v2");
|
2007-05-21 04:46:31 +00:00
|
|
|
MODULE_VERSION("0.3");
|
2005-11-20 05:50:06 +00:00
|
|
|
|
|
|
|
static int force; /* = 0; */
|
|
|
|
module_param(force, bool, 0);
|
|
|
|
MODULE_PARM_DESC(force, "Load even if computer is not in database");
|
|
|
|
|
|
|
|
static char *keymap_name; /* = NULL; */
|
|
|
|
module_param_named(keymap, keymap_name, charp, 0);
|
2007-04-12 05:32:41 +00:00
|
|
|
MODULE_PARM_DESC(keymap, "Keymap name, if it can't be autodetected [generic, 1557/MS2141]");
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2005-11-20 05:50:58 +00:00
|
|
|
static struct platform_device *wistron_device;
|
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
/* BIOS interface implementation */
|
|
|
|
|
|
|
|
static void __iomem *bios_entry_point; /* BIOS routine entry point */
|
|
|
|
static void __iomem *bios_code_map_base;
|
|
|
|
static void __iomem *bios_data_map_base;
|
|
|
|
|
|
|
|
static u8 cmos_address;
|
|
|
|
|
|
|
|
struct regs {
|
|
|
|
u32 eax, ebx, ecx;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void call_bios(struct regs *regs)
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
preempt_disable();
|
|
|
|
local_irq_save(flags);
|
|
|
|
asm volatile ("pushl %%ebp;"
|
|
|
|
"movl %7, %%ebp;"
|
|
|
|
"call *%6;"
|
|
|
|
"popl %%ebp"
|
|
|
|
: "=a" (regs->eax), "=b" (regs->ebx), "=c" (regs->ecx)
|
|
|
|
: "0" (regs->eax), "1" (regs->ebx), "2" (regs->ecx),
|
|
|
|
"m" (bios_entry_point), "m" (bios_data_map_base)
|
|
|
|
: "edx", "edi", "esi", "memory");
|
|
|
|
local_irq_restore(flags);
|
|
|
|
preempt_enable();
|
|
|
|
}
|
|
|
|
|
2006-01-10 06:59:07 +00:00
|
|
|
static ssize_t __init locate_wistron_bios(void __iomem *base)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
2006-07-06 04:23:38 +00:00
|
|
|
static unsigned char __initdata signature[] =
|
2005-11-20 05:50:06 +00:00
|
|
|
{ 0x42, 0x21, 0x55, 0x30 };
|
2006-01-10 06:59:07 +00:00
|
|
|
ssize_t offset;
|
2005-11-20 05:50:06 +00:00
|
|
|
|
|
|
|
for (offset = 0; offset < 0x10000; offset += 0x10) {
|
|
|
|
if (check_signature(base + offset, signature,
|
|
|
|
sizeof(signature)) != 0)
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __init map_bios(void)
|
|
|
|
{
|
|
|
|
void __iomem *base;
|
2006-01-10 06:59:07 +00:00
|
|
|
ssize_t offset;
|
2005-11-20 05:50:06 +00:00
|
|
|
u32 entry_point;
|
|
|
|
|
|
|
|
base = ioremap(0xF0000, 0x10000); /* Can't fail */
|
|
|
|
offset = locate_wistron_bios(base);
|
|
|
|
if (offset < 0) {
|
|
|
|
printk(KERN_ERR "wistron_btns: BIOS entry point not found\n");
|
|
|
|
iounmap(base);
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
|
|
|
|
entry_point = readl(base + offset + 5);
|
|
|
|
printk(KERN_DEBUG
|
|
|
|
"wistron_btns: BIOS signature found at %p, entry point %08X\n",
|
|
|
|
base + offset, entry_point);
|
|
|
|
|
|
|
|
if (entry_point >= 0xF0000) {
|
|
|
|
bios_code_map_base = base;
|
|
|
|
bios_entry_point = bios_code_map_base + (entry_point & 0xFFFF);
|
|
|
|
} else {
|
|
|
|
iounmap(base);
|
|
|
|
bios_code_map_base = ioremap(entry_point & ~0x3FFF, 0x4000);
|
|
|
|
if (bios_code_map_base == NULL) {
|
|
|
|
printk(KERN_ERR
|
|
|
|
"wistron_btns: Can't map BIOS code at %08X\n",
|
|
|
|
entry_point & ~0x3FFF);
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
bios_entry_point = bios_code_map_base + (entry_point & 0x3FFF);
|
|
|
|
}
|
|
|
|
/* The Windows driver maps 0x10000 bytes, we keep only one page... */
|
|
|
|
bios_data_map_base = ioremap(0x400, 0xc00);
|
|
|
|
if (bios_data_map_base == NULL) {
|
|
|
|
printk(KERN_ERR "wistron_btns: Can't map BIOS data\n");
|
|
|
|
goto err_code;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_code:
|
|
|
|
iounmap(bios_code_map_base);
|
|
|
|
err:
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:46 +00:00
|
|
|
static inline void unmap_bios(void)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
iounmap(bios_code_map_base);
|
|
|
|
iounmap(bios_data_map_base);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* BIOS calls */
|
|
|
|
|
|
|
|
static u16 bios_pop_queue(void)
|
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
|
|
|
regs.ebx = 0x061C;
|
|
|
|
regs.ecx = 0x0000;
|
|
|
|
call_bios(®s);
|
|
|
|
|
|
|
|
return regs.eax;
|
|
|
|
}
|
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
static void __devinit bios_attach(void)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
|
|
|
regs.ebx = 0x012E;
|
|
|
|
call_bios(®s);
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:46 +00:00
|
|
|
static void bios_detach(void)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
|
|
|
regs.ebx = 0x002E;
|
|
|
|
call_bios(®s);
|
|
|
|
}
|
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
static u8 __devinit bios_get_cmos_address(void)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
|
|
|
regs.ebx = 0x051C;
|
|
|
|
call_bios(®s);
|
|
|
|
|
|
|
|
return regs.ecx;
|
|
|
|
}
|
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
static u16 __devinit bios_get_default_setting(u8 subsys)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
2005-11-20 05:50:37 +00:00
|
|
|
regs.ebx = 0x0200 | subsys;
|
2005-11-20 05:50:06 +00:00
|
|
|
call_bios(®s);
|
|
|
|
|
|
|
|
return regs.eax;
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:37 +00:00
|
|
|
static void bios_set_state(u8 subsys, int enable)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
struct regs regs;
|
|
|
|
|
|
|
|
memset(®s, 0, sizeof (regs));
|
|
|
|
regs.eax = 0x9610;
|
2005-11-20 05:50:37 +00:00
|
|
|
regs.ebx = (enable ? 0x0100 : 0x0000) | subsys;
|
2005-11-20 05:50:06 +00:00
|
|
|
call_bios(®s);
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:37 +00:00
|
|
|
/* Hardware database */
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
#define KE_WIFI (KE_LAST + 1)
|
|
|
|
#define KE_BLUETOOTH (KE_LAST + 2)
|
2007-04-12 05:32:34 +00:00
|
|
|
|
|
|
|
#define FE_MAIL_LED 0x01
|
|
|
|
#define FE_WIFI_LED 0x02
|
|
|
|
#define FE_UNTESTED 0x80
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-06-15 03:31:45 +00:00
|
|
|
static struct key_entry *keymap; /* = NULL; Current key map */
|
2009-08-08 06:17:39 +00:00
|
|
|
static bool have_wifi;
|
|
|
|
static bool have_bluetooth;
|
|
|
|
static int leds_present; /* bitmask of leds present */
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-10-03 19:15:40 +00:00
|
|
|
static int __init dmi_matched(const struct dmi_system_id *dmi)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
const struct key_entry *key;
|
|
|
|
|
|
|
|
keymap = dmi->driver_data;
|
|
|
|
for (key = keymap; key->type != KE_END; key++) {
|
2006-10-02 01:58:51 +00:00
|
|
|
if (key->type == KE_WIFI)
|
2009-08-08 06:17:39 +00:00
|
|
|
have_wifi = true;
|
2006-10-02 01:58:51 +00:00
|
|
|
else if (key->type == KE_BLUETOOTH)
|
2009-08-08 06:17:39 +00:00
|
|
|
have_bluetooth = true;
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
2009-08-08 06:17:39 +00:00
|
|
|
leds_present = key->code & (FE_MAIL_LED | FE_WIFI_LED);
|
2007-05-21 04:46:31 +00:00
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_empty[] __initdata = {
|
2005-11-20 05:50:06 +00:00
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_fs_amilo_pro_v2000[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
2005-11-20 05:50:06 +00:00
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2008-08-08 16:13:13 +00:00
|
|
|
static struct key_entry keymap_fs_amilo_pro_v3505[] __initdata = {
|
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} }, /* Fn+F1 */
|
|
|
|
{ KE_KEY, 0x06, {KEY_DISPLAYTOGGLE} }, /* Fn+F4 */
|
|
|
|
{ KE_BLUETOOTH, 0x30 }, /* Fn+F10 */
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} }, /* mail button */
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} }, /* www button */
|
2011-03-31 01:57:33 +00:00
|
|
|
{ KE_WIFI, 0x78 }, /* satellite dish button */
|
2008-08-08 16:13:13 +00:00
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_fujitsu_n3510[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x71, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x72, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x74, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x78, {KEY_FORWARD} },
|
2006-04-05 04:40:01 +00:00
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_ms2111[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_END, FE_MAIL_LED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_md40100[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x37, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
|
2006-06-27 05:48:24 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_ms2141[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_KEY, 0x22, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x23, {KEY_FORWARD} },
|
|
|
|
{ KE_KEY, 0x24, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x25, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
2005-11-20 05:50:06 +00:00
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_aspire_1500[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x49, {KEY_CONFIG} },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_aspire_1600[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x49, {KEY_CONFIG} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* 3020 has been tested */
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_aspire_5020[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x05, {KEY_SWITCHVIDEOMODE} }, /* Display selection */
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x6a, {KEY_CONFIG} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_2410[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x6d, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x6a, {KEY_CONFIG} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_110[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x20, {KEY_VOLUMEUP} },
|
|
|
|
{ KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_SW, 0x4a, {.sw = {SW_LID, 1}} }, /* lid close */
|
|
|
|
{ KE_SW, 0x4b, {.sw = {SW_LID, 0}} }, /* lid open */
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_300[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x20, {KEY_VOLUMEUP} },
|
|
|
|
{ KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_380[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} }, /* not 370 */
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
|
|
|
/* unusual map */
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_220[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_PROG1} },
|
|
|
|
{ KE_END, FE_WIFI_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_230[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_END, FE_WIFI_LED | FE_UNTESTED }
|
2005-11-20 05:50:37 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_240[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_END, FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_350[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x14, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x15, {KEY_WWW} },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_360[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x14, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x15, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x40, {KEY_WLAN} },
|
|
|
|
{ KE_END, FE_WIFI_LED | FE_UNTESTED } /* no mail led */
|
2005-12-11 17:41:32 +00:00
|
|
|
};
|
|
|
|
|
2007-03-07 06:45:16 +00:00
|
|
|
/* Wifi subsystem only activates the led. Therefore we need to pass
|
|
|
|
* wifi event as a normal key, then userspace can really change the wifi state.
|
|
|
|
* TODO we need to export led state to userspace (wifi and mail) */
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_610[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
2007-04-30 03:41:53 +00:00
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x14, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x15, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x40, {KEY_WLAN} },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_WIFI_LED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_acer_travelmate_630[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} }, /* not 620 */
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x20, {KEY_VOLUMEUP} },
|
|
|
|
{ KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
2007-03-07 06:45:16 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_aopen_1559as[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x06, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
2006-06-27 05:48:24 +00:00
|
|
|
{ KE_END, 0 },
|
2006-05-30 03:29:36 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_fs_amilo_d88x0[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_md2900[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_END, FE_MAIL_LED | FE_UNTESTED }
|
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_md96500[] __initdata = {
|
2007-04-12 05:32:34 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x05, {KEY_SWITCHVIDEOMODE} }, /* Display selection */
|
|
|
|
{ KE_KEY, 0x06, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x20, {KEY_VOLUMEUP} },
|
|
|
|
{ KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
|
|
|
|
{ KE_KEY, 0x22, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x23, {KEY_FORWARD} },
|
|
|
|
{ KE_KEY, 0x24, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x25, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, FE_UNTESTED }
|
2007-02-10 06:29:42 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
static struct key_entry keymap_wistron_generic[] __initdata = {
|
2007-04-12 05:32:41 +00:00
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x02, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x03, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x05, {KEY_SWITCHVIDEOMODE} }, /* Display selection */
|
|
|
|
{ KE_KEY, 0x06, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
|
|
|
|
{ KE_KEY, 0x08, {KEY_MUTE} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_KEY, 0x13, {KEY_PROG3} },
|
|
|
|
{ KE_KEY, 0x14, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x15, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x20, {KEY_VOLUMEUP} },
|
|
|
|
{ KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
|
|
|
|
{ KE_KEY, 0x22, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x23, {KEY_FORWARD} },
|
|
|
|
{ KE_KEY, 0x24, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x25, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_KEY, 0x37, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
|
|
|
|
{ KE_KEY, 0x40, {KEY_WLAN} },
|
|
|
|
{ KE_KEY, 0x49, {KEY_CONFIG} },
|
|
|
|
{ KE_SW, 0x4a, {.sw = {SW_LID, 1}} }, /* lid close */
|
|
|
|
{ KE_SW, 0x4b, {.sw = {SW_LID, 0}} }, /* lid open */
|
|
|
|
{ KE_KEY, 0x6a, {KEY_CONFIG} },
|
|
|
|
{ KE_KEY, 0x6d, {KEY_POWER} },
|
|
|
|
{ KE_KEY, 0x71, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x72, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x74, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x78, {KEY_FORWARD} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_BLUETOOTH, 0x44 },
|
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2009-09-10 02:17:24 +00:00
|
|
|
static struct key_entry keymap_aopen_1557[] __initdata = {
|
|
|
|
{ KE_KEY, 0x01, {KEY_HELP} },
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
|
|
|
{ KE_WIFI, 0x30 },
|
|
|
|
{ KE_KEY, 0x22, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x23, {KEY_FORWARD} },
|
|
|
|
{ KE_KEY, 0x24, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x25, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
2009-08-03 20:39:09 +00:00
|
|
|
static struct key_entry keymap_prestigio[] __initdata = {
|
|
|
|
{ KE_KEY, 0x11, {KEY_PROG1} },
|
|
|
|
{ KE_KEY, 0x12, {KEY_PROG2} },
|
2009-09-10 02:17:24 +00:00
|
|
|
{ KE_WIFI, 0x30 },
|
2009-08-03 20:39:09 +00:00
|
|
|
{ KE_KEY, 0x22, {KEY_REWIND} },
|
|
|
|
{ KE_KEY, 0x23, {KEY_FORWARD} },
|
|
|
|
{ KE_KEY, 0x24, {KEY_PLAYPAUSE} },
|
|
|
|
{ KE_KEY, 0x25, {KEY_STOPCD} },
|
|
|
|
{ KE_KEY, 0x31, {KEY_MAIL} },
|
|
|
|
{ KE_KEY, 0x36, {KEY_WWW} },
|
|
|
|
{ KE_END, 0 }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
/*
|
|
|
|
* If your machine is not here (which is currently rather likely), please send
|
|
|
|
* a list of buttons and their key codes (reported when loading this module
|
|
|
|
* with force=1) and the output of dmidecode to $MODULE_AUTHOR.
|
|
|
|
*/
|
2009-12-04 18:24:19 +00:00
|
|
|
static const struct dmi_system_id __initconst dmi_ids[] = {
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu-Siemens Amilo Pro V2000 */
|
2005-11-20 05:50:06 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_pro_v2000
|
|
|
|
},
|
2008-08-08 16:13:13 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu-Siemens Amilo Pro Edition V3505 */
|
2008-08-08 16:13:13 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro Edition V3505"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_pro_v3505
|
|
|
|
},
|
2006-04-05 04:39:20 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu-Siemens Amilo M7400 */
|
2006-04-05 04:39:20 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M "),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_pro_v2000
|
|
|
|
},
|
2009-07-13 04:02:27 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Maxdata Pro 7000 DX */
|
2009-07-13 04:02:27 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_pro_v2000
|
|
|
|
},
|
2006-04-05 04:40:01 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu N3510 */
|
2006-04-05 04:40:01 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "N3510"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fujitsu_n3510
|
|
|
|
},
|
2005-11-20 05:50:37 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer Aspire 1500 */
|
2005-11-20 05:50:37 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_aspire_1500
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer Aspire 1600 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1600"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_aspire_1600
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer Aspire 3020 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3020"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_aspire_5020
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer Aspire 5020 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5020"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_aspire_5020
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 2100 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2100"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_aspire_5020
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 2410 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2410"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_2410
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate C300 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C300"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_300
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate C100 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C100"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_300
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate C110 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C110"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_110
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 380 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 380"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_380
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 370 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 370"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_380 /* keyboard minus 1 key */
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 220 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 220"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_220
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 260 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 260"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_220
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 230 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 230"),
|
|
|
|
/* acerhk looks for "TravelMate F4..." ?! */
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_230
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 280 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 280"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_230
|
|
|
|
},
|
2005-12-11 17:41:32 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 240 */
|
2005-12-11 17:41:32 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 240"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_240
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 250 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 250"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_240
|
|
|
|
},
|
2006-10-02 02:07:14 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 2424NWXCi */
|
2006-10-02 02:07:14 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2420"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_240
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 350 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 350"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_350
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 360 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_360
|
|
|
|
},
|
2007-03-07 06:45:16 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 610 */
|
2007-03-07 06:45:16 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 610"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_610
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 620 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 620"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_630
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Acer TravelMate 630 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 630"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_acer_travelmate_630
|
|
|
|
},
|
2006-10-02 02:07:14 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* AOpen 1559AS */
|
2006-05-30 03:29:36 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "E2U"),
|
|
|
|
DMI_MATCH(DMI_BOARD_NAME, "E2U"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_aopen_1559as
|
|
|
|
},
|
2006-06-27 05:48:24 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 9783 */
|
2006-06-27 05:48:24 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "MD 9783"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_wistron_ms2111
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 40100 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "WID2000"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_wistron_md40100
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 2900 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2000"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_wistron_md2900
|
|
|
|
},
|
2009-10-06 04:43:39 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 42200 */
|
2009-10-06 04:43:39 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2030"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_pro_v2000
|
|
|
|
},
|
2007-04-12 05:32:34 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 96500 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2040"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_wistron_md96500
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Medion MD 95400 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2050"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_wistron_md96500
|
|
|
|
},
|
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu Siemens Amilo D7820 */
|
2007-04-12 05:32:34 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), /* not sure */
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "Amilo D"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_d88x0
|
|
|
|
},
|
2007-02-10 06:29:42 +00:00
|
|
|
{
|
2009-12-04 18:24:19 +00:00
|
|
|
/* Fujitsu Siemens Amilo D88x0 */
|
2007-02-10 06:29:42 +00:00
|
|
|
.callback = dmi_matched,
|
|
|
|
.matches = {
|
|
|
|
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
|
|
|
|
DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"),
|
|
|
|
},
|
|
|
|
.driver_data = keymap_fs_amilo_d88x0
|
|
|
|
},
|
2005-12-15 09:19:05 +00:00
|
|
|
{ NULL, }
|
2005-11-20 05:50:06 +00:00
|
|
|
};
|
|
|
|
|
2007-04-12 05:32:49 +00:00
|
|
|
/* Copy the good keymap, as the original ones are free'd */
|
|
|
|
static int __init copy_keymap(void)
|
|
|
|
{
|
|
|
|
const struct key_entry *key;
|
|
|
|
struct key_entry *new_keymap;
|
|
|
|
unsigned int length = 1;
|
|
|
|
|
|
|
|
for (key = keymap; key->type != KE_END; key++)
|
|
|
|
length++;
|
|
|
|
|
2010-05-19 17:11:14 +00:00
|
|
|
new_keymap = kmemdup(keymap, length * sizeof(struct key_entry),
|
|
|
|
GFP_KERNEL);
|
2007-04-12 05:32:49 +00:00
|
|
|
if (!new_keymap)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
keymap = new_keymap;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
static int __init select_keymap(void)
|
|
|
|
{
|
2007-04-12 05:32:41 +00:00
|
|
|
dmi_check_system(dmi_ids);
|
2005-11-20 05:50:06 +00:00
|
|
|
if (keymap_name != NULL) {
|
|
|
|
if (strcmp (keymap_name, "1557/MS2141") == 0)
|
|
|
|
keymap = keymap_wistron_ms2141;
|
2009-09-10 02:17:24 +00:00
|
|
|
else if (strcmp (keymap_name, "aopen1557") == 0)
|
|
|
|
keymap = keymap_aopen_1557;
|
2009-08-03 20:39:09 +00:00
|
|
|
else if (strcmp (keymap_name, "prestigio") == 0)
|
|
|
|
keymap = keymap_prestigio;
|
2007-04-12 05:32:41 +00:00
|
|
|
else if (strcmp (keymap_name, "generic") == 0)
|
|
|
|
keymap = keymap_wistron_generic;
|
2005-11-20 05:50:06 +00:00
|
|
|
else {
|
|
|
|
printk(KERN_ERR "wistron_btns: Keymap unknown\n");
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (keymap == NULL) {
|
|
|
|
if (!force) {
|
|
|
|
printk(KERN_ERR "wistron_btns: System unknown\n");
|
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
keymap = keymap_empty;
|
|
|
|
}
|
2007-04-12 05:32:49 +00:00
|
|
|
|
|
|
|
return copy_keymap();
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Input layer interface */
|
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
static struct input_polled_dev *wistron_idev;
|
|
|
|
static unsigned long jiffies_last_press;
|
2009-08-08 06:17:39 +00:00
|
|
|
static bool wifi_enabled;
|
|
|
|
static bool bluetooth_enabled;
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-05-21 04:46:31 +00:00
|
|
|
/* led management */
|
|
|
|
static void wistron_mail_led_set(struct led_classdev *led_cdev,
|
|
|
|
enum led_brightness value)
|
|
|
|
{
|
|
|
|
bios_set_state(MAIL_LED, (value != LED_OFF) ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* same as setting up wifi card, but for laptops on which the led is managed */
|
|
|
|
static void wistron_wifi_led_set(struct led_classdev *led_cdev,
|
|
|
|
enum led_brightness value)
|
|
|
|
{
|
|
|
|
bios_set_state(WIFI, (value != LED_OFF) ? 1 : 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct led_classdev wistron_mail_led = {
|
2007-10-31 14:00:07 +00:00
|
|
|
.name = "wistron:green:mail",
|
2007-05-21 04:46:31 +00:00
|
|
|
.brightness_set = wistron_mail_led_set,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct led_classdev wistron_wifi_led = {
|
2007-10-31 14:00:07 +00:00
|
|
|
.name = "wistron:red:wifi",
|
2007-05-21 04:46:31 +00:00
|
|
|
.brightness_set = wistron_wifi_led_set,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void __devinit wistron_led_init(struct device *parent)
|
|
|
|
{
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_WIFI_LED) {
|
2007-05-21 04:46:31 +00:00
|
|
|
u16 wifi = bios_get_default_setting(WIFI);
|
|
|
|
if (wifi & 1) {
|
|
|
|
wistron_wifi_led.brightness = (wifi & 2) ? LED_FULL : LED_OFF;
|
|
|
|
if (led_classdev_register(parent, &wistron_wifi_led))
|
2009-08-08 06:17:39 +00:00
|
|
|
leds_present &= ~FE_WIFI_LED;
|
2007-05-21 04:46:31 +00:00
|
|
|
else
|
|
|
|
bios_set_state(WIFI, wistron_wifi_led.brightness);
|
|
|
|
|
|
|
|
} else
|
2009-08-08 06:17:39 +00:00
|
|
|
leds_present &= ~FE_WIFI_LED;
|
2007-05-21 04:46:31 +00:00
|
|
|
}
|
|
|
|
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_MAIL_LED) {
|
2007-05-21 04:46:31 +00:00
|
|
|
/* bios_get_default_setting(MAIL) always retuns 0, so just turn the led off */
|
|
|
|
wistron_mail_led.brightness = LED_OFF;
|
|
|
|
if (led_classdev_register(parent, &wistron_mail_led))
|
2009-08-08 06:17:39 +00:00
|
|
|
leds_present &= ~FE_MAIL_LED;
|
2007-05-21 04:46:31 +00:00
|
|
|
else
|
|
|
|
bios_set_state(MAIL_LED, wistron_mail_led.brightness);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __devexit wistron_led_remove(void)
|
|
|
|
{
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_MAIL_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_unregister(&wistron_mail_led);
|
|
|
|
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_WIFI_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_unregister(&wistron_wifi_led);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wistron_led_suspend(void)
|
|
|
|
{
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_MAIL_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_suspend(&wistron_mail_led);
|
|
|
|
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_WIFI_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_suspend(&wistron_wifi_led);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline void wistron_led_resume(void)
|
|
|
|
{
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_MAIL_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_resume(&wistron_mail_led);
|
|
|
|
|
2009-08-08 06:17:39 +00:00
|
|
|
if (leds_present & FE_WIFI_LED)
|
2007-05-21 04:46:31 +00:00
|
|
|
led_classdev_resume(&wistron_wifi_led);
|
|
|
|
}
|
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
static void handle_key(u8 code)
|
|
|
|
{
|
2009-12-04 18:22:24 +00:00
|
|
|
const struct key_entry *key =
|
|
|
|
sparse_keymap_entry_from_scancode(wistron_idev->input, code);
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-06-15 03:31:45 +00:00
|
|
|
if (key) {
|
|
|
|
switch (key->type) {
|
|
|
|
case KE_WIFI:
|
|
|
|
if (have_wifi) {
|
|
|
|
wifi_enabled = !wifi_enabled;
|
|
|
|
bios_set_state(WIFI, wifi_enabled);
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
2007-06-15 03:31:45 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case KE_BLUETOOTH:
|
|
|
|
if (have_bluetooth) {
|
|
|
|
bluetooth_enabled = !bluetooth_enabled;
|
|
|
|
bios_set_state(BLUETOOTH, bluetooth_enabled);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-12-04 18:22:24 +00:00
|
|
|
sparse_keymap_report_entry(wistron_idev->input,
|
|
|
|
key, 1, true);
|
|
|
|
break;
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
2007-06-15 03:31:45 +00:00
|
|
|
jiffies_last_press = jiffies;
|
|
|
|
} else
|
|
|
|
printk(KERN_NOTICE
|
|
|
|
"wistron_btns: Unknown key code %02X\n", code);
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
static void poll_bios(bool discard)
|
2005-11-20 05:50:06 +00:00
|
|
|
{
|
|
|
|
u8 qlen;
|
|
|
|
u16 val;
|
|
|
|
|
|
|
|
for (;;) {
|
|
|
|
qlen = CMOS_READ(cmos_address);
|
|
|
|
if (qlen == 0)
|
|
|
|
break;
|
|
|
|
val = bios_pop_queue();
|
2007-05-23 03:48:39 +00:00
|
|
|
if (val != 0 && !discard)
|
2005-11-20 05:50:06 +00:00
|
|
|
handle_key((u8)val);
|
|
|
|
}
|
2007-05-23 03:48:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void wistron_flush(struct input_polled_dev *dev)
|
|
|
|
{
|
|
|
|
/* Flush stale event queue */
|
|
|
|
poll_bios(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void wistron_poll(struct input_polled_dev *dev)
|
|
|
|
{
|
|
|
|
poll_bios(false);
|
2005-11-20 05:50:06 +00:00
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
/* Increase poll frequency if user is currently pressing keys (< 2s ago) */
|
|
|
|
if (time_before(jiffies, jiffies_last_press + 2 * HZ))
|
|
|
|
dev->poll_interval = POLL_INTERVAL_BURST;
|
2007-05-21 04:46:22 +00:00
|
|
|
else
|
2007-05-23 03:48:39 +00:00
|
|
|
dev->poll_interval = POLL_INTERVAL_DEFAULT;
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
static int __devinit wistron_setup_keymap(struct input_dev *dev,
|
|
|
|
struct key_entry *entry)
|
2007-06-15 03:31:45 +00:00
|
|
|
{
|
2009-12-04 18:22:24 +00:00
|
|
|
switch (entry->type) {
|
2007-06-15 03:31:45 +00:00
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
/* if wifi or bluetooth are not available, create normal keys */
|
|
|
|
case KE_WIFI:
|
|
|
|
if (!have_wifi) {
|
|
|
|
entry->type = KE_KEY;
|
|
|
|
entry->keycode = KEY_WLAN;
|
|
|
|
}
|
|
|
|
break;
|
2007-06-15 03:31:45 +00:00
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
case KE_BLUETOOTH:
|
|
|
|
if (!have_bluetooth) {
|
|
|
|
entry->type = KE_KEY;
|
|
|
|
entry->keycode = KEY_BLUETOOTH;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case KE_END:
|
|
|
|
if (entry->code & FE_UNTESTED)
|
|
|
|
printk(KERN_WARNING "Untested laptop multimedia keys, "
|
|
|
|
"please report success or failure to "
|
|
|
|
"eric.piel@tremplin-utc.net\n");
|
|
|
|
break;
|
2007-06-15 03:31:45 +00:00
|
|
|
}
|
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
return 0;
|
2007-06-15 03:31:45 +00:00
|
|
|
}
|
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
static int __devinit setup_input_dev(void)
|
|
|
|
{
|
|
|
|
struct input_dev *input_dev;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
wistron_idev = input_allocate_polled_device();
|
|
|
|
if (!wistron_idev)
|
|
|
|
return -ENOMEM;
|
|
|
|
|
2009-10-18 07:38:57 +00:00
|
|
|
wistron_idev->open = wistron_flush;
|
2007-05-23 03:48:39 +00:00
|
|
|
wistron_idev->poll = wistron_poll;
|
|
|
|
wistron_idev->poll_interval = POLL_INTERVAL_DEFAULT;
|
|
|
|
|
|
|
|
input_dev = wistron_idev->input;
|
|
|
|
input_dev->name = "Wistron laptop buttons";
|
|
|
|
input_dev->phys = "wistron/input0";
|
|
|
|
input_dev->id.bustype = BUS_HOST;
|
2007-06-15 03:31:45 +00:00
|
|
|
input_dev->dev.parent = &wistron_device->dev;
|
|
|
|
|
2009-12-04 18:22:24 +00:00
|
|
|
error = sparse_keymap_setup(input_dev, keymap, wistron_setup_keymap);
|
|
|
|
if (error)
|
|
|
|
goto err_free_dev;
|
2007-05-23 03:48:39 +00:00
|
|
|
|
|
|
|
error = input_register_polled_device(wistron_idev);
|
2009-12-04 18:22:24 +00:00
|
|
|
if (error)
|
|
|
|
goto err_free_keymap;
|
2007-05-23 03:48:39 +00:00
|
|
|
|
|
|
|
return 0;
|
2009-12-04 18:22:24 +00:00
|
|
|
|
|
|
|
err_free_keymap:
|
|
|
|
sparse_keymap_free(input_dev);
|
|
|
|
err_free_dev:
|
|
|
|
input_free_polled_device(wistron_idev);
|
|
|
|
return error;
|
2007-05-23 03:48:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Driver core */
|
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
static int __devinit wistron_probe(struct platform_device *dev)
|
|
|
|
{
|
2007-05-23 03:48:39 +00:00
|
|
|
int err;
|
2005-12-28 06:26:24 +00:00
|
|
|
|
|
|
|
bios_attach();
|
|
|
|
cmos_address = bios_get_cmos_address();
|
|
|
|
|
|
|
|
if (have_wifi) {
|
|
|
|
u16 wifi = bios_get_default_setting(WIFI);
|
|
|
|
if (wifi & 1)
|
2009-08-08 06:17:39 +00:00
|
|
|
wifi_enabled = wifi & 2;
|
2005-12-28 06:26:24 +00:00
|
|
|
else
|
|
|
|
have_wifi = 0;
|
|
|
|
|
|
|
|
if (have_wifi)
|
|
|
|
bios_set_state(WIFI, wifi_enabled);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (have_bluetooth) {
|
|
|
|
u16 bt = bios_get_default_setting(BLUETOOTH);
|
|
|
|
if (bt & 1)
|
2009-08-08 06:17:39 +00:00
|
|
|
bluetooth_enabled = bt & 2;
|
2005-12-28 06:26:24 +00:00
|
|
|
else
|
2009-08-08 06:17:39 +00:00
|
|
|
have_bluetooth = false;
|
2005-12-28 06:26:24 +00:00
|
|
|
|
|
|
|
if (have_bluetooth)
|
|
|
|
bios_set_state(BLUETOOTH, bluetooth_enabled);
|
|
|
|
}
|
|
|
|
|
2007-05-21 04:46:31 +00:00
|
|
|
wistron_led_init(&dev->dev);
|
2009-08-08 06:17:39 +00:00
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
err = setup_input_dev();
|
|
|
|
if (err) {
|
|
|
|
bios_detach();
|
|
|
|
return err;
|
|
|
|
}
|
2005-12-28 06:26:24 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int __devexit wistron_remove(struct platform_device *dev)
|
|
|
|
{
|
2007-05-21 04:46:31 +00:00
|
|
|
wistron_led_remove();
|
2007-05-23 03:48:39 +00:00
|
|
|
input_unregister_polled_device(wistron_idev);
|
2009-12-04 18:22:24 +00:00
|
|
|
sparse_keymap_free(wistron_idev->input);
|
2007-05-23 03:48:39 +00:00
|
|
|
input_free_polled_device(wistron_idev);
|
2005-12-28 06:26:24 +00:00
|
|
|
bios_detach();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_PM
|
2009-08-08 06:17:39 +00:00
|
|
|
static int wistron_suspend(struct device *dev)
|
2005-11-20 05:50:58 +00:00
|
|
|
{
|
2005-11-20 05:51:05 +00:00
|
|
|
if (have_wifi)
|
|
|
|
bios_set_state(WIFI, 0);
|
|
|
|
|
|
|
|
if (have_bluetooth)
|
|
|
|
bios_set_state(BLUETOOTH, 0);
|
|
|
|
|
2007-05-21 04:46:31 +00:00
|
|
|
wistron_led_suspend();
|
2009-08-08 06:17:39 +00:00
|
|
|
|
2005-11-20 05:50:58 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-08-08 06:17:39 +00:00
|
|
|
static int wistron_resume(struct device *dev)
|
2005-11-20 05:50:58 +00:00
|
|
|
{
|
|
|
|
if (have_wifi)
|
|
|
|
bios_set_state(WIFI, wifi_enabled);
|
|
|
|
|
|
|
|
if (have_bluetooth)
|
|
|
|
bios_set_state(BLUETOOTH, bluetooth_enabled);
|
|
|
|
|
2007-05-21 04:46:31 +00:00
|
|
|
wistron_led_resume();
|
2009-08-08 06:17:39 +00:00
|
|
|
|
2007-05-23 03:48:39 +00:00
|
|
|
poll_bios(true);
|
2005-11-20 05:50:58 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2009-08-08 06:17:39 +00:00
|
|
|
|
|
|
|
static const struct dev_pm_ops wistron_pm_ops = {
|
|
|
|
.suspend = wistron_suspend,
|
|
|
|
.resume = wistron_resume,
|
|
|
|
.poweroff = wistron_suspend,
|
|
|
|
.restore = wistron_resume,
|
|
|
|
};
|
2005-12-28 06:26:24 +00:00
|
|
|
#endif
|
2005-11-20 05:50:58 +00:00
|
|
|
|
|
|
|
static struct platform_driver wistron_driver = {
|
|
|
|
.driver = {
|
|
|
|
.name = "wistron-bios",
|
2005-12-28 06:26:24 +00:00
|
|
|
.owner = THIS_MODULE,
|
2009-12-30 07:19:31 +00:00
|
|
|
#ifdef CONFIG_PM
|
2009-08-08 06:17:39 +00:00
|
|
|
.pm = &wistron_pm_ops,
|
|
|
|
#endif
|
2005-11-20 05:50:58 +00:00
|
|
|
},
|
2005-12-28 06:26:24 +00:00
|
|
|
.probe = wistron_probe,
|
|
|
|
.remove = __devexit_p(wistron_remove),
|
2005-11-20 05:50:58 +00:00
|
|
|
};
|
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
static int __init wb_module_init(void)
|
|
|
|
{
|
|
|
|
int err;
|
|
|
|
|
|
|
|
err = select_keymap();
|
|
|
|
if (err)
|
|
|
|
return err;
|
2005-11-20 05:50:46 +00:00
|
|
|
|
2005-11-20 05:50:06 +00:00
|
|
|
err = map_bios();
|
|
|
|
if (err)
|
2010-06-28 08:10:01 +00:00
|
|
|
goto err_free_keymap;
|
2005-11-20 05:50:46 +00:00
|
|
|
|
2005-11-20 05:50:58 +00:00
|
|
|
err = platform_driver_register(&wistron_driver);
|
|
|
|
if (err)
|
2005-12-28 06:26:24 +00:00
|
|
|
goto err_unmap_bios;
|
2005-11-20 05:50:58 +00:00
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
wistron_device = platform_device_alloc("wistron-bios", -1);
|
|
|
|
if (!wistron_device) {
|
|
|
|
err = -ENOMEM;
|
2005-11-20 05:50:58 +00:00
|
|
|
goto err_unregister_driver;
|
|
|
|
}
|
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
err = platform_device_add(wistron_device);
|
2005-11-20 05:50:58 +00:00
|
|
|
if (err)
|
2005-12-28 06:26:24 +00:00
|
|
|
goto err_free_device;
|
2005-11-20 05:50:06 +00:00
|
|
|
|
|
|
|
return 0;
|
2005-11-20 05:50:58 +00:00
|
|
|
|
2005-12-28 06:26:24 +00:00
|
|
|
err_free_device:
|
|
|
|
platform_device_put(wistron_device);
|
2005-11-20 05:50:58 +00:00
|
|
|
err_unregister_driver:
|
|
|
|
platform_driver_unregister(&wistron_driver);
|
2005-12-28 06:26:24 +00:00
|
|
|
err_unmap_bios:
|
2005-11-20 05:50:58 +00:00
|
|
|
unmap_bios();
|
2010-06-28 08:10:01 +00:00
|
|
|
err_free_keymap:
|
|
|
|
kfree(keymap);
|
2005-11-20 05:50:58 +00:00
|
|
|
|
|
|
|
return err;
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit wb_module_exit(void)
|
|
|
|
{
|
2005-11-20 05:50:58 +00:00
|
|
|
platform_device_unregister(wistron_device);
|
|
|
|
platform_driver_unregister(&wistron_driver);
|
2005-11-20 05:50:06 +00:00
|
|
|
unmap_bios();
|
2007-04-12 05:32:49 +00:00
|
|
|
kfree(keymap);
|
2005-11-20 05:50:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module_init(wb_module_init);
|
|
|
|
module_exit(wb_module_exit);
|