1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
14 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
15 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
16 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
23 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
25 # define I8042_MAP_IRQ(x) (x)
28 #define I8042_KBD_IRQ i8042_kbd_irq
29 #define I8042_AUX_IRQ i8042_aux_irq
31 static int i8042_kbd_irq;
32 static int i8042_aux_irq;
38 #define I8042_COMMAND_REG i8042_command_reg
39 #define I8042_STATUS_REG i8042_command_reg
40 #define I8042_DATA_REG i8042_data_reg
42 static int i8042_command_reg = 0x64;
43 static int i8042_data_reg = 0x60;
46 static inline int i8042_read_data(void)
48 return inb(I8042_DATA_REG);
51 static inline int i8042_read_status(void)
53 return inb(I8042_STATUS_REG);
56 static inline void i8042_write_data(int val)
58 outb(val, I8042_DATA_REG);
61 static inline void i8042_write_command(int val)
63 outb(val, I8042_COMMAND_REG);
68 #include <linux/dmi.h>
70 static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
72 /* AUX LOOP command does not raise AUX IRQ */
73 .ident = "Arima-Rioworks HDAMB",
75 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
76 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
77 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
81 /* AUX LOOP command does not raise AUX IRQ */
82 .ident = "ASUS P65UP5",
84 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
85 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
86 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
90 .ident = "Compaq Proliant 8500",
92 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
93 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
94 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
98 .ident = "Compaq Proliant DL760",
100 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
101 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
102 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
106 .ident = "OQO Model 01",
108 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
109 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
110 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
114 /* AUX LOOP does not work properly */
115 .ident = "ULI EV4873",
117 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
118 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
119 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
123 .ident = "Microsoft Virtual Machine",
125 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
126 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
127 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
131 .ident = "Medion MAM 2070",
133 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
134 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
135 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
139 .ident = "Blue FB5601",
141 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
142 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
143 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
147 .ident = "Gigabyte M912",
149 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
150 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
151 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
155 .ident = "HP DV9700",
157 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
158 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
159 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
166 * Some Fujitsu notebooks are having trouble with touchpads if
167 * active multiplexing mode is activated. Luckily they don't have
168 * external PS/2 ports so we can safely disable it.
169 * ... apparently some Toshibas don't like MUX mode either and
170 * die horrible death on reboot.
172 static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
174 .ident = "Fujitsu Lifebook P7010/P7010D",
176 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
177 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
181 .ident = "Fujitsu Lifebook P7010",
183 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
184 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
188 .ident = "Fujitsu Lifebook P5020D",
190 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
191 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
195 .ident = "Fujitsu Lifebook S2000",
197 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
198 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
202 .ident = "Fujitsu Lifebook S6230",
204 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
205 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
209 .ident = "Fujitsu T70H",
211 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
212 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
216 .ident = "Fujitsu-Siemens Lifebook T3010",
218 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
219 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
223 .ident = "Fujitsu-Siemens Lifebook E4010",
225 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
226 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
230 .ident = "Fujitsu-Siemens Amilo Pro 2010",
232 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
233 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
237 .ident = "Fujitsu-Siemens Amilo Pro 2030",
239 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
240 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
245 * No data is coming from the touchscreen unless KBC
248 .ident = "Panasonic CF-29",
250 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
251 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
256 * Errors on MUX ports are reported without raising AUXDATA
257 * causing "spurious NAK" messages.
259 .ident = "HP Pavilion DV4017EA",
261 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
262 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
267 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
269 .ident = "HP Pavilion ZT1000",
271 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
272 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
273 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
278 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
280 .ident = "HP Pavilion DV4270ca",
282 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
283 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
287 .ident = "Toshiba P10",
289 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
290 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
294 .ident = "Toshiba Equium A110",
296 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
297 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
301 .ident = "Alienware Sentia",
303 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
304 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
308 .ident = "Sharp Actius MM20",
310 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
311 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
315 .ident = "Sony Vaio FS-115b",
317 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
318 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
322 .ident = "Amoi M636/A737",
324 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
325 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
329 .ident = "Lenovo 3000 n100",
331 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
332 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
336 .ident = "Acer Aspire 1360",
338 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
339 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
343 .ident = "Gericom Bellagio",
345 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
346 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
352 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
353 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
357 .ident = "Dell XPS M1530",
359 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
360 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
364 .ident = "Compal HEL80I",
366 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
367 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
371 .ident = "Dell Vostro 1510",
373 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
374 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
380 static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
382 .ident = "MSI Wind U-100",
384 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
385 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
389 .ident = "LG Electronics X110",
391 DMI_MATCH(DMI_BOARD_NAME, "X110"),
392 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
396 .ident = "Acer Aspire One 150",
398 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
399 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
403 .ident = "Advent 4211",
405 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
406 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
410 .ident = "Medion Akoya Mini E1210",
412 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
413 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
417 .ident = "Mivvy M310",
419 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
420 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
427 static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = {
429 .ident = "Intel MBO Desktop D845PESV",
431 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
432 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
436 .ident = "MSI Wind U-100",
438 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
439 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
447 * Some Wistron based laptops need us to explicitly enable the 'Dritek
448 * keyboard extension' to make their extra keys start generating scancodes.
449 * Originally, this was just confined to older laptops, but a few Acer laptops
450 * have turned up in 2007 that also need this again.
452 static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
454 .ident = "Acer Aspire 5630",
456 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
457 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
461 .ident = "Acer Aspire 5650",
463 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
464 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
468 .ident = "Acer Aspire 5680",
470 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
471 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
475 .ident = "Acer Aspire 5720",
477 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
478 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
482 .ident = "Acer Aspire 9110",
484 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
485 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
489 .ident = "Acer TravelMate 660",
491 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
492 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
496 .ident = "Acer TravelMate 2490",
498 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
499 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
503 .ident = "Acer TravelMate 4280",
505 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
506 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
512 #endif /* CONFIG_X86 */
515 #include <linux/pnp.h>
517 static int i8042_pnp_kbd_registered;
518 static unsigned int i8042_pnp_kbd_devices;
519 static int i8042_pnp_aux_registered;
520 static unsigned int i8042_pnp_aux_devices;
522 static int i8042_pnp_command_reg;
523 static int i8042_pnp_data_reg;
524 static int i8042_pnp_kbd_irq;
525 static int i8042_pnp_aux_irq;
527 static char i8042_pnp_kbd_name[32];
528 static char i8042_pnp_aux_name[32];
530 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
532 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
533 i8042_pnp_data_reg = pnp_port_start(dev,0);
535 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
536 i8042_pnp_command_reg = pnp_port_start(dev, 1);
538 if (pnp_irq_valid(dev,0))
539 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
541 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
542 if (strlen(pnp_dev_name(dev))) {
543 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
544 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
547 i8042_pnp_kbd_devices++;
551 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
553 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
554 i8042_pnp_data_reg = pnp_port_start(dev,0);
556 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
557 i8042_pnp_command_reg = pnp_port_start(dev, 1);
559 if (pnp_irq_valid(dev, 0))
560 i8042_pnp_aux_irq = pnp_irq(dev, 0);
562 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
563 if (strlen(pnp_dev_name(dev))) {
564 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
565 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
568 i8042_pnp_aux_devices++;
572 static struct pnp_device_id pnp_kbd_devids[] = {
573 { .id = "PNP0303", .driver_data = 0 },
574 { .id = "PNP030b", .driver_data = 0 },
578 static struct pnp_driver i8042_pnp_kbd_driver = {
580 .id_table = pnp_kbd_devids,
581 .probe = i8042_pnp_kbd_probe,
584 static struct pnp_device_id pnp_aux_devids[] = {
585 { .id = "FJC6000", .driver_data = 0 },
586 { .id = "FJC6001", .driver_data = 0 },
587 { .id = "PNP0f03", .driver_data = 0 },
588 { .id = "PNP0f0b", .driver_data = 0 },
589 { .id = "PNP0f0e", .driver_data = 0 },
590 { .id = "PNP0f12", .driver_data = 0 },
591 { .id = "PNP0f13", .driver_data = 0 },
592 { .id = "PNP0f19", .driver_data = 0 },
593 { .id = "PNP0f1c", .driver_data = 0 },
594 { .id = "SYN0801", .driver_data = 0 },
598 static struct pnp_driver i8042_pnp_aux_driver = {
600 .id_table = pnp_aux_devids,
601 .probe = i8042_pnp_aux_probe,
604 static void i8042_pnp_exit(void)
606 if (i8042_pnp_kbd_registered) {
607 i8042_pnp_kbd_registered = 0;
608 pnp_unregister_driver(&i8042_pnp_kbd_driver);
611 if (i8042_pnp_aux_registered) {
612 i8042_pnp_aux_registered = 0;
613 pnp_unregister_driver(&i8042_pnp_aux_driver);
617 static int __init i8042_pnp_init(void)
619 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
620 int pnp_data_busted = 0;
624 if (dmi_check_system(i8042_dmi_nopnp_table))
629 printk(KERN_INFO "i8042: PNP detection disabled\n");
633 err = pnp_register_driver(&i8042_pnp_kbd_driver);
635 i8042_pnp_kbd_registered = 1;
637 err = pnp_register_driver(&i8042_pnp_aux_driver);
639 i8042_pnp_aux_registered = 1;
641 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
643 #if defined(__ia64__)
646 printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
651 if (i8042_pnp_kbd_devices)
652 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
653 "%d", i8042_pnp_kbd_irq);
654 if (i8042_pnp_aux_devices)
655 snprintf(aux_irq_str, sizeof(aux_irq_str),
656 "%d", i8042_pnp_aux_irq);
658 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
659 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
661 i8042_pnp_data_reg, i8042_pnp_command_reg,
662 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
665 #if defined(__ia64__)
666 if (!i8042_pnp_kbd_devices)
668 if (!i8042_pnp_aux_devices)
672 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
673 i8042_pnp_data_reg != i8042_data_reg) ||
674 !i8042_pnp_data_reg) {
676 "PNP: PS/2 controller has invalid data port %#x; "
677 "using default %#x\n",
678 i8042_pnp_data_reg, i8042_data_reg);
679 i8042_pnp_data_reg = i8042_data_reg;
683 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
684 i8042_pnp_command_reg != i8042_command_reg) ||
685 !i8042_pnp_command_reg) {
687 "PNP: PS/2 controller has invalid command port %#x; "
688 "using default %#x\n",
689 i8042_pnp_command_reg, i8042_command_reg);
690 i8042_pnp_command_reg = i8042_command_reg;
694 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
696 "PNP: PS/2 controller doesn't have KBD irq; "
697 "using default %d\n", i8042_kbd_irq);
698 i8042_pnp_kbd_irq = i8042_kbd_irq;
702 if (!i8042_noaux && !i8042_pnp_aux_irq) {
703 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
705 "PNP: PS/2 appears to have AUX port disabled, "
706 "if this is incorrect please boot with "
711 "PNP: PS/2 controller doesn't have AUX irq; "
712 "using default %d\n", i8042_aux_irq);
713 i8042_pnp_aux_irq = i8042_aux_irq;
717 i8042_data_reg = i8042_pnp_data_reg;
718 i8042_command_reg = i8042_pnp_command_reg;
719 i8042_kbd_irq = i8042_pnp_kbd_irq;
720 i8042_aux_irq = i8042_pnp_aux_irq;
726 static inline int i8042_pnp_init(void) { return 0; }
727 static inline void i8042_pnp_exit(void) { }
730 static int __init i8042_platform_init(void)
735 * On ix86 platforms touching the i8042 data register region can do really
736 * bad things. Because of this the region is always reserved on ix86 boxes.
738 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
742 i8042_kbd_irq = I8042_MAP_IRQ(1);
743 i8042_aux_irq = I8042_MAP_IRQ(12);
745 retval = i8042_pnp_init();
749 #if defined(__ia64__)
754 if (dmi_check_system(i8042_dmi_reset_table))
757 if (dmi_check_system(i8042_dmi_noloop_table))
760 if (dmi_check_system(i8042_dmi_nomux_table))
763 if (dmi_check_system(i8042_dmi_dritek_table))
765 #endif /* CONFIG_X86 */
770 static inline void i8042_platform_exit(void)
775 #endif /* _I8042_X86IA64IO_H */