aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-09 22:52:01 -0500
commitfa395aaec823b9d1a5800913a6b5d0e6d1c5ced2 (patch)
treed599abe9f4f48f1737da50fa9a48dadfd08100e3 /drivers/input/misc
parent3e7468313758913c5e4d372f35b271b96bad1298 (diff)
parent1f26978afd123deb22dd3c7dc75771a02f6e03f6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (51 commits) Input: appletouch - give up maintainership Input: dm355evm_kbd - switch to using sparse keymap library Input: wistron_btns - switch to using sparse keymap library Input: add generic support for sparse keymaps Input: fix memory leak in force feedback core Input: wistron - remove identification strings from DMI table Input: psmouse - remove identification strings from DMI tables Input: atkbd - remove identification strings from DMI table Input: i8042 - remove identification strings from DMI tables DMI: allow omitting ident strings in DMI tables Input: psmouse - do not carry DMI data around Input: matrix-keypad - switch to using dev_pm_ops Input: keyboard - fix lack of locking when traversing handler->h_list Input: gpio_keys - scan gpio state at probe and resume time Input: keyboard - add locking around event handling Input: usbtouchscreen - add support for ET&T TC5UH touchscreen controller Input: xpad - add two new Xbox 360 devices Input: polled device - do not start polling if interval is zero Input: polled device - schedule first poll immediately Input: add S3C24XX touchscreen driver ...
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/Kconfig2
-rw-r--r--drivers/input/misc/ati_remote.c2
-rw-r--r--drivers/input/misc/dm355evm_keys.c150
-rw-r--r--drivers/input/misc/powermate.c2
-rw-r--r--drivers/input/misc/wistron_btns.c256
5 files changed, 143 insertions, 269 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index a9bb2544b2de..16ec5233441c 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -80,6 +80,7 @@ config INPUT_WISTRON_BTNS
80 tristate "x86 Wistron laptop button interface" 80 tristate "x86 Wistron laptop button interface"
81 depends on X86 && !X86_64 81 depends on X86 && !X86_64
82 select INPUT_POLLDEV 82 select INPUT_POLLDEV
83 select INPUT_SPARSEKMAP
83 select NEW_LEDS 84 select NEW_LEDS
84 select LEDS_CLASS 85 select LEDS_CLASS
85 select CHECK_SIGNATURE 86 select CHECK_SIGNATURE
@@ -281,6 +282,7 @@ config INPUT_RB532_BUTTON
281config INPUT_DM355EVM 282config INPUT_DM355EVM
282 tristate "TI DaVinci DM355 EVM Keypad and IR Remote" 283 tristate "TI DaVinci DM355 EVM Keypad and IR Remote"
283 depends on MFD_DM355EVM_MSP 284 depends on MFD_DM355EVM_MSP
285 select INPUT_SPARSEKMAP
284 help 286 help
285 Supports the pushbuttons and IR remote used with 287 Supports the pushbuttons and IR remote used with
286 the DM355 EVM board. 288 the DM355 EVM board.
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c
index e290fde35e74..614b65d78fe9 100644
--- a/drivers/input/misc/ati_remote.c
+++ b/drivers/input/misc/ati_remote.c
@@ -766,7 +766,7 @@ static int ati_remote_probe(struct usb_interface *interface, const struct usb_de
766 ati_remote->interface = interface; 766 ati_remote->interface = interface;
767 767
768 usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys)); 768 usb_make_path(udev, ati_remote->phys, sizeof(ati_remote->phys));
769 strlcpy(ati_remote->phys, "/input0", sizeof(ati_remote->phys)); 769 strlcat(ati_remote->phys, "/input0", sizeof(ati_remote->phys));
770 770
771 if (udev->manufacturer) 771 if (udev->manufacturer)
772 strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name)); 772 strlcpy(ati_remote->name, udev->manufacturer, sizeof(ati_remote->name));
diff --git a/drivers/input/misc/dm355evm_keys.c b/drivers/input/misc/dm355evm_keys.c
index f2b67dc81d80..766c06911f41 100644
--- a/drivers/input/misc/dm355evm_keys.c
+++ b/drivers/input/misc/dm355evm_keys.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/input.h> 13#include <linux/input.h>
14#include <linux/input/sparse-keymap.h>
14#include <linux/platform_device.h> 15#include <linux/platform_device.h>
15#include <linux/interrupt.h> 16#include <linux/interrupt.h>
16 17
@@ -33,12 +34,8 @@ struct dm355evm_keys {
33 int irq; 34 int irq;
34}; 35};
35 36
36/* These initial keycodes can be remapped by dm355evm_setkeycode(). */ 37/* These initial keycodes can be remapped */
37static struct { 38static const struct key_entry dm355evm_keys[] = {
38 u16 event;
39 u16 keycode;
40} dm355evm_keys[] = {
41
42 /* 39 /*
43 * Pushbuttons on the EVM board ... note that the labels for these 40 * Pushbuttons on the EVM board ... note that the labels for these
44 * are SW10/SW11/etc on the PC board. The left/right orientation 41 * are SW10/SW11/etc on the PC board. The left/right orientation
@@ -47,11 +44,11 @@ static struct {
47 * is to the right. (That is, rotate the board counter-clockwise 44 * is to the right. (That is, rotate the board counter-clockwise
48 * by 90 degrees from the SW10/etc and "DM355 EVM" labels.) 45 * by 90 degrees from the SW10/etc and "DM355 EVM" labels.)
49 */ 46 */
50 { 0x00d8, KEY_OK, }, /* SW12 */ 47 { KE_KEY, 0x00d8, { KEY_OK } }, /* SW12 */
51 { 0x00b8, KEY_UP, }, /* SW13 */ 48 { KE_KEY, 0x00b8, { KEY_UP } }, /* SW13 */
52 { 0x00e8, KEY_DOWN, }, /* SW11 */ 49 { KE_KEY, 0x00e8, { KEY_DOWN } }, /* SW11 */
53 { 0x0078, KEY_LEFT, }, /* SW14 */ 50 { KE_KEY, 0x0078, { KEY_LEFT } }, /* SW14 */
54 { 0x00f0, KEY_RIGHT, }, /* SW10 */ 51 { KE_KEY, 0x00f0, { KEY_RIGHT } }, /* SW10 */
55 52
56 /* 53 /*
57 * IR buttons ... codes assigned to match the universal remote 54 * IR buttons ... codes assigned to match the universal remote
@@ -65,35 +62,35 @@ static struct {
65 * RC5 codes are 14 bits, with two start bits (0x3 prefix) 62 * RC5 codes are 14 bits, with two start bits (0x3 prefix)
66 * and a toggle bit (masked out below). 63 * and a toggle bit (masked out below).
67 */ 64 */
68 { 0x300c, KEY_POWER, }, /* NOTE: docs omit this */ 65 { KE_KEY, 0x300c, { KEY_POWER } }, /* NOTE: docs omit this */
69 { 0x3000, KEY_NUMERIC_0, }, 66 { KE_KEY, 0x3000, { KEY_NUMERIC_0 } },
70 { 0x3001, KEY_NUMERIC_1, }, 67 { KE_KEY, 0x3001, { KEY_NUMERIC_1 } },
71 { 0x3002, KEY_NUMERIC_2, }, 68 { KE_KEY, 0x3002, { KEY_NUMERIC_2 } },
72 { 0x3003, KEY_NUMERIC_3, }, 69 { KE_KEY, 0x3003, { KEY_NUMERIC_3 } },
73 { 0x3004, KEY_NUMERIC_4, }, 70 { KE_KEY, 0x3004, { KEY_NUMERIC_4 } },
74 { 0x3005, KEY_NUMERIC_5, }, 71 { KE_KEY, 0x3005, { KEY_NUMERIC_5 } },
75 { 0x3006, KEY_NUMERIC_6, }, 72 { KE_KEY, 0x3006, { KEY_NUMERIC_6 } },
76 { 0x3007, KEY_NUMERIC_7, }, 73 { KE_KEY, 0x3007, { KEY_NUMERIC_7 } },
77 { 0x3008, KEY_NUMERIC_8, }, 74 { KE_KEY, 0x3008, { KEY_NUMERIC_8 } },
78 { 0x3009, KEY_NUMERIC_9, }, 75 { KE_KEY, 0x3009, { KEY_NUMERIC_9 } },
79 { 0x3022, KEY_ENTER, }, 76 { KE_KEY, 0x3022, { KEY_ENTER } },
80 { 0x30ec, KEY_MODE, }, /* "tv/vcr/..." */ 77 { KE_KEY, 0x30ec, { KEY_MODE } }, /* "tv/vcr/..." */
81 { 0x300f, KEY_SELECT, }, /* "info" */ 78 { KE_KEY, 0x300f, { KEY_SELECT } }, /* "info" */
82 { 0x3020, KEY_CHANNELUP, }, /* "up" */ 79 { KE_KEY, 0x3020, { KEY_CHANNELUP } }, /* "up" */
83 { 0x302e, KEY_MENU, }, /* "in/out" */ 80 { KE_KEY, 0x302e, { KEY_MENU } }, /* "in/out" */
84 { 0x3011, KEY_VOLUMEDOWN, }, /* "left" */ 81 { KE_KEY, 0x3011, { KEY_VOLUMEDOWN } }, /* "left" */
85 { 0x300d, KEY_MUTE, }, /* "ok" */ 82 { KE_KEY, 0x300d, { KEY_MUTE } }, /* "ok" */
86 { 0x3010, KEY_VOLUMEUP, }, /* "right" */ 83 { KE_KEY, 0x3010, { KEY_VOLUMEUP } }, /* "right" */
87 { 0x301e, KEY_SUBTITLE, }, /* "cc" */ 84 { KE_KEY, 0x301e, { KEY_SUBTITLE } }, /* "cc" */
88 { 0x3021, KEY_CHANNELDOWN, }, /* "down" */ 85 { KE_KEY, 0x3021, { KEY_CHANNELDOWN } },/* "down" */
89 { 0x3022, KEY_PREVIOUS, }, 86 { KE_KEY, 0x3022, { KEY_PREVIOUS } },
90 { 0x3026, KEY_SLEEP, }, 87 { KE_KEY, 0x3026, { KEY_SLEEP } },
91 { 0x3172, KEY_REWIND, }, /* NOTE: docs wrongly say 0x30ca */ 88 { KE_KEY, 0x3172, { KEY_REWIND } }, /* NOTE: docs wrongly say 0x30ca */
92 { 0x3175, KEY_PLAY, }, 89 { KE_KEY, 0x3175, { KEY_PLAY } },
93 { 0x3174, KEY_FASTFORWARD, }, 90 { KE_KEY, 0x3174, { KEY_FASTFORWARD } },
94 { 0x3177, KEY_RECORD, }, 91 { KE_KEY, 0x3177, { KEY_RECORD } },
95 { 0x3176, KEY_STOP, }, 92 { KE_KEY, 0x3176, { KEY_STOP } },
96 { 0x3169, KEY_PAUSE, }, 93 { KE_KEY, 0x3169, { KEY_PAUSE } },
97}; 94};
98 95
99/* 96/*
@@ -105,19 +102,18 @@ static struct {
105 */ 102 */
106static irqreturn_t dm355evm_keys_irq(int irq, void *_keys) 103static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
107{ 104{
108 struct dm355evm_keys *keys = _keys; 105 static u16 last_event;
109 int status; 106 struct dm355evm_keys *keys = _keys;
107 const struct key_entry *ke;
108 unsigned int keycode;
109 int status;
110 u16 event;
110 111
111 /* For simplicity we ignore INPUT_COUNT and just read 112 /* For simplicity we ignore INPUT_COUNT and just read
112 * events until we get the "queue empty" indicator. 113 * events until we get the "queue empty" indicator.
113 * Reading INPUT_LOW decrements the count. 114 * Reading INPUT_LOW decrements the count.
114 */ 115 */
115 for (;;) { 116 for (;;) {
116 static u16 last_event;
117 u16 event;
118 int keycode;
119 int i;
120
121 status = dm355evm_msp_read(DM355EVM_MSP_INPUT_HIGH); 117 status = dm355evm_msp_read(DM355EVM_MSP_INPUT_HIGH);
122 if (status < 0) { 118 if (status < 0) {
123 dev_dbg(keys->dev, "input high err %d\n", 119 dev_dbg(keys->dev, "input high err %d\n",
@@ -156,14 +152,9 @@ static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
156 /* ignore the RC5 toggle bit */ 152 /* ignore the RC5 toggle bit */
157 event &= ~0x0800; 153 event &= ~0x0800;
158 154
159 /* find the key, or leave it as unknown */ 155 /* find the key, or report it as unknown */
160 keycode = KEY_UNKNOWN; 156 ke = sparse_keymap_entry_from_scancode(keys->input, event);
161 for (i = 0; i < ARRAY_SIZE(dm355evm_keys); i++) { 157 keycode = ke ? ke->keycode : KEY_UNKNOWN;
162 if (dm355evm_keys[i].event != event)
163 continue;
164 keycode = dm355evm_keys[i].keycode;
165 break;
166 }
167 dev_dbg(keys->dev, 158 dev_dbg(keys->dev,
168 "input event 0x%04x--> keycode %d\n", 159 "input event 0x%04x--> keycode %d\n",
169 event, keycode); 160 event, keycode);
@@ -174,36 +165,8 @@ static irqreturn_t dm355evm_keys_irq(int irq, void *_keys)
174 input_report_key(keys->input, keycode, 0); 165 input_report_key(keys->input, keycode, 0);
175 input_sync(keys->input); 166 input_sync(keys->input);
176 } 167 }
177 return IRQ_HANDLED;
178}
179 168
180static int dm355evm_setkeycode(struct input_dev *dev, int index, int keycode) 169 return IRQ_HANDLED;
181{
182 u16 old_keycode;
183 unsigned i;
184
185 if (((unsigned)index) >= ARRAY_SIZE(dm355evm_keys))
186 return -EINVAL;
187
188 old_keycode = dm355evm_keys[index].keycode;
189 dm355evm_keys[index].keycode = keycode;
190 set_bit(keycode, dev->keybit);
191
192 for (i = 0; i < ARRAY_SIZE(dm355evm_keys); i++) {
193 if (dm355evm_keys[index].keycode == old_keycode)
194 goto done;
195 }
196 clear_bit(old_keycode, dev->keybit);
197done:
198 return 0;
199}
200
201static int dm355evm_getkeycode(struct input_dev *dev, int index, int *keycode)
202{
203 if (((unsigned)index) >= ARRAY_SIZE(dm355evm_keys))
204 return -EINVAL;
205
206 return dm355evm_keys[index].keycode;
207} 170}
208 171
209/*----------------------------------------------------------------------*/ 172/*----------------------------------------------------------------------*/
@@ -213,7 +176,6 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev)
213 struct dm355evm_keys *keys; 176 struct dm355evm_keys *keys;
214 struct input_dev *input; 177 struct input_dev *input;
215 int status; 178 int status;
216 int i;
217 179
218 /* allocate instance struct and input dev */ 180 /* allocate instance struct and input dev */
219 keys = kzalloc(sizeof *keys, GFP_KERNEL); 181 keys = kzalloc(sizeof *keys, GFP_KERNEL);
@@ -242,31 +204,30 @@ static int __devinit dm355evm_keys_probe(struct platform_device *pdev)
242 input->id.product = 0x0355; 204 input->id.product = 0x0355;
243 input->id.version = dm355evm_msp_read(DM355EVM_MSP_FIRMREV); 205 input->id.version = dm355evm_msp_read(DM355EVM_MSP_FIRMREV);
244 206
245 input->evbit[0] = BIT(EV_KEY); 207 status = sparse_keymap_setup(input, dm355evm_keys, NULL);
246 for (i = 0; i < ARRAY_SIZE(dm355evm_keys); i++) 208 if (status)
247 __set_bit(dm355evm_keys[i].keycode, input->keybit); 209 goto fail1;
248
249 input->setkeycode = dm355evm_setkeycode;
250 input->getkeycode = dm355evm_getkeycode;
251 210
252 /* REVISIT: flush the event queue? */ 211 /* REVISIT: flush the event queue? */
253 212
254 status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq, 213 status = request_threaded_irq(keys->irq, NULL, dm355evm_keys_irq,
255 IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), keys); 214 IRQF_TRIGGER_FALLING, dev_name(&pdev->dev), keys);
256 if (status < 0) 215 if (status < 0)
257 goto fail1; 216 goto fail2;
258 217
259 /* register */ 218 /* register */
260 status = input_register_device(input); 219 status = input_register_device(input);
261 if (status < 0) 220 if (status < 0)
262 goto fail2; 221 goto fail3;
263 222
264 platform_set_drvdata(pdev, keys); 223 platform_set_drvdata(pdev, keys);
265 224
266 return 0; 225 return 0;
267 226
268fail2: 227fail3:
269 free_irq(keys->irq, keys); 228 free_irq(keys->irq, keys);
229fail2:
230 sparse_keymap_free(input);
270fail1: 231fail1:
271 input_free_device(input); 232 input_free_device(input);
272 kfree(keys); 233 kfree(keys);
@@ -280,6 +241,7 @@ static int __devexit dm355evm_keys_remove(struct platform_device *pdev)
280 struct dm355evm_keys *keys = platform_get_drvdata(pdev); 241 struct dm355evm_keys *keys = platform_get_drvdata(pdev);
281 242
282 free_irq(keys->irq, keys); 243 free_irq(keys->irq, keys);
244 sparse_keymap_free(keys->input);
283 input_unregister_device(keys->input); 245 input_unregister_device(keys->input);
284 kfree(keys); 246 kfree(keys);
285 247
diff --git a/drivers/input/misc/powermate.c b/drivers/input/misc/powermate.c
index a53c4885fbad..668913d12044 100644
--- a/drivers/input/misc/powermate.c
+++ b/drivers/input/misc/powermate.c
@@ -338,7 +338,7 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
338 pm->input = input_dev; 338 pm->input = input_dev;
339 339
340 usb_make_path(udev, pm->phys, sizeof(pm->phys)); 340 usb_make_path(udev, pm->phys, sizeof(pm->phys));
341 strlcpy(pm->phys, "/input0", sizeof(pm->phys)); 341 strlcat(pm->phys, "/input0", sizeof(pm->phys));
342 342
343 spin_lock_init(&pm->lock); 343 spin_lock_init(&pm->lock);
344 344
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index a932179c4c9e..38da6ab04384 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -21,6 +21,7 @@
21#include <linux/dmi.h> 21#include <linux/dmi.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/input-polldev.h> 23#include <linux/input-polldev.h>
24#include <linux/input/sparse-keymap.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
25#include <linux/jiffies.h> 26#include <linux/jiffies.h>
26#include <linux/kernel.h> 27#include <linux/kernel.h>
@@ -224,19 +225,8 @@ static void bios_set_state(u8 subsys, int enable)
224 225
225/* Hardware database */ 226/* Hardware database */
226 227
227struct key_entry { 228#define KE_WIFI (KE_LAST + 1)
228 char type; /* See KE_* below */ 229#define KE_BLUETOOTH (KE_LAST + 2)
229 u8 code;
230 union {
231 u16 keycode; /* For KE_KEY */
232 struct { /* For KE_SW */
233 u8 code;
234 u8 value;
235 } sw;
236 };
237};
238
239enum { KE_END, KE_KEY, KE_SW, KE_WIFI, KE_BLUETOOTH };
240 230
241#define FE_MAIL_LED 0x01 231#define FE_MAIL_LED 0x01
242#define FE_WIFI_LED 0x02 232#define FE_WIFI_LED 0x02
@@ -644,10 +634,10 @@ static struct key_entry keymap_prestigio[] __initdata = {
644 * a list of buttons and their key codes (reported when loading this module 634 * a list of buttons and their key codes (reported when loading this module
645 * with force=1) and the output of dmidecode to $MODULE_AUTHOR. 635 * with force=1) and the output of dmidecode to $MODULE_AUTHOR.
646 */ 636 */
647static struct dmi_system_id dmi_ids[] __initdata = { 637static const struct dmi_system_id __initconst dmi_ids[] = {
648 { 638 {
639 /* Fujitsu-Siemens Amilo Pro V2000 */
649 .callback = dmi_matched, 640 .callback = dmi_matched,
650 .ident = "Fujitsu-Siemens Amilo Pro V2000",
651 .matches = { 641 .matches = {
652 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 642 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
653 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"), 643 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2000"),
@@ -655,8 +645,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
655 .driver_data = keymap_fs_amilo_pro_v2000 645 .driver_data = keymap_fs_amilo_pro_v2000
656 }, 646 },
657 { 647 {
648 /* Fujitsu-Siemens Amilo Pro Edition V3505 */
658 .callback = dmi_matched, 649 .callback = dmi_matched,
659 .ident = "Fujitsu-Siemens Amilo Pro Edition V3505",
660 .matches = { 650 .matches = {
661 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 651 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
662 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro Edition V3505"), 652 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro Edition V3505"),
@@ -664,8 +654,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
664 .driver_data = keymap_fs_amilo_pro_v3505 654 .driver_data = keymap_fs_amilo_pro_v3505
665 }, 655 },
666 { 656 {
657 /* Fujitsu-Siemens Amilo M7400 */
667 .callback = dmi_matched, 658 .callback = dmi_matched,
668 .ident = "Fujitsu-Siemens Amilo M7400",
669 .matches = { 659 .matches = {
670 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 660 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
671 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M "), 661 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO M "),
@@ -673,8 +663,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
673 .driver_data = keymap_fs_amilo_pro_v2000 663 .driver_data = keymap_fs_amilo_pro_v2000
674 }, 664 },
675 { 665 {
666 /* Maxdata Pro 7000 DX */
676 .callback = dmi_matched, 667 .callback = dmi_matched,
677 .ident = "Maxdata Pro 7000 DX",
678 .matches = { 668 .matches = {
679 DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"), 669 DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
680 DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"), 670 DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
@@ -682,8 +672,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
682 .driver_data = keymap_fs_amilo_pro_v2000 672 .driver_data = keymap_fs_amilo_pro_v2000
683 }, 673 },
684 { 674 {
675 /* Fujitsu N3510 */
685 .callback = dmi_matched, 676 .callback = dmi_matched,
686 .ident = "Fujitsu N3510",
687 .matches = { 677 .matches = {
688 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 678 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
689 DMI_MATCH(DMI_PRODUCT_NAME, "N3510"), 679 DMI_MATCH(DMI_PRODUCT_NAME, "N3510"),
@@ -691,8 +681,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
691 .driver_data = keymap_fujitsu_n3510 681 .driver_data = keymap_fujitsu_n3510
692 }, 682 },
693 { 683 {
684 /* Acer Aspire 1500 */
694 .callback = dmi_matched, 685 .callback = dmi_matched,
695 .ident = "Acer Aspire 1500",
696 .matches = { 686 .matches = {
697 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 687 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
698 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"), 688 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1500"),
@@ -700,8 +690,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
700 .driver_data = keymap_acer_aspire_1500 690 .driver_data = keymap_acer_aspire_1500
701 }, 691 },
702 { 692 {
693 /* Acer Aspire 1600 */
703 .callback = dmi_matched, 694 .callback = dmi_matched,
704 .ident = "Acer Aspire 1600",
705 .matches = { 695 .matches = {
706 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 696 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
707 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1600"), 697 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1600"),
@@ -709,8 +699,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
709 .driver_data = keymap_acer_aspire_1600 699 .driver_data = keymap_acer_aspire_1600
710 }, 700 },
711 { 701 {
702 /* Acer Aspire 3020 */
712 .callback = dmi_matched, 703 .callback = dmi_matched,
713 .ident = "Acer Aspire 3020",
714 .matches = { 704 .matches = {
715 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 705 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
716 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3020"), 706 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3020"),
@@ -718,8 +708,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
718 .driver_data = keymap_acer_aspire_5020 708 .driver_data = keymap_acer_aspire_5020
719 }, 709 },
720 { 710 {
711 /* Acer Aspire 5020 */
721 .callback = dmi_matched, 712 .callback = dmi_matched,
722 .ident = "Acer Aspire 5020",
723 .matches = { 713 .matches = {
724 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 714 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
725 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5020"), 715 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5020"),
@@ -727,8 +717,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
727 .driver_data = keymap_acer_aspire_5020 717 .driver_data = keymap_acer_aspire_5020
728 }, 718 },
729 { 719 {
720 /* Acer TravelMate 2100 */
730 .callback = dmi_matched, 721 .callback = dmi_matched,
731 .ident = "Acer TravelMate 2100",
732 .matches = { 722 .matches = {
733 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 723 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
734 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2100"), 724 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2100"),
@@ -736,8 +726,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
736 .driver_data = keymap_acer_aspire_5020 726 .driver_data = keymap_acer_aspire_5020
737 }, 727 },
738 { 728 {
729 /* Acer TravelMate 2410 */
739 .callback = dmi_matched, 730 .callback = dmi_matched,
740 .ident = "Acer TravelMate 2410",
741 .matches = { 731 .matches = {
742 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 732 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
743 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2410"), 733 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2410"),
@@ -745,8 +735,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
745 .driver_data = keymap_acer_travelmate_2410 735 .driver_data = keymap_acer_travelmate_2410
746 }, 736 },
747 { 737 {
738 /* Acer TravelMate C300 */
748 .callback = dmi_matched, 739 .callback = dmi_matched,
749 .ident = "Acer TravelMate C300",
750 .matches = { 740 .matches = {
751 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 741 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
752 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C300"), 742 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C300"),
@@ -754,8 +744,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
754 .driver_data = keymap_acer_travelmate_300 744 .driver_data = keymap_acer_travelmate_300
755 }, 745 },
756 { 746 {
747 /* Acer TravelMate C100 */
757 .callback = dmi_matched, 748 .callback = dmi_matched,
758 .ident = "Acer TravelMate C100",
759 .matches = { 749 .matches = {
760 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 750 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
761 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C100"), 751 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C100"),
@@ -763,8 +753,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
763 .driver_data = keymap_acer_travelmate_300 753 .driver_data = keymap_acer_travelmate_300
764 }, 754 },
765 { 755 {
756 /* Acer TravelMate C110 */
766 .callback = dmi_matched, 757 .callback = dmi_matched,
767 .ident = "Acer TravelMate C110",
768 .matches = { 758 .matches = {
769 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 759 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
770 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C110"), 760 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C110"),
@@ -772,8 +762,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
772 .driver_data = keymap_acer_travelmate_110 762 .driver_data = keymap_acer_travelmate_110
773 }, 763 },
774 { 764 {
765 /* Acer TravelMate 380 */
775 .callback = dmi_matched, 766 .callback = dmi_matched,
776 .ident = "Acer TravelMate 380",
777 .matches = { 767 .matches = {
778 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 768 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
779 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 380"), 769 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 380"),
@@ -781,8 +771,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
781 .driver_data = keymap_acer_travelmate_380 771 .driver_data = keymap_acer_travelmate_380
782 }, 772 },
783 { 773 {
774 /* Acer TravelMate 370 */
784 .callback = dmi_matched, 775 .callback = dmi_matched,
785 .ident = "Acer TravelMate 370",
786 .matches = { 776 .matches = {
787 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 777 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
788 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 370"), 778 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 370"),
@@ -790,8 +780,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
790 .driver_data = keymap_acer_travelmate_380 /* keyboard minus 1 key */ 780 .driver_data = keymap_acer_travelmate_380 /* keyboard minus 1 key */
791 }, 781 },
792 { 782 {
783 /* Acer TravelMate 220 */
793 .callback = dmi_matched, 784 .callback = dmi_matched,
794 .ident = "Acer TravelMate 220",
795 .matches = { 785 .matches = {
796 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 786 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
797 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 220"), 787 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 220"),
@@ -799,8 +789,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
799 .driver_data = keymap_acer_travelmate_220 789 .driver_data = keymap_acer_travelmate_220
800 }, 790 },
801 { 791 {
792 /* Acer TravelMate 260 */
802 .callback = dmi_matched, 793 .callback = dmi_matched,
803 .ident = "Acer TravelMate 260",
804 .matches = { 794 .matches = {
805 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 795 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
806 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 260"), 796 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 260"),
@@ -808,8 +798,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
808 .driver_data = keymap_acer_travelmate_220 798 .driver_data = keymap_acer_travelmate_220
809 }, 799 },
810 { 800 {
801 /* Acer TravelMate 230 */
811 .callback = dmi_matched, 802 .callback = dmi_matched,
812 .ident = "Acer TravelMate 230",
813 .matches = { 803 .matches = {
814 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 804 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
815 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 230"), 805 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 230"),
@@ -818,8 +808,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
818 .driver_data = keymap_acer_travelmate_230 808 .driver_data = keymap_acer_travelmate_230
819 }, 809 },
820 { 810 {
811 /* Acer TravelMate 280 */
821 .callback = dmi_matched, 812 .callback = dmi_matched,
822 .ident = "Acer TravelMate 280",
823 .matches = { 813 .matches = {
824 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 814 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
825 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 280"), 815 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 280"),
@@ -827,8 +817,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
827 .driver_data = keymap_acer_travelmate_230 817 .driver_data = keymap_acer_travelmate_230
828 }, 818 },
829 { 819 {
820 /* Acer TravelMate 240 */
830 .callback = dmi_matched, 821 .callback = dmi_matched,
831 .ident = "Acer TravelMate 240",
832 .matches = { 822 .matches = {
833 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 823 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
834 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 240"), 824 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 240"),
@@ -836,8 +826,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
836 .driver_data = keymap_acer_travelmate_240 826 .driver_data = keymap_acer_travelmate_240
837 }, 827 },
838 { 828 {
829 /* Acer TravelMate 250 */
839 .callback = dmi_matched, 830 .callback = dmi_matched,
840 .ident = "Acer TravelMate 250",
841 .matches = { 831 .matches = {
842 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 832 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
843 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 250"), 833 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 250"),
@@ -845,8 +835,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
845 .driver_data = keymap_acer_travelmate_240 835 .driver_data = keymap_acer_travelmate_240
846 }, 836 },
847 { 837 {
838 /* Acer TravelMate 2424NWXCi */
848 .callback = dmi_matched, 839 .callback = dmi_matched,
849 .ident = "Acer TravelMate 2424NWXCi",
850 .matches = { 840 .matches = {
851 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 841 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
852 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2420"), 842 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2420"),
@@ -854,8 +844,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
854 .driver_data = keymap_acer_travelmate_240 844 .driver_data = keymap_acer_travelmate_240
855 }, 845 },
856 { 846 {
847 /* Acer TravelMate 350 */
857 .callback = dmi_matched, 848 .callback = dmi_matched,
858 .ident = "Acer TravelMate 350",
859 .matches = { 849 .matches = {
860 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 850 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
861 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 350"), 851 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 350"),
@@ -863,8 +853,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
863 .driver_data = keymap_acer_travelmate_350 853 .driver_data = keymap_acer_travelmate_350
864 }, 854 },
865 { 855 {
856 /* Acer TravelMate 360 */
866 .callback = dmi_matched, 857 .callback = dmi_matched,
867 .ident = "Acer TravelMate 360",
868 .matches = { 858 .matches = {
869 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 859 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
870 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), 860 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
@@ -872,8 +862,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
872 .driver_data = keymap_acer_travelmate_360 862 .driver_data = keymap_acer_travelmate_360
873 }, 863 },
874 { 864 {
865 /* Acer TravelMate 610 */
875 .callback = dmi_matched, 866 .callback = dmi_matched,
876 .ident = "Acer TravelMate 610",
877 .matches = { 867 .matches = {
878 DMI_MATCH(DMI_SYS_VENDOR, "ACER"), 868 DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
879 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 610"), 869 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 610"),
@@ -881,8 +871,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
881 .driver_data = keymap_acer_travelmate_610 871 .driver_data = keymap_acer_travelmate_610
882 }, 872 },
883 { 873 {
874 /* Acer TravelMate 620 */
884 .callback = dmi_matched, 875 .callback = dmi_matched,
885 .ident = "Acer TravelMate 620",
886 .matches = { 876 .matches = {
887 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 877 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
888 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 620"), 878 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 620"),
@@ -890,8 +880,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
890 .driver_data = keymap_acer_travelmate_630 880 .driver_data = keymap_acer_travelmate_630
891 }, 881 },
892 { 882 {
883 /* Acer TravelMate 630 */
893 .callback = dmi_matched, 884 .callback = dmi_matched,
894 .ident = "Acer TravelMate 630",
895 .matches = { 885 .matches = {
896 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 886 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
897 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 630"), 887 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 630"),
@@ -899,8 +889,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
899 .driver_data = keymap_acer_travelmate_630 889 .driver_data = keymap_acer_travelmate_630
900 }, 890 },
901 { 891 {
892 /* AOpen 1559AS */
902 .callback = dmi_matched, 893 .callback = dmi_matched,
903 .ident = "AOpen 1559AS",
904 .matches = { 894 .matches = {
905 DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), 895 DMI_MATCH(DMI_PRODUCT_NAME, "E2U"),
906 DMI_MATCH(DMI_BOARD_NAME, "E2U"), 896 DMI_MATCH(DMI_BOARD_NAME, "E2U"),
@@ -908,8 +898,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
908 .driver_data = keymap_aopen_1559as 898 .driver_data = keymap_aopen_1559as
909 }, 899 },
910 { 900 {
901 /* Medion MD 9783 */
911 .callback = dmi_matched, 902 .callback = dmi_matched,
912 .ident = "Medion MD 9783",
913 .matches = { 903 .matches = {
914 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"), 904 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
915 DMI_MATCH(DMI_PRODUCT_NAME, "MD 9783"), 905 DMI_MATCH(DMI_PRODUCT_NAME, "MD 9783"),
@@ -917,8 +907,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
917 .driver_data = keymap_wistron_ms2111 907 .driver_data = keymap_wistron_ms2111
918 }, 908 },
919 { 909 {
910 /* Medion MD 40100 */
920 .callback = dmi_matched, 911 .callback = dmi_matched,
921 .ident = "Medion MD 40100",
922 .matches = { 912 .matches = {
923 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"), 913 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
924 DMI_MATCH(DMI_PRODUCT_NAME, "WID2000"), 914 DMI_MATCH(DMI_PRODUCT_NAME, "WID2000"),
@@ -926,8 +916,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
926 .driver_data = keymap_wistron_md40100 916 .driver_data = keymap_wistron_md40100
927 }, 917 },
928 { 918 {
919 /* Medion MD 2900 */
929 .callback = dmi_matched, 920 .callback = dmi_matched,
930 .ident = "Medion MD 2900",
931 .matches = { 921 .matches = {
932 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"), 922 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
933 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2000"), 923 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2000"),
@@ -935,8 +925,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
935 .driver_data = keymap_wistron_md2900 925 .driver_data = keymap_wistron_md2900
936 }, 926 },
937 { 927 {
928 /* Medion MD 42200 */
938 .callback = dmi_matched, 929 .callback = dmi_matched,
939 .ident = "Medion MD 42200",
940 .matches = { 930 .matches = {
941 DMI_MATCH(DMI_SYS_VENDOR, "Medion"), 931 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
942 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2030"), 932 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2030"),
@@ -944,8 +934,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
944 .driver_data = keymap_fs_amilo_pro_v2000 934 .driver_data = keymap_fs_amilo_pro_v2000
945 }, 935 },
946 { 936 {
937 /* Medion MD 96500 */
947 .callback = dmi_matched, 938 .callback = dmi_matched,
948 .ident = "Medion MD 96500",
949 .matches = { 939 .matches = {
950 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"), 940 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
951 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2040"), 941 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2040"),
@@ -953,8 +943,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
953 .driver_data = keymap_wistron_md96500 943 .driver_data = keymap_wistron_md96500
954 }, 944 },
955 { 945 {
946 /* Medion MD 95400 */
956 .callback = dmi_matched, 947 .callback = dmi_matched,
957 .ident = "Medion MD 95400",
958 .matches = { 948 .matches = {
959 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"), 949 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
960 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2050"), 950 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2050"),
@@ -962,8 +952,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
962 .driver_data = keymap_wistron_md96500 952 .driver_data = keymap_wistron_md96500
963 }, 953 },
964 { 954 {
955 /* Fujitsu Siemens Amilo D7820 */
965 .callback = dmi_matched, 956 .callback = dmi_matched,
966 .ident = "Fujitsu Siemens Amilo D7820",
967 .matches = { 957 .matches = {
968 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), /* not sure */ 958 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), /* not sure */
969 DMI_MATCH(DMI_PRODUCT_NAME, "Amilo D"), 959 DMI_MATCH(DMI_PRODUCT_NAME, "Amilo D"),
@@ -971,8 +961,8 @@ static struct dmi_system_id dmi_ids[] __initdata = {
971 .driver_data = keymap_fs_amilo_d88x0 961 .driver_data = keymap_fs_amilo_d88x0
972 }, 962 },
973 { 963 {
964 /* Fujitsu Siemens Amilo D88x0 */
974 .callback = dmi_matched, 965 .callback = dmi_matched,
975 .ident = "Fujitsu Siemens Amilo D88x0",
976 .matches = { 966 .matches = {
977 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 967 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
978 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"), 968 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO D"),
@@ -1037,21 +1027,6 @@ static unsigned long jiffies_last_press;
1037static bool wifi_enabled; 1027static bool wifi_enabled;
1038static bool bluetooth_enabled; 1028static bool bluetooth_enabled;
1039 1029
1040static void report_key(struct input_dev *dev, unsigned int keycode)
1041{
1042 input_report_key(dev, keycode, 1);
1043 input_sync(dev);
1044 input_report_key(dev, keycode, 0);
1045 input_sync(dev);
1046}
1047
1048static void report_switch(struct input_dev *dev, unsigned int code, int value)
1049{
1050 input_report_switch(dev, code, value);
1051 input_sync(dev);
1052}
1053
1054
1055 /* led management */ 1030 /* led management */
1056static void wistron_mail_led_set(struct led_classdev *led_cdev, 1031static void wistron_mail_led_set(struct led_classdev *led_cdev,
1057 enum led_brightness value) 1032 enum led_brightness value)
@@ -1128,43 +1103,13 @@ static inline void wistron_led_resume(void)
1128 led_classdev_resume(&wistron_wifi_led); 1103 led_classdev_resume(&wistron_wifi_led);
1129} 1104}
1130 1105
1131static struct key_entry *wistron_get_entry_by_scancode(int code)
1132{
1133 struct key_entry *key;
1134
1135 for (key = keymap; key->type != KE_END; key++)
1136 if (code == key->code)
1137 return key;
1138
1139 return NULL;
1140}
1141
1142static struct key_entry *wistron_get_entry_by_keycode(int keycode)
1143{
1144 struct key_entry *key;
1145
1146 for (key = keymap; key->type != KE_END; key++)
1147 if (key->type == KE_KEY && keycode == key->keycode)
1148 return key;
1149
1150 return NULL;
1151}
1152
1153static void handle_key(u8 code) 1106static void handle_key(u8 code)
1154{ 1107{
1155 const struct key_entry *key = wistron_get_entry_by_scancode(code); 1108 const struct key_entry *key =
1109 sparse_keymap_entry_from_scancode(wistron_idev->input, code);
1156 1110
1157 if (key) { 1111 if (key) {
1158 switch (key->type) { 1112 switch (key->type) {
1159 case KE_KEY:
1160 report_key(wistron_idev->input, key->keycode);
1161 break;
1162
1163 case KE_SW:
1164 report_switch(wistron_idev->input,
1165 key->sw.code, key->sw.value);
1166 break;
1167
1168 case KE_WIFI: 1113 case KE_WIFI:
1169 if (have_wifi) { 1114 if (have_wifi) {
1170 wifi_enabled = !wifi_enabled; 1115 wifi_enabled = !wifi_enabled;
@@ -1180,7 +1125,9 @@ static void handle_key(u8 code)
1180 break; 1125 break;
1181 1126
1182 default: 1127 default:
1183 BUG(); 1128 sparse_keymap_report_entry(wistron_idev->input,
1129 key, 1, true);
1130 break;
1184 } 1131 }
1185 jiffies_last_press = jiffies; 1132 jiffies_last_press = jiffies;
1186 } else 1133 } else
@@ -1220,42 +1167,39 @@ static void wistron_poll(struct input_polled_dev *dev)
1220 dev->poll_interval = POLL_INTERVAL_DEFAULT; 1167 dev->poll_interval = POLL_INTERVAL_DEFAULT;
1221} 1168}
1222 1169
1223static int wistron_getkeycode(struct input_dev *dev, int scancode, int *keycode) 1170static int __devinit wistron_setup_keymap(struct input_dev *dev,
1171 struct key_entry *entry)
1224{ 1172{
1225 const struct key_entry *key = wistron_get_entry_by_scancode(scancode); 1173 switch (entry->type) {
1226 1174
1227 if (key && key->type == KE_KEY) { 1175 /* if wifi or bluetooth are not available, create normal keys */
1228 *keycode = key->keycode; 1176 case KE_WIFI:
1229 return 0; 1177 if (!have_wifi) {
1230 } 1178 entry->type = KE_KEY;
1231 1179 entry->keycode = KEY_WLAN;
1232 return -EINVAL; 1180 }
1233} 1181 break;
1234 1182
1235static int wistron_setkeycode(struct input_dev *dev, int scancode, int keycode) 1183 case KE_BLUETOOTH:
1236{ 1184 if (!have_bluetooth) {
1237 struct key_entry *key; 1185 entry->type = KE_KEY;
1238 int old_keycode; 1186 entry->keycode = KEY_BLUETOOTH;
1239 1187 }
1240 if (keycode < 0 || keycode > KEY_MAX) 1188 break;
1241 return -EINVAL; 1189
1242 1190 case KE_END:
1243 key = wistron_get_entry_by_scancode(scancode); 1191 if (entry->code & FE_UNTESTED)
1244 if (key && key->type == KE_KEY) { 1192 printk(KERN_WARNING "Untested laptop multimedia keys, "
1245 old_keycode = key->keycode; 1193 "please report success or failure to "
1246 key->keycode = keycode; 1194 "eric.piel@tremplin-utc.net\n");
1247 set_bit(keycode, dev->keybit); 1195 break;
1248 if (!wistron_get_entry_by_keycode(old_keycode))
1249 clear_bit(old_keycode, dev->keybit);
1250 return 0;
1251 } 1196 }
1252 1197
1253 return -EINVAL; 1198 return 0;
1254} 1199}
1255 1200
1256static int __devinit setup_input_dev(void) 1201static int __devinit setup_input_dev(void)
1257{ 1202{
1258 struct key_entry *key;
1259 struct input_dev *input_dev; 1203 struct input_dev *input_dev;
1260 int error; 1204 int error;
1261 1205
@@ -1263,7 +1207,7 @@ static int __devinit setup_input_dev(void)
1263 if (!wistron_idev) 1207 if (!wistron_idev)
1264 return -ENOMEM; 1208 return -ENOMEM;
1265 1209
1266 wistron_idev->flush = wistron_flush; 1210 wistron_idev->open = wistron_flush;
1267 wistron_idev->poll = wistron_poll; 1211 wistron_idev->poll = wistron_poll;
1268 wistron_idev->poll_interval = POLL_INTERVAL_DEFAULT; 1212 wistron_idev->poll_interval = POLL_INTERVAL_DEFAULT;
1269 1213
@@ -1273,56 +1217,21 @@ static int __devinit setup_input_dev(void)
1273 input_dev->id.bustype = BUS_HOST; 1217 input_dev->id.bustype = BUS_HOST;
1274 input_dev->dev.parent = &wistron_device->dev; 1218 input_dev->dev.parent = &wistron_device->dev;
1275 1219
1276 input_dev->getkeycode = wistron_getkeycode; 1220 error = sparse_keymap_setup(input_dev, keymap, wistron_setup_keymap);
1277 input_dev->setkeycode = wistron_setkeycode; 1221 if (error)
1278 1222 goto err_free_dev;
1279 for (key = keymap; key->type != KE_END; key++) {
1280 switch (key->type) {
1281 case KE_KEY:
1282 set_bit(EV_KEY, input_dev->evbit);
1283 set_bit(key->keycode, input_dev->keybit);
1284 break;
1285
1286 case KE_SW:
1287 set_bit(EV_SW, input_dev->evbit);
1288 set_bit(key->sw.code, input_dev->swbit);
1289 break;
1290
1291 /* if wifi or bluetooth are not available, create normal keys */
1292 case KE_WIFI:
1293 if (!have_wifi) {
1294 key->type = KE_KEY;
1295 key->keycode = KEY_WLAN;
1296 key--;
1297 }
1298 break;
1299
1300 case KE_BLUETOOTH:
1301 if (!have_bluetooth) {
1302 key->type = KE_KEY;
1303 key->keycode = KEY_BLUETOOTH;
1304 key--;
1305 }
1306 break;
1307
1308 default:
1309 break;
1310 }
1311 }
1312
1313 /* reads information flags on KE_END */
1314 if (key->code & FE_UNTESTED)
1315 printk(KERN_WARNING "Untested laptop multimedia keys, "
1316 "please report success or failure to eric.piel"
1317 "@tremplin-utc.net\n");
1318 1223
1319 error = input_register_polled_device(wistron_idev); 1224 error = input_register_polled_device(wistron_idev);
1320 if (error) { 1225 if (error)
1321 input_free_polled_device(wistron_idev); 1226 goto err_free_keymap;
1322 return error;
1323 }
1324 1227
1325 return 0; 1228 return 0;
1229
1230 err_free_keymap:
1231 sparse_keymap_free(input_dev);
1232 err_free_dev:
1233 input_free_polled_device(wistron_idev);
1234 return error;
1326} 1235}
1327 1236
1328/* Driver core */ 1237/* Driver core */
@@ -1371,6 +1280,7 @@ static int __devexit wistron_remove(struct platform_device *dev)
1371{ 1280{
1372 wistron_led_remove(); 1281 wistron_led_remove();
1373 input_unregister_polled_device(wistron_idev); 1282 input_unregister_polled_device(wistron_idev);
1283 sparse_keymap_free(wistron_idev->input);
1374 input_free_polled_device(wistron_idev); 1284 input_free_polled_device(wistron_idev);
1375 bios_detach(); 1285 bios_detach();
1376 1286