aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Piel <eric.piel@tremplin-utc.net>2007-04-12 01:32:34 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:32:34 -0400
commit6480e2a275ff8ff48ae23a011616fcf819ed7a4e (patch)
tree9208e8c00511e5ce0f196d0c5e79410e5c8d9b1b
parent688897b0d4910e097f34c0e263d649cf2036eb45 (diff)
Input: wistron - add acerhk laptop database
Acerhk supports already a lot of laptops. Lets import its database so that everyone can benefit of the work of Olaf Tauber. Only the "tm_new" laptops were imported. "tm_old" laptops could be possible but requires more testing and probably only few laptops are still alive. "dritek" laptops should probably be imported into a different driver. Also compress the keymaps by fitting each entry on an int. Most of the dmi matching was written based on google searches, so it's rather prone to errors. That's why I'm asking people to confirm it works. Support to generate switch input events was added as some laptops indicate lid open/close through this interface. This adds the following hardware: Acer TravelMate 370 Acer TravelMate 380 Acer TravelMate C300 Acer TravelMate C100 Acer TravelMate C110 Acer TravelMate 250 Acer TravelMate 350 Acer TravelMate 620 Acer TravelMate 630 Acer TravelMate 220 Acer TravelMate 230 Acer TravelMate 260 Acer TravelMate 280 Acer TravelMate 360 Acer TravelMate 2100 Acer TravelMate 2410 Acer Aspire 1500 Acer Aspire 1600 Acer Aspire 3020 Acer Aspire 5020 Medion MD 2900 Medion MD 40100 Medion MD 95400 Medion MD 96500 Fujitsu Siemens Amilo 7820 Signed-off-by: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/misc/wistron_btns.c595
-rw-r--r--include/linux/input.h1
2 files changed, 524 insertions, 72 deletions
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 39e437599d35..47de377330b8 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -233,10 +233,20 @@ static void bios_set_state(u8 subsys, int enable)
233struct key_entry { 233struct key_entry {
234 char type; /* See KE_* below */ 234 char type; /* See KE_* below */
235 u8 code; 235 u8 code;
236 unsigned keycode; /* For KE_KEY */ 236 union {
237 u16 keycode; /* For KE_KEY */
238 struct { /* For KE_SW */
239 u8 code;
240 u8 value;
241 } sw;
242 };
237}; 243};
238 244
239enum { KE_END, KE_KEY, KE_WIFI, KE_BLUETOOTH }; 245enum { KE_END, KE_KEY, KE_SW, KE_WIFI, KE_BLUETOOTH };
246
247#define FE_MAIL_LED 0x01
248#define FE_WIFI_LED 0x02
249#define FE_UNTESTED 0x80
240 250
241static const struct key_entry *keymap; /* = NULL; Current key map */ 251static const struct key_entry *keymap; /* = NULL; Current key map */
242static int have_wifi; 252static int have_wifi;
@@ -261,104 +271,301 @@ static struct key_entry keymap_empty[] = {
261}; 271};
262 272
263static struct key_entry keymap_fs_amilo_pro_v2000[] = { 273static struct key_entry keymap_fs_amilo_pro_v2000[] = {
264 { KE_KEY, 0x01, KEY_HELP }, 274 { KE_KEY, 0x01, {KEY_HELP} },
265 { KE_KEY, 0x11, KEY_PROG1 }, 275 { KE_KEY, 0x11, {KEY_PROG1} },
266 { KE_KEY, 0x12, KEY_PROG2 }, 276 { KE_KEY, 0x12, {KEY_PROG2} },
267 { KE_WIFI, 0x30, 0 }, 277 { KE_WIFI, 0x30 },
268 { KE_KEY, 0x31, KEY_MAIL }, 278 { KE_KEY, 0x31, {KEY_MAIL} },
269 { KE_KEY, 0x36, KEY_WWW }, 279 { KE_KEY, 0x36, {KEY_WWW} },
270 { KE_END, 0 } 280 { KE_END, 0 }
271}; 281};
272 282
273static struct key_entry keymap_fujitsu_n3510[] = { 283static struct key_entry keymap_fujitsu_n3510[] = {
274 { KE_KEY, 0x11, KEY_PROG1 }, 284 { KE_KEY, 0x11, {KEY_PROG1} },
275 { KE_KEY, 0x12, KEY_PROG2 }, 285 { KE_KEY, 0x12, {KEY_PROG2} },
276 { KE_KEY, 0x36, KEY_WWW }, 286 { KE_KEY, 0x36, {KEY_WWW} },
277 { KE_KEY, 0x31, KEY_MAIL }, 287 { KE_KEY, 0x31, {KEY_MAIL} },
278 { KE_KEY, 0x71, KEY_STOPCD }, 288 { KE_KEY, 0x71, {KEY_STOPCD} },
279 { KE_KEY, 0x72, KEY_PLAYPAUSE }, 289 { KE_KEY, 0x72, {KEY_PLAYPAUSE} },
280 { KE_KEY, 0x74, KEY_REWIND }, 290 { KE_KEY, 0x74, {KEY_REWIND} },
281 { KE_KEY, 0x78, KEY_FORWARD }, 291 { KE_KEY, 0x78, {KEY_FORWARD} },
282 { KE_END, 0 } 292 { KE_END, 0 }
283}; 293};
284 294
285static struct key_entry keymap_wistron_ms2111[] = { 295static struct key_entry keymap_wistron_ms2111[] = {
286 { KE_KEY, 0x11, KEY_PROG1 }, 296 { KE_KEY, 0x11, {KEY_PROG1} },
287 { KE_KEY, 0x12, KEY_PROG2 }, 297 { KE_KEY, 0x12, {KEY_PROG2} },
288 { KE_KEY, 0x13, KEY_PROG3 }, 298 { KE_KEY, 0x13, {KEY_PROG3} },
289 { KE_KEY, 0x31, KEY_MAIL }, 299 { KE_KEY, 0x31, {KEY_MAIL} },
290 { KE_KEY, 0x36, KEY_WWW }, 300 { KE_KEY, 0x36, {KEY_WWW} },
291 { KE_END, 0 } 301 { KE_END, FE_MAIL_LED }
302};
303
304static struct key_entry keymap_wistron_md40100[] = {
305 { KE_KEY, 0x01, {KEY_HELP} },
306 { KE_KEY, 0x02, {KEY_CONFIG} },
307 { KE_KEY, 0x31, {KEY_MAIL} },
308 { KE_KEY, 0x36, {KEY_WWW} },
309 { KE_KEY, 0x37, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
310 { KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
292}; 311};
293 312
294static struct key_entry keymap_wistron_ms2141[] = { 313static struct key_entry keymap_wistron_ms2141[] = {
295 { KE_KEY, 0x11, KEY_PROG1 }, 314 { KE_KEY, 0x11, {KEY_PROG1} },
296 { KE_KEY, 0x12, KEY_PROG2 }, 315 { KE_KEY, 0x12, {KEY_PROG2} },
297 { KE_WIFI, 0x30, 0 }, 316 { KE_WIFI, 0x30 },
298 { KE_KEY, 0x22, KEY_REWIND }, 317 { KE_KEY, 0x22, {KEY_REWIND} },
299 { KE_KEY, 0x23, KEY_FORWARD }, 318 { KE_KEY, 0x23, {KEY_FORWARD} },
300 { KE_KEY, 0x24, KEY_PLAYPAUSE }, 319 { KE_KEY, 0x24, {KEY_PLAYPAUSE} },
301 { KE_KEY, 0x25, KEY_STOPCD }, 320 { KE_KEY, 0x25, {KEY_STOPCD} },
302 { KE_KEY, 0x31, KEY_MAIL }, 321 { KE_KEY, 0x31, {KEY_MAIL} },
303 { KE_KEY, 0x36, KEY_WWW }, 322 { KE_KEY, 0x36, {KEY_WWW} },
304 { KE_END, 0 } 323 { KE_END, 0 }
305}; 324};
306 325
307static struct key_entry keymap_acer_aspire_1500[] = { 326static struct key_entry keymap_acer_aspire_1500[] = {
308 { KE_KEY, 0x11, KEY_PROG1 }, 327 { KE_KEY, 0x01, {KEY_HELP} },
309 { KE_KEY, 0x12, KEY_PROG2 }, 328 { KE_KEY, 0x03, {KEY_POWER} },
310 { KE_WIFI, 0x30, 0 }, 329 { KE_KEY, 0x11, {KEY_PROG1} },
311 { KE_KEY, 0x31, KEY_MAIL }, 330 { KE_KEY, 0x12, {KEY_PROG2} },
312 { KE_KEY, 0x36, KEY_WWW }, 331 { KE_WIFI, 0x30 },
313 { KE_BLUETOOTH, 0x44, 0 }, 332 { KE_KEY, 0x31, {KEY_MAIL} },
314 { KE_END, 0 } 333 { KE_KEY, 0x36, {KEY_WWW} },
334 { KE_KEY, 0x49, {KEY_CONFIG} },
335 { KE_BLUETOOTH, 0x44 },
336 { KE_END, FE_UNTESTED }
337};
338
339static struct key_entry keymap_acer_aspire_1600[] = {
340 { KE_KEY, 0x01, {KEY_HELP} },
341 { KE_KEY, 0x03, {KEY_POWER} },
342 { KE_KEY, 0x08, {KEY_MUTE} },
343 { KE_KEY, 0x11, {KEY_PROG1} },
344 { KE_KEY, 0x12, {KEY_PROG2} },
345 { KE_KEY, 0x13, {KEY_PROG3} },
346 { KE_KEY, 0x31, {KEY_MAIL} },
347 { KE_KEY, 0x36, {KEY_WWW} },
348 { KE_KEY, 0x49, {KEY_CONFIG} },
349 { KE_WIFI, 0x30 },
350 { KE_BLUETOOTH, 0x44 },
351 { KE_END, FE_MAIL_LED | FE_UNTESTED }
352};
353
354/* 3020 has been tested */
355static struct key_entry keymap_acer_aspire_5020[] = {
356 { KE_KEY, 0x01, {KEY_HELP} },
357 { KE_KEY, 0x03, {KEY_POWER} },
358 { KE_KEY, 0x05, {KEY_SWITCHVIDEOMODE} }, /* Display selection */
359 { KE_KEY, 0x11, {KEY_PROG1} },
360 { KE_KEY, 0x12, {KEY_PROG2} },
361 { KE_KEY, 0x31, {KEY_MAIL} },
362 { KE_KEY, 0x36, {KEY_WWW} },
363 { KE_KEY, 0x6a, {KEY_CONFIG} },
364 { KE_WIFI, 0x30 },
365 { KE_BLUETOOTH, 0x44 },
366 { KE_END, FE_MAIL_LED | FE_UNTESTED }
367};
368
369static struct key_entry keymap_acer_travelmate_2410[] = {
370 { KE_KEY, 0x01, {KEY_HELP} },
371 { KE_KEY, 0x6d, {KEY_POWER} },
372 { KE_KEY, 0x11, {KEY_PROG1} },
373 { KE_KEY, 0x12, {KEY_PROG2} },
374 { KE_KEY, 0x31, {KEY_MAIL} },
375 { KE_KEY, 0x36, {KEY_WWW} },
376 { KE_KEY, 0x6a, {KEY_CONFIG} },
377 { KE_WIFI, 0x30 },
378 { KE_BLUETOOTH, 0x44 },
379 { KE_END, FE_MAIL_LED | FE_UNTESTED }
380};
381
382static struct key_entry keymap_acer_travelmate_110[] = {
383 { KE_KEY, 0x01, {KEY_HELP} },
384 { KE_KEY, 0x02, {KEY_CONFIG} },
385 { KE_KEY, 0x03, {KEY_POWER} },
386 { KE_KEY, 0x08, {KEY_MUTE} },
387 { KE_KEY, 0x11, {KEY_PROG1} },
388 { KE_KEY, 0x12, {KEY_PROG2} },
389 { KE_KEY, 0x20, {KEY_VOLUMEUP} },
390 { KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
391 { KE_KEY, 0x31, {KEY_MAIL} },
392 { KE_KEY, 0x36, {KEY_WWW} },
393 { KE_SW, 0x4a, {.sw = {SW_LID, 1}} }, /* lid close */
394 { KE_SW, 0x4b, {.sw = {SW_LID, 0}} }, /* lid open */
395 { KE_WIFI, 0x30 },
396 { KE_END, FE_MAIL_LED | FE_UNTESTED }
397};
398
399static struct key_entry keymap_acer_travelmate_300[] = {
400 { KE_KEY, 0x01, {KEY_HELP} },
401 { KE_KEY, 0x02, {KEY_CONFIG} },
402 { KE_KEY, 0x03, {KEY_POWER} },
403 { KE_KEY, 0x08, {KEY_MUTE} },
404 { KE_KEY, 0x11, {KEY_PROG1} },
405 { KE_KEY, 0x12, {KEY_PROG2} },
406 { KE_KEY, 0x20, {KEY_VOLUMEUP} },
407 { KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
408 { KE_KEY, 0x31, {KEY_MAIL} },
409 { KE_KEY, 0x36, {KEY_WWW} },
410 { KE_WIFI, 0x30 },
411 { KE_BLUETOOTH, 0x44 },
412 { KE_END, FE_MAIL_LED | FE_UNTESTED }
413};
414
415static struct key_entry keymap_acer_travelmate_380[] = {
416 { KE_KEY, 0x01, {KEY_HELP} },
417 { KE_KEY, 0x02, {KEY_CONFIG} },
418 { KE_KEY, 0x03, {KEY_POWER} }, /* not 370 */
419 { KE_KEY, 0x11, {KEY_PROG1} },
420 { KE_KEY, 0x12, {KEY_PROG2} },
421 { KE_KEY, 0x13, {KEY_PROG3} },
422 { KE_KEY, 0x31, {KEY_MAIL} },
423 { KE_KEY, 0x36, {KEY_WWW} },
424 { KE_WIFI, 0x30 },
425 { KE_END, FE_MAIL_LED | FE_UNTESTED }
426};
427
428/* unusual map */
429static struct key_entry keymap_acer_travelmate_220[] = {
430 { KE_KEY, 0x01, {KEY_HELP} },
431 { KE_KEY, 0x02, {KEY_CONFIG} },
432 { KE_KEY, 0x11, {KEY_MAIL} },
433 { KE_KEY, 0x12, {KEY_WWW} },
434 { KE_KEY, 0x13, {KEY_PROG2} },
435 { KE_KEY, 0x31, {KEY_PROG1} },
436 { KE_END, FE_WIFI_LED | FE_UNTESTED }
437};
438
439static struct key_entry keymap_acer_travelmate_230[] = {
440 { KE_KEY, 0x01, {KEY_HELP} },
441 { KE_KEY, 0x02, {KEY_CONFIG} },
442 { KE_KEY, 0x11, {KEY_PROG1} },
443 { KE_KEY, 0x12, {KEY_PROG2} },
444 { KE_KEY, 0x31, {KEY_MAIL} },
445 { KE_KEY, 0x36, {KEY_WWW} },
446 { KE_END, FE_WIFI_LED | FE_UNTESTED }
315}; 447};
316 448
317static struct key_entry keymap_acer_travelmate_240[] = { 449static struct key_entry keymap_acer_travelmate_240[] = {
318 { KE_KEY, 0x31, KEY_MAIL }, 450 { KE_KEY, 0x01, {KEY_HELP} },
319 { KE_KEY, 0x36, KEY_WWW }, 451 { KE_KEY, 0x02, {KEY_CONFIG} },
320 { KE_KEY, 0x11, KEY_PROG1 }, 452 { KE_KEY, 0x03, {KEY_POWER} },
321 { KE_KEY, 0x12, KEY_PROG2 }, 453 { KE_KEY, 0x08, {KEY_MUTE} },
322 { KE_BLUETOOTH, 0x44, 0 }, 454 { KE_KEY, 0x31, {KEY_MAIL} },
323 { KE_WIFI, 0x30, 0 }, 455 { KE_KEY, 0x36, {KEY_WWW} },
324 { KE_END, 0 } 456 { KE_KEY, 0x11, {KEY_PROG1} },
457 { KE_KEY, 0x12, {KEY_PROG2} },
458 { KE_BLUETOOTH, 0x44 },
459 { KE_WIFI, 0x30 },
460 { KE_END, FE_UNTESTED }
461};
462
463static struct key_entry keymap_acer_travelmate_350[] = {
464 { KE_KEY, 0x01, {KEY_HELP} },
465 { KE_KEY, 0x02, {KEY_CONFIG} },
466 { KE_KEY, 0x11, {KEY_PROG1} },
467 { KE_KEY, 0x12, {KEY_PROG2} },
468 { KE_KEY, 0x13, {KEY_MAIL} },
469 { KE_KEY, 0x14, {KEY_PROG3} },
470 { KE_KEY, 0x15, {KEY_WWW} },
471 { KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
472};
473
474static struct key_entry keymap_acer_travelmate_360[] = {
475 { KE_KEY, 0x01, {KEY_HELP} },
476 { KE_KEY, 0x02, {KEY_CONFIG} },
477 { KE_KEY, 0x11, {KEY_PROG1} },
478 { KE_KEY, 0x12, {KEY_PROG2} },
479 { KE_KEY, 0x13, {KEY_MAIL} },
480 { KE_KEY, 0x14, {KEY_PROG3} },
481 { KE_KEY, 0x15, {KEY_WWW} },
482 { KE_KEY, 0x40, {KEY_WLAN} },
483 { KE_END, FE_WIFI_LED | FE_UNTESTED } /* no mail led */
325}; 484};
326 485
327/* Wifi subsystem only activates the led. Therefore we need to pass 486/* Wifi subsystem only activates the led. Therefore we need to pass
328 * wifi event as a normal key, then userspace can really change the wifi state. 487 * wifi event as a normal key, then userspace can really change the wifi state.
329 * TODO we need to export led state to userspace (wifi and mail) */ 488 * TODO we need to export led state to userspace (wifi and mail) */
330static struct key_entry keymap_acer_travelmate_610[] = { 489static struct key_entry keymap_acer_travelmate_610[] = {
331 { KE_KEY, 0x01, KEY_HELP }, 490 { KE_KEY, 0x01, {KEY_HELP} },
332 { KE_KEY, 0x02, KEY_CONFIG }, 491 { KE_KEY, 0x02, {KEY_CONFIG} },
333 { KE_KEY, 0x11, KEY_PROG1 }, 492 { KE_KEY, 0x11, {KEY_PROG1} },
334 { KE_KEY, 0x12, KEY_PROG2 }, 493 { KE_KEY, 0x12, {KEY_PROG3} },
335 { KE_KEY, 0x13, KEY_PROG3 }, 494 { KE_KEY, 0x13, {KEY_PROG3} },
336 { KE_KEY, 0x14, KEY_MAIL }, 495 { KE_KEY, 0x14, {KEY_MAIL} },
337 { KE_KEY, 0x15, KEY_WWW }, 496 { KE_KEY, 0x15, {KEY_WWW} },
338 { KE_KEY, 0x40, KEY_WLAN }, /* Wifi */ 497 { KE_KEY, 0x40, {KEY_WLAN} },
339 { KE_END, 0 } 498 { KE_END, FE_MAIL_LED | FE_WIFI_LED }
499};
500
501static struct key_entry keymap_acer_travelmate_630[] = {
502 { KE_KEY, 0x01, {KEY_HELP} },
503 { KE_KEY, 0x02, {KEY_CONFIG} },
504 { KE_KEY, 0x03, {KEY_POWER} },
505 { KE_KEY, 0x08, {KEY_MUTE} }, /* not 620 */
506 { KE_KEY, 0x11, {KEY_PROG1} },
507 { KE_KEY, 0x12, {KEY_PROG2} },
508 { KE_KEY, 0x13, {KEY_PROG3} },
509 { KE_KEY, 0x20, {KEY_VOLUMEUP} },
510 { KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
511 { KE_KEY, 0x31, {KEY_MAIL} },
512 { KE_KEY, 0x36, {KEY_WWW} },
513 { KE_WIFI, 0x30 },
514 { KE_END, FE_MAIL_LED | FE_UNTESTED }
340}; 515};
341 516
342static struct key_entry keymap_aopen_1559as[] = { 517static struct key_entry keymap_aopen_1559as[] = {
343 { KE_KEY, 0x01, KEY_HELP }, 518 { KE_KEY, 0x01, {KEY_HELP} },
344 { KE_KEY, 0x06, KEY_PROG3 }, 519 { KE_KEY, 0x06, {KEY_PROG3} },
345 { KE_KEY, 0x11, KEY_PROG1 }, 520 { KE_KEY, 0x11, {KEY_PROG1} },
346 { KE_KEY, 0x12, KEY_PROG2 }, 521 { KE_KEY, 0x12, {KEY_PROG2} },
347 { KE_WIFI, 0x30, 0 }, 522 { KE_WIFI, 0x30 },
348 { KE_KEY, 0x31, KEY_MAIL }, 523 { KE_KEY, 0x31, {KEY_MAIL} },
349 { KE_KEY, 0x36, KEY_WWW }, 524 { KE_KEY, 0x36, {KEY_WWW} },
350 { KE_END, 0 }, 525 { KE_END, 0 },
351}; 526};
352 527
353static struct key_entry keymap_fs_amilo_d88x0[] = { 528static struct key_entry keymap_fs_amilo_d88x0[] = {
354 { KE_KEY, 0x01, KEY_HELP }, 529 { KE_KEY, 0x01, {KEY_HELP} },
355 { KE_KEY, 0x08, KEY_MUTE }, 530 { KE_KEY, 0x08, {KEY_MUTE} },
356 { KE_KEY, 0x31, KEY_MAIL }, 531 { KE_KEY, 0x31, {KEY_MAIL} },
357 { KE_KEY, 0x36, KEY_WWW }, 532 { KE_KEY, 0x36, {KEY_WWW} },
358 { KE_KEY, 0x11, KEY_PROG1 }, 533 { KE_KEY, 0x11, {KEY_PROG1} },
359 { KE_KEY, 0x12, KEY_PROG2 }, 534 { KE_KEY, 0x12, {KEY_PROG2} },
360 { KE_KEY, 0x13, KEY_PROG3 }, 535 { KE_KEY, 0x13, {KEY_PROG3} },
361 { KE_END, 0 } 536 { KE_END, FE_MAIL_LED | FE_WIFI_LED | FE_UNTESTED }
537};
538
539static struct key_entry keymap_wistron_md2900[] = {
540 { KE_KEY, 0x01, {KEY_HELP} },
541 { KE_KEY, 0x02, {KEY_CONFIG} },
542 { KE_KEY, 0x11, {KEY_PROG1} },
543 { KE_KEY, 0x12, {KEY_PROG2} },
544 { KE_KEY, 0x31, {KEY_MAIL} },
545 { KE_KEY, 0x36, {KEY_WWW} },
546 { KE_WIFI, 0x30 },
547 { KE_END, FE_MAIL_LED | FE_UNTESTED }
548};
549
550static struct key_entry keymap_wistron_md96500[] = {
551 { KE_KEY, 0x01, {KEY_HELP} },
552 { KE_KEY, 0x02, {KEY_CONFIG} },
553 { KE_KEY, 0x05, {KEY_SWITCHVIDEOMODE} }, /* Display selection */
554 { KE_KEY, 0x06, {KEY_DISPLAYTOGGLE} }, /* Display on/off */
555 { KE_KEY, 0x08, {KEY_MUTE} },
556 { KE_KEY, 0x11, {KEY_PROG1} },
557 { KE_KEY, 0x12, {KEY_PROG2} },
558 { KE_KEY, 0x20, {KEY_VOLUMEUP} },
559 { KE_KEY, 0x21, {KEY_VOLUMEDOWN} },
560 { KE_KEY, 0x22, {KEY_REWIND} },
561 { KE_KEY, 0x23, {KEY_FORWARD} },
562 { KE_KEY, 0x24, {KEY_PLAYPAUSE} },
563 { KE_KEY, 0x25, {KEY_STOPCD} },
564 { KE_KEY, 0x31, {KEY_MAIL} },
565 { KE_KEY, 0x36, {KEY_WWW} },
566 { KE_WIFI, 0x30 },
567 { KE_BLUETOOTH, 0x44 },
568 { KE_END, FE_UNTESTED }
362}; 569};
363 570
364/* 571/*
@@ -405,6 +612,133 @@ static struct dmi_system_id dmi_ids[] __initdata = {
405 }, 612 },
406 { 613 {
407 .callback = dmi_matched, 614 .callback = dmi_matched,
615 .ident = "Acer Aspire 1600",
616 .matches = {
617 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
618 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1600"),
619 },
620 .driver_data = keymap_acer_aspire_1600
621 },
622 {
623 .callback = dmi_matched,
624 .ident = "Acer Aspire 3020",
625 .matches = {
626 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
627 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 3020"),
628 },
629 .driver_data = keymap_acer_aspire_5020
630 },
631 {
632 .callback = dmi_matched,
633 .ident = "Acer Aspire 5020",
634 .matches = {
635 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
636 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5020"),
637 },
638 .driver_data = keymap_acer_aspire_5020
639 },
640 {
641 .callback = dmi_matched,
642 .ident = "Acer TravelMate 2100",
643 .matches = {
644 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
645 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2100"),
646 },
647 .driver_data = keymap_acer_aspire_5020
648 },
649 {
650 .callback = dmi_matched,
651 .ident = "Acer TravelMate 2410",
652 .matches = {
653 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
654 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2410"),
655 },
656 .driver_data = keymap_acer_travelmate_2410
657 },
658 {
659 .callback = dmi_matched,
660 .ident = "Acer TravelMate C300",
661 .matches = {
662 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
663 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C300"),
664 },
665 .driver_data = keymap_acer_travelmate_300
666 },
667 {
668 .callback = dmi_matched,
669 .ident = "Acer TravelMate C100",
670 .matches = {
671 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
672 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C100"),
673 },
674 .driver_data = keymap_acer_travelmate_300
675 },
676 {
677 .callback = dmi_matched,
678 .ident = "Acer TravelMate C110",
679 .matches = {
680 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
681 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate C110"),
682 },
683 .driver_data = keymap_acer_travelmate_110
684 },
685 {
686 .callback = dmi_matched,
687 .ident = "Acer TravelMate 380",
688 .matches = {
689 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
690 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 380"),
691 },
692 .driver_data = keymap_acer_travelmate_380
693 },
694 {
695 .callback = dmi_matched,
696 .ident = "Acer TravelMate 370",
697 .matches = {
698 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
699 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 370"),
700 },
701 .driver_data = keymap_acer_travelmate_380 /* keyboard minus 1 key */
702 },
703 {
704 .callback = dmi_matched,
705 .ident = "Acer TravelMate 220",
706 .matches = {
707 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
708 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 220"),
709 },
710 .driver_data = keymap_acer_travelmate_220
711 },
712 {
713 .callback = dmi_matched,
714 .ident = "Acer TravelMate 260",
715 .matches = {
716 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
717 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 260"),
718 },
719 .driver_data = keymap_acer_travelmate_220
720 },
721 {
722 .callback = dmi_matched,
723 .ident = "Acer TravelMate 230",
724 .matches = {
725 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
726 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 230"),
727 /* acerhk looks for "TravelMate F4..." ?! */
728 },
729 .driver_data = keymap_acer_travelmate_230
730 },
731 {
732 .callback = dmi_matched,
733 .ident = "Acer TravelMate 280",
734 .matches = {
735 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
736 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 280"),
737 },
738 .driver_data = keymap_acer_travelmate_230
739 },
740 {
741 .callback = dmi_matched,
408 .ident = "Acer TravelMate 240", 742 .ident = "Acer TravelMate 240",
409 .matches = { 743 .matches = {
410 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 744 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
@@ -414,6 +748,15 @@ static struct dmi_system_id dmi_ids[] __initdata = {
414 }, 748 },
415 { 749 {
416 .callback = dmi_matched, 750 .callback = dmi_matched,
751 .ident = "Acer TravelMate 250",
752 .matches = {
753 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
754 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 250"),
755 },
756 .driver_data = keymap_acer_travelmate_240
757 },
758 {
759 .callback = dmi_matched,
417 .ident = "Acer TravelMate 2424NWXCi", 760 .ident = "Acer TravelMate 2424NWXCi",
418 .matches = { 761 .matches = {
419 DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 762 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
@@ -423,6 +766,24 @@ static struct dmi_system_id dmi_ids[] __initdata = {
423 }, 766 },
424 { 767 {
425 .callback = dmi_matched, 768 .callback = dmi_matched,
769 .ident = "Acer TravelMate 350",
770 .matches = {
771 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
772 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 350"),
773 },
774 .driver_data = keymap_acer_travelmate_350
775 },
776 {
777 .callback = dmi_matched,
778 .ident = "Acer TravelMate 360",
779 .matches = {
780 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
781 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
782 },
783 .driver_data = keymap_acer_travelmate_360
784 },
785 {
786 .callback = dmi_matched,
426 .ident = "Acer TravelMate 610", 787 .ident = "Acer TravelMate 610",
427 .matches = { 788 .matches = {
428 DMI_MATCH(DMI_SYS_VENDOR, "ACER"), 789 DMI_MATCH(DMI_SYS_VENDOR, "ACER"),
@@ -432,6 +793,24 @@ static struct dmi_system_id dmi_ids[] __initdata = {
432 }, 793 },
433 { 794 {
434 .callback = dmi_matched, 795 .callback = dmi_matched,
796 .ident = "Acer TravelMate 620",
797 .matches = {
798 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
799 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 620"),
800 },
801 .driver_data = keymap_acer_travelmate_630
802 },
803 {
804 .callback = dmi_matched,
805 .ident = "Acer TravelMate 630",
806 .matches = {
807 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
808 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 630"),
809 },
810 .driver_data = keymap_acer_travelmate_630
811 },
812 {
813 .callback = dmi_matched,
435 .ident = "AOpen 1559AS", 814 .ident = "AOpen 1559AS",
436 .matches = { 815 .matches = {
437 DMI_MATCH(DMI_PRODUCT_NAME, "E2U"), 816 DMI_MATCH(DMI_PRODUCT_NAME, "E2U"),
@@ -450,6 +829,51 @@ static struct dmi_system_id dmi_ids[] __initdata = {
450 }, 829 },
451 { 830 {
452 .callback = dmi_matched, 831 .callback = dmi_matched,
832 .ident = "Medion MD 40100",
833 .matches = {
834 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
835 DMI_MATCH(DMI_PRODUCT_NAME, "WID2000"),
836 },
837 .driver_data = keymap_wistron_md40100
838 },
839 {
840 .callback = dmi_matched,
841 .ident = "Medion MD 2900",
842 .matches = {
843 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONNB"),
844 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2000"),
845 },
846 .driver_data = keymap_wistron_md2900
847 },
848 {
849 .callback = dmi_matched,
850 .ident = "Medion MD 96500",
851 .matches = {
852 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
853 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2040"),
854 },
855 .driver_data = keymap_wistron_md96500
856 },
857 {
858 .callback = dmi_matched,
859 .ident = "Medion MD 95400",
860 .matches = {
861 DMI_MATCH(DMI_SYS_VENDOR, "MEDIONPC"),
862 DMI_MATCH(DMI_PRODUCT_NAME, "WIM 2050"),
863 },
864 .driver_data = keymap_wistron_md96500
865 },
866 {
867 .callback = dmi_matched,
868 .ident = "Fujitsu Siemens Amilo D7820",
869 .matches = {
870 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), /* not sure */
871 DMI_MATCH(DMI_PRODUCT_NAME, "Amilo D"),
872 },
873 .driver_data = keymap_fs_amilo_d88x0
874 },
875 {
876 .callback = dmi_matched,
453 .ident = "Fujitsu Siemens Amilo D88x0", 877 .ident = "Fujitsu Siemens Amilo D88x0",
454 .matches = { 878 .matches = {
455 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 879 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
@@ -500,12 +924,28 @@ static int __devinit setup_input_dev(void)
500 input_dev->cdev.dev = &wistron_device->dev; 924 input_dev->cdev.dev = &wistron_device->dev;
501 925
502 for (key = keymap; key->type != KE_END; key++) { 926 for (key = keymap; key->type != KE_END; key++) {
503 if (key->type == KE_KEY) { 927 switch (key->type) {
504 input_dev->evbit[LONG(EV_KEY)] = BIT(EV_KEY); 928 case KE_KEY:
505 set_bit(key->keycode, input_dev->keybit); 929 set_bit(EV_KEY, input_dev->evbit);
930 set_bit(key->keycode, input_dev->keybit);
931 break;
932
933 case KE_SW:
934 set_bit(EV_SW, input_dev->evbit);
935 set_bit(key->sw.code, input_dev->swbit);
936 break;
937
938 default:
939 ;
506 } 940 }
507 } 941 }
508 942
943 /* reads information flags on KE_END */
944 if (key->code & FE_UNTESTED)
945 printk(KERN_WARNING "Untested laptop multimedia keys, "
946 "please report success or failure to eric.piel"
947 "@tremplin-utc.net\n");
948
509 error = input_register_device(input_dev); 949 error = input_register_device(input_dev);
510 if (error) { 950 if (error) {
511 input_free_device(input_dev); 951 input_free_device(input_dev);
@@ -523,6 +963,12 @@ static void report_key(unsigned keycode)
523 input_sync(input_dev); 963 input_sync(input_dev);
524} 964}
525 965
966static void report_switch(unsigned code, int value)
967{
968 input_report_switch(input_dev, code, value);
969 input_sync(input_dev);
970}
971
526 /* Driver core */ 972 /* Driver core */
527 973
528static int wifi_enabled; 974static int wifi_enabled;
@@ -543,6 +989,10 @@ static void handle_key(u8 code)
543 report_key(key->keycode); 989 report_key(key->keycode);
544 break; 990 break;
545 991
992 case KE_SW:
993 report_switch(key->sw.code, key->sw.value);
994 break;
995
546 case KE_WIFI: 996 case KE_WIFI:
547 if (have_wifi) { 997 if (have_wifi) {
548 wifi_enabled = !wifi_enabled; 998 wifi_enabled = !wifi_enabled;
@@ -558,6 +1008,7 @@ static void handle_key(u8 code)
558 break; 1008 break;
559 1009
560 case KE_END: 1010 case KE_END:
1011 break;
561 default: 1012 default:
562 BUG(); 1013 BUG();
563 } 1014 }
diff --git a/include/linux/input.h b/include/linux/input.h
index a51d6cf6824c..9bd984b2d122 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -506,6 +506,7 @@ struct input_absinfo {
506#define KEY_VOICEMAIL 0x1ac 506#define KEY_VOICEMAIL 0x1ac
507#define KEY_ADDRESSBOOK 0x1ad 507#define KEY_ADDRESSBOOK 0x1ad
508#define KEY_MESSENGER 0x1ae 508#define KEY_MESSENGER 0x1ae
509#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
509 510
510#define KEY_DEL_EOL 0x1c0 511#define KEY_DEL_EOL 0x1c0
511#define KEY_DEL_EOS 0x1c1 512#define KEY_DEL_EOS 0x1c1