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"),
142 * Some Fujitsu notebooks are having trouble with touchpads if
143 * active multiplexing mode is activated. Luckily they don't have
144 * external PS/2 ports so we can safely disable it.
145 * ... apparently some Toshibas don't like MUX mode either and
146 * die horrible death on reboot.
148 static struct dmi_system_id __initdata i8042_dmi_nomux_table
[] = {
150 .ident
= "Fujitsu Lifebook P7010/P7010D",
152 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
153 DMI_MATCH(DMI_PRODUCT_NAME
, "P7010"),
157 .ident
= "Fujitsu Lifebook P7010",
159 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
160 DMI_MATCH(DMI_PRODUCT_NAME
, "0000000000"),
164 .ident
= "Fujitsu Lifebook P5020D",
166 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
167 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook P Series"),
171 .ident
= "Fujitsu Lifebook S2000",
173 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
174 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S Series"),
178 .ident
= "Fujitsu Lifebook S6230",
180 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
181 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S6230"),
185 .ident
= "Fujitsu T70H",
187 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
188 DMI_MATCH(DMI_PRODUCT_NAME
, "FMVLT70H"),
192 .ident
= "Fujitsu-Siemens Lifebook T3010",
194 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
195 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK T3010"),
199 .ident
= "Fujitsu-Siemens Lifebook E4010",
201 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
202 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK E4010"),
206 .ident
= "Fujitsu-Siemens Amilo Pro 2010",
208 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
209 DMI_MATCH(DMI_PRODUCT_NAME
, "AMILO Pro V2010"),
213 .ident
= "Fujitsu-Siemens Amilo Pro 2030",
215 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
216 DMI_MATCH(DMI_PRODUCT_NAME
, "AMILO PRO V2030"),
221 * No data is coming from the touchscreen unless KBC
224 .ident
= "Panasonic CF-29",
226 DMI_MATCH(DMI_SYS_VENDOR
, "Matsushita"),
227 DMI_MATCH(DMI_PRODUCT_NAME
, "CF-29"),
232 * Errors on MUX ports are reported without raising AUXDATA
233 * causing "spurious NAK" messages.
235 .ident
= "HP Pavilion DV4017EA",
237 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
238 DMI_MATCH(DMI_PRODUCT_NAME
, "Pavilion dv4000 (EA032EA#ABF)"),
243 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
245 .ident
= "HP Pavilion ZT1000",
247 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
248 DMI_MATCH(DMI_PRODUCT_NAME
, "HP Pavilion Notebook PC"),
249 DMI_MATCH(DMI_PRODUCT_VERSION
, "HP Pavilion Notebook ZT1000"),
254 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
256 .ident
= "HP Pavilion DV4270ca",
258 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
259 DMI_MATCH(DMI_PRODUCT_NAME
, "Pavilion dv4000 (EH476UA#ABL)"),
263 .ident
= "Toshiba P10",
265 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
266 DMI_MATCH(DMI_PRODUCT_NAME
, "Satellite P10"),
270 .ident
= "Toshiba Equium A110",
272 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
273 DMI_MATCH(DMI_PRODUCT_NAME
, "EQUIUM A110"),
277 .ident
= "Alienware Sentia",
279 DMI_MATCH(DMI_SYS_VENDOR
, "ALIENWARE"),
280 DMI_MATCH(DMI_PRODUCT_NAME
, "Sentia"),
284 .ident
= "Sharp Actius MM20",
286 DMI_MATCH(DMI_SYS_VENDOR
, "SHARP"),
287 DMI_MATCH(DMI_PRODUCT_NAME
, "PC-MM20 Series"),
291 .ident
= "Sony Vaio FS-115b",
293 DMI_MATCH(DMI_SYS_VENDOR
, "Sony Corporation"),
294 DMI_MATCH(DMI_PRODUCT_NAME
, "VGN-FS115B"),
298 .ident
= "Amoi M636/A737",
300 DMI_MATCH(DMI_SYS_VENDOR
, "Amoi Electronics CO.,LTD."),
301 DMI_MATCH(DMI_PRODUCT_NAME
, "M636/A737 platform"),
305 .ident
= "Lenovo 3000 n100",
307 DMI_MATCH(DMI_SYS_VENDOR
, "LENOVO"),
308 DMI_MATCH(DMI_PRODUCT_NAME
, "076804U"),
312 .ident
= "Acer Aspire 1360",
314 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
315 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 1360"),
319 .ident
= "Gericom Bellagio",
321 DMI_MATCH(DMI_SYS_VENDOR
, "Gericom"),
322 DMI_MATCH(DMI_PRODUCT_NAME
, "N34AS6"),
329 static struct dmi_system_id __initdata i8042_dmi_nopnp_table
[] = {
331 .ident
= "Intel MBO Desktop D845PESV",
333 DMI_MATCH(DMI_BOARD_NAME
, "D845PESV"),
334 DMI_MATCH(DMI_BOARD_VENDOR
, "Intel Corporation"),
342 * Some Wistron based laptops need us to explicitly enable the 'Dritek
343 * keyboard extension' to make their extra keys start generating scancodes.
344 * Originally, this was just confined to older laptops, but a few Acer laptops
345 * have turned up in 2007 that also need this again.
347 static struct dmi_system_id __initdata i8042_dmi_dritek_table
[] = {
349 .ident
= "Acer Aspire 5630",
351 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
352 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5630"),
356 .ident
= "Acer Aspire 5650",
358 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
359 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5650"),
363 .ident
= "Acer Aspire 5680",
365 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
366 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5680"),
370 .ident
= "Acer Aspire 5720",
372 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
373 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5720"),
377 .ident
= "Acer Aspire 9110",
379 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
380 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 9110"),
384 .ident
= "Acer TravelMate 660",
386 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
387 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 660"),
391 .ident
= "Acer TravelMate 2490",
393 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
394 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 2490"),
398 .ident
= "Acer TravelMate 4280",
400 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
401 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 4280"),
407 #endif /* CONFIG_X86 */
410 #include <linux/pnp.h>
412 static int i8042_pnp_kbd_registered
;
413 static unsigned int i8042_pnp_kbd_devices
;
414 static int i8042_pnp_aux_registered
;
415 static unsigned int i8042_pnp_aux_devices
;
417 static int i8042_pnp_command_reg
;
418 static int i8042_pnp_data_reg
;
419 static int i8042_pnp_kbd_irq
;
420 static int i8042_pnp_aux_irq
;
422 static char i8042_pnp_kbd_name
[32];
423 static char i8042_pnp_aux_name
[32];
425 static int i8042_pnp_kbd_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
427 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
428 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
430 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
431 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
433 if (pnp_irq_valid(dev
,0))
434 i8042_pnp_kbd_irq
= pnp_irq(dev
, 0);
436 strlcpy(i8042_pnp_kbd_name
, did
->id
, sizeof(i8042_pnp_kbd_name
));
437 if (strlen(pnp_dev_name(dev
))) {
438 strlcat(i8042_pnp_kbd_name
, ":", sizeof(i8042_pnp_kbd_name
));
439 strlcat(i8042_pnp_kbd_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_kbd_name
));
442 i8042_pnp_kbd_devices
++;
446 static int i8042_pnp_aux_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
448 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
449 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
451 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
452 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
454 if (pnp_irq_valid(dev
, 0))
455 i8042_pnp_aux_irq
= pnp_irq(dev
, 0);
457 strlcpy(i8042_pnp_aux_name
, did
->id
, sizeof(i8042_pnp_aux_name
));
458 if (strlen(pnp_dev_name(dev
))) {
459 strlcat(i8042_pnp_aux_name
, ":", sizeof(i8042_pnp_aux_name
));
460 strlcat(i8042_pnp_aux_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_aux_name
));
463 i8042_pnp_aux_devices
++;
467 static struct pnp_device_id pnp_kbd_devids
[] = {
468 { .id
= "PNP0303", .driver_data
= 0 },
469 { .id
= "PNP030b", .driver_data
= 0 },
473 static struct pnp_driver i8042_pnp_kbd_driver
= {
475 .id_table
= pnp_kbd_devids
,
476 .probe
= i8042_pnp_kbd_probe
,
479 static struct pnp_device_id pnp_aux_devids
[] = {
480 { .id
= "FJC6000", .driver_data
= 0 },
481 { .id
= "FJC6001", .driver_data
= 0 },
482 { .id
= "PNP0f03", .driver_data
= 0 },
483 { .id
= "PNP0f0b", .driver_data
= 0 },
484 { .id
= "PNP0f0e", .driver_data
= 0 },
485 { .id
= "PNP0f12", .driver_data
= 0 },
486 { .id
= "PNP0f13", .driver_data
= 0 },
487 { .id
= "PNP0f19", .driver_data
= 0 },
488 { .id
= "PNP0f1c", .driver_data
= 0 },
489 { .id
= "SYN0801", .driver_data
= 0 },
493 static struct pnp_driver i8042_pnp_aux_driver
= {
495 .id_table
= pnp_aux_devids
,
496 .probe
= i8042_pnp_aux_probe
,
499 static void i8042_pnp_exit(void)
501 if (i8042_pnp_kbd_registered
) {
502 i8042_pnp_kbd_registered
= 0;
503 pnp_unregister_driver(&i8042_pnp_kbd_driver
);
506 if (i8042_pnp_aux_registered
) {
507 i8042_pnp_aux_registered
= 0;
508 pnp_unregister_driver(&i8042_pnp_aux_driver
);
512 static int __init
i8042_pnp_init(void)
514 char kbd_irq_str
[4] = { 0 }, aux_irq_str
[4] = { 0 };
515 int pnp_data_busted
= 0;
519 if (dmi_check_system(i8042_dmi_nopnp_table
))
524 printk(KERN_INFO
"i8042: PNP detection disabled\n");
528 err
= pnp_register_driver(&i8042_pnp_kbd_driver
);
530 i8042_pnp_kbd_registered
= 1;
532 err
= pnp_register_driver(&i8042_pnp_aux_driver
);
534 i8042_pnp_aux_registered
= 1;
536 if (!i8042_pnp_kbd_devices
&& !i8042_pnp_aux_devices
) {
538 #if defined(__ia64__)
541 printk(KERN_INFO
"PNP: No PS/2 controller found. Probing ports directly.\n");
546 if (i8042_pnp_kbd_devices
)
547 snprintf(kbd_irq_str
, sizeof(kbd_irq_str
),
548 "%d", i8042_pnp_kbd_irq
);
549 if (i8042_pnp_aux_devices
)
550 snprintf(aux_irq_str
, sizeof(aux_irq_str
),
551 "%d", i8042_pnp_aux_irq
);
553 printk(KERN_INFO
"PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
554 i8042_pnp_kbd_name
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
556 i8042_pnp_data_reg
, i8042_pnp_command_reg
,
557 kbd_irq_str
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
560 #if defined(__ia64__)
561 if (!i8042_pnp_kbd_devices
)
563 if (!i8042_pnp_aux_devices
)
567 if (((i8042_pnp_data_reg
& ~0xf) == (i8042_data_reg
& ~0xf) &&
568 i8042_pnp_data_reg
!= i8042_data_reg
) ||
569 !i8042_pnp_data_reg
) {
571 "PNP: PS/2 controller has invalid data port %#x; "
572 "using default %#x\n",
573 i8042_pnp_data_reg
, i8042_data_reg
);
574 i8042_pnp_data_reg
= i8042_data_reg
;
578 if (((i8042_pnp_command_reg
& ~0xf) == (i8042_command_reg
& ~0xf) &&
579 i8042_pnp_command_reg
!= i8042_command_reg
) ||
580 !i8042_pnp_command_reg
) {
582 "PNP: PS/2 controller has invalid command port %#x; "
583 "using default %#x\n",
584 i8042_pnp_command_reg
, i8042_command_reg
);
585 i8042_pnp_command_reg
= i8042_command_reg
;
589 if (!i8042_nokbd
&& !i8042_pnp_kbd_irq
) {
591 "PNP: PS/2 controller doesn't have KBD irq; "
592 "using default %d\n", i8042_kbd_irq
);
593 i8042_pnp_kbd_irq
= i8042_kbd_irq
;
597 if (!i8042_noaux
&& !i8042_pnp_aux_irq
) {
598 if (!pnp_data_busted
&& i8042_pnp_kbd_irq
) {
600 "PNP: PS/2 appears to have AUX port disabled, "
601 "if this is incorrect please boot with "
606 "PNP: PS/2 controller doesn't have AUX irq; "
607 "using default %d\n", i8042_aux_irq
);
608 i8042_pnp_aux_irq
= i8042_aux_irq
;
612 i8042_data_reg
= i8042_pnp_data_reg
;
613 i8042_command_reg
= i8042_pnp_command_reg
;
614 i8042_kbd_irq
= i8042_pnp_kbd_irq
;
615 i8042_aux_irq
= i8042_pnp_aux_irq
;
621 static inline int i8042_pnp_init(void) { return 0; }
622 static inline void i8042_pnp_exit(void) { }
625 static int __init
i8042_platform_init(void)
630 * On ix86 platforms touching the i8042 data register region can do really
631 * bad things. Because of this the region is always reserved on ix86 boxes.
633 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
637 i8042_kbd_irq
= I8042_MAP_IRQ(1);
638 i8042_aux_irq
= I8042_MAP_IRQ(12);
640 retval
= i8042_pnp_init();
644 #if defined(__ia64__)
649 if (dmi_check_system(i8042_dmi_noloop_table
))
652 if (dmi_check_system(i8042_dmi_nomux_table
))
655 if (dmi_check_system(i8042_dmi_dritek_table
))
657 #endif /* CONFIG_X86 */
662 static inline void i8042_platform_exit(void)
667 #endif /* _I8042_X86IA64IO_H */