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"),
150 * Some Fujitsu notebooks are having trouble with touchpads if
151 * active multiplexing mode is activated. Luckily they don't have
152 * external PS/2 ports so we can safely disable it.
153 * ... apparently some Toshibas don't like MUX mode either and
154 * die horrible death on reboot.
156 static struct dmi_system_id __initdata i8042_dmi_nomux_table
[] = {
158 .ident
= "Fujitsu Lifebook P7010/P7010D",
160 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
161 DMI_MATCH(DMI_PRODUCT_NAME
, "P7010"),
165 .ident
= "Fujitsu Lifebook P7010",
167 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
168 DMI_MATCH(DMI_PRODUCT_NAME
, "0000000000"),
172 .ident
= "Fujitsu Lifebook P5020D",
174 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
175 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook P Series"),
179 .ident
= "Fujitsu Lifebook S2000",
181 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
182 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S Series"),
186 .ident
= "Fujitsu Lifebook S6230",
188 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
189 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S6230"),
193 .ident
= "Fujitsu T70H",
195 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
196 DMI_MATCH(DMI_PRODUCT_NAME
, "FMVLT70H"),
200 .ident
= "Fujitsu-Siemens Lifebook T3010",
202 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
203 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK T3010"),
207 .ident
= "Fujitsu-Siemens Lifebook E4010",
209 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
210 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK E4010"),
214 .ident
= "Fujitsu-Siemens Amilo Pro 2010",
216 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
217 DMI_MATCH(DMI_PRODUCT_NAME
, "AMILO Pro V2010"),
221 .ident
= "Fujitsu-Siemens Amilo Pro 2030",
223 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
224 DMI_MATCH(DMI_PRODUCT_NAME
, "AMILO PRO V2030"),
229 * No data is coming from the touchscreen unless KBC
232 .ident
= "Panasonic CF-29",
234 DMI_MATCH(DMI_SYS_VENDOR
, "Matsushita"),
235 DMI_MATCH(DMI_PRODUCT_NAME
, "CF-29"),
240 * Errors on MUX ports are reported without raising AUXDATA
241 * causing "spurious NAK" messages.
243 .ident
= "HP Pavilion DV4017EA",
245 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
246 DMI_MATCH(DMI_PRODUCT_NAME
, "Pavilion dv4000 (EA032EA#ABF)"),
251 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
253 .ident
= "HP Pavilion ZT1000",
255 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
256 DMI_MATCH(DMI_PRODUCT_NAME
, "HP Pavilion Notebook PC"),
257 DMI_MATCH(DMI_PRODUCT_VERSION
, "HP Pavilion Notebook ZT1000"),
262 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
264 .ident
= "HP Pavilion DV4270ca",
266 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
267 DMI_MATCH(DMI_PRODUCT_NAME
, "Pavilion dv4000 (EH476UA#ABL)"),
271 .ident
= "Toshiba P10",
273 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
274 DMI_MATCH(DMI_PRODUCT_NAME
, "Satellite P10"),
278 .ident
= "Toshiba Equium A110",
280 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
281 DMI_MATCH(DMI_PRODUCT_NAME
, "EQUIUM A110"),
285 .ident
= "Alienware Sentia",
287 DMI_MATCH(DMI_SYS_VENDOR
, "ALIENWARE"),
288 DMI_MATCH(DMI_PRODUCT_NAME
, "Sentia"),
292 .ident
= "Sharp Actius MM20",
294 DMI_MATCH(DMI_SYS_VENDOR
, "SHARP"),
295 DMI_MATCH(DMI_PRODUCT_NAME
, "PC-MM20 Series"),
299 .ident
= "Sony Vaio FS-115b",
301 DMI_MATCH(DMI_SYS_VENDOR
, "Sony Corporation"),
302 DMI_MATCH(DMI_PRODUCT_NAME
, "VGN-FS115B"),
306 .ident
= "Amoi M636/A737",
308 DMI_MATCH(DMI_SYS_VENDOR
, "Amoi Electronics CO.,LTD."),
309 DMI_MATCH(DMI_PRODUCT_NAME
, "M636/A737 platform"),
313 .ident
= "Lenovo 3000 n100",
315 DMI_MATCH(DMI_SYS_VENDOR
, "LENOVO"),
316 DMI_MATCH(DMI_PRODUCT_NAME
, "076804U"),
320 .ident
= "Acer Aspire 1360",
322 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
323 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 1360"),
327 .ident
= "Gericom Bellagio",
329 DMI_MATCH(DMI_SYS_VENDOR
, "Gericom"),
330 DMI_MATCH(DMI_PRODUCT_NAME
, "N34AS6"),
336 DMI_MATCH(DMI_SYS_VENDOR
, "IBM"),
337 DMI_MATCH(DMI_PRODUCT_NAME
, "2656"),
341 .ident
= "Dell XPS M1530",
343 DMI_MATCH(DMI_SYS_VENDOR
, "Dell Inc."),
344 DMI_MATCH(DMI_PRODUCT_NAME
, "XPS M1530"),
348 .ident
= "Compal HEL80I",
350 DMI_MATCH(DMI_SYS_VENDOR
, "COMPAL"),
351 DMI_MATCH(DMI_PRODUCT_NAME
, "HEL80I"),
358 static struct dmi_system_id __initdata i8042_dmi_nopnp_table
[] = {
360 .ident
= "Intel MBO Desktop D845PESV",
362 DMI_MATCH(DMI_BOARD_NAME
, "D845PESV"),
363 DMI_MATCH(DMI_BOARD_VENDOR
, "Intel Corporation"),
371 * Some Wistron based laptops need us to explicitly enable the 'Dritek
372 * keyboard extension' to make their extra keys start generating scancodes.
373 * Originally, this was just confined to older laptops, but a few Acer laptops
374 * have turned up in 2007 that also need this again.
376 static struct dmi_system_id __initdata i8042_dmi_dritek_table
[] = {
378 .ident
= "Acer Aspire 5630",
380 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
381 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5630"),
385 .ident
= "Acer Aspire 5650",
387 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
388 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5650"),
392 .ident
= "Acer Aspire 5680",
394 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
395 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5680"),
399 .ident
= "Acer Aspire 5720",
401 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
402 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 5720"),
406 .ident
= "Acer Aspire 9110",
408 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
409 DMI_MATCH(DMI_PRODUCT_NAME
, "Aspire 9110"),
413 .ident
= "Acer TravelMate 660",
415 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
416 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 660"),
420 .ident
= "Acer TravelMate 2490",
422 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
423 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 2490"),
427 .ident
= "Acer TravelMate 4280",
429 DMI_MATCH(DMI_SYS_VENDOR
, "Acer"),
430 DMI_MATCH(DMI_PRODUCT_NAME
, "TravelMate 4280"),
436 #endif /* CONFIG_X86 */
439 #include <linux/pnp.h>
441 static int i8042_pnp_kbd_registered
;
442 static unsigned int i8042_pnp_kbd_devices
;
443 static int i8042_pnp_aux_registered
;
444 static unsigned int i8042_pnp_aux_devices
;
446 static int i8042_pnp_command_reg
;
447 static int i8042_pnp_data_reg
;
448 static int i8042_pnp_kbd_irq
;
449 static int i8042_pnp_aux_irq
;
451 static char i8042_pnp_kbd_name
[32];
452 static char i8042_pnp_aux_name
[32];
454 static int i8042_pnp_kbd_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
456 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
457 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
459 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
460 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
462 if (pnp_irq_valid(dev
,0))
463 i8042_pnp_kbd_irq
= pnp_irq(dev
, 0);
465 strlcpy(i8042_pnp_kbd_name
, did
->id
, sizeof(i8042_pnp_kbd_name
));
466 if (strlen(pnp_dev_name(dev
))) {
467 strlcat(i8042_pnp_kbd_name
, ":", sizeof(i8042_pnp_kbd_name
));
468 strlcat(i8042_pnp_kbd_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_kbd_name
));
471 i8042_pnp_kbd_devices
++;
475 static int i8042_pnp_aux_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
477 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
478 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
480 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
481 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
483 if (pnp_irq_valid(dev
, 0))
484 i8042_pnp_aux_irq
= pnp_irq(dev
, 0);
486 strlcpy(i8042_pnp_aux_name
, did
->id
, sizeof(i8042_pnp_aux_name
));
487 if (strlen(pnp_dev_name(dev
))) {
488 strlcat(i8042_pnp_aux_name
, ":", sizeof(i8042_pnp_aux_name
));
489 strlcat(i8042_pnp_aux_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_aux_name
));
492 i8042_pnp_aux_devices
++;
496 static struct pnp_device_id pnp_kbd_devids
[] = {
497 { .id
= "PNP0303", .driver_data
= 0 },
498 { .id
= "PNP030b", .driver_data
= 0 },
502 static struct pnp_driver i8042_pnp_kbd_driver
= {
504 .id_table
= pnp_kbd_devids
,
505 .probe
= i8042_pnp_kbd_probe
,
508 static struct pnp_device_id pnp_aux_devids
[] = {
509 { .id
= "FJC6000", .driver_data
= 0 },
510 { .id
= "FJC6001", .driver_data
= 0 },
511 { .id
= "PNP0f03", .driver_data
= 0 },
512 { .id
= "PNP0f0b", .driver_data
= 0 },
513 { .id
= "PNP0f0e", .driver_data
= 0 },
514 { .id
= "PNP0f12", .driver_data
= 0 },
515 { .id
= "PNP0f13", .driver_data
= 0 },
516 { .id
= "PNP0f19", .driver_data
= 0 },
517 { .id
= "PNP0f1c", .driver_data
= 0 },
518 { .id
= "SYN0801", .driver_data
= 0 },
522 static struct pnp_driver i8042_pnp_aux_driver
= {
524 .id_table
= pnp_aux_devids
,
525 .probe
= i8042_pnp_aux_probe
,
528 static void i8042_pnp_exit(void)
530 if (i8042_pnp_kbd_registered
) {
531 i8042_pnp_kbd_registered
= 0;
532 pnp_unregister_driver(&i8042_pnp_kbd_driver
);
535 if (i8042_pnp_aux_registered
) {
536 i8042_pnp_aux_registered
= 0;
537 pnp_unregister_driver(&i8042_pnp_aux_driver
);
541 static int __init
i8042_pnp_init(void)
543 char kbd_irq_str
[4] = { 0 }, aux_irq_str
[4] = { 0 };
544 int pnp_data_busted
= 0;
548 if (dmi_check_system(i8042_dmi_nopnp_table
))
553 printk(KERN_INFO
"i8042: PNP detection disabled\n");
557 err
= pnp_register_driver(&i8042_pnp_kbd_driver
);
559 i8042_pnp_kbd_registered
= 1;
561 err
= pnp_register_driver(&i8042_pnp_aux_driver
);
563 i8042_pnp_aux_registered
= 1;
565 if (!i8042_pnp_kbd_devices
&& !i8042_pnp_aux_devices
) {
567 #if defined(__ia64__)
570 printk(KERN_INFO
"PNP: No PS/2 controller found. Probing ports directly.\n");
575 if (i8042_pnp_kbd_devices
)
576 snprintf(kbd_irq_str
, sizeof(kbd_irq_str
),
577 "%d", i8042_pnp_kbd_irq
);
578 if (i8042_pnp_aux_devices
)
579 snprintf(aux_irq_str
, sizeof(aux_irq_str
),
580 "%d", i8042_pnp_aux_irq
);
582 printk(KERN_INFO
"PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
583 i8042_pnp_kbd_name
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
585 i8042_pnp_data_reg
, i8042_pnp_command_reg
,
586 kbd_irq_str
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
589 #if defined(__ia64__)
590 if (!i8042_pnp_kbd_devices
)
592 if (!i8042_pnp_aux_devices
)
596 if (((i8042_pnp_data_reg
& ~0xf) == (i8042_data_reg
& ~0xf) &&
597 i8042_pnp_data_reg
!= i8042_data_reg
) ||
598 !i8042_pnp_data_reg
) {
600 "PNP: PS/2 controller has invalid data port %#x; "
601 "using default %#x\n",
602 i8042_pnp_data_reg
, i8042_data_reg
);
603 i8042_pnp_data_reg
= i8042_data_reg
;
607 if (((i8042_pnp_command_reg
& ~0xf) == (i8042_command_reg
& ~0xf) &&
608 i8042_pnp_command_reg
!= i8042_command_reg
) ||
609 !i8042_pnp_command_reg
) {
611 "PNP: PS/2 controller has invalid command port %#x; "
612 "using default %#x\n",
613 i8042_pnp_command_reg
, i8042_command_reg
);
614 i8042_pnp_command_reg
= i8042_command_reg
;
618 if (!i8042_nokbd
&& !i8042_pnp_kbd_irq
) {
620 "PNP: PS/2 controller doesn't have KBD irq; "
621 "using default %d\n", i8042_kbd_irq
);
622 i8042_pnp_kbd_irq
= i8042_kbd_irq
;
626 if (!i8042_noaux
&& !i8042_pnp_aux_irq
) {
627 if (!pnp_data_busted
&& i8042_pnp_kbd_irq
) {
629 "PNP: PS/2 appears to have AUX port disabled, "
630 "if this is incorrect please boot with "
635 "PNP: PS/2 controller doesn't have AUX irq; "
636 "using default %d\n", i8042_aux_irq
);
637 i8042_pnp_aux_irq
= i8042_aux_irq
;
641 i8042_data_reg
= i8042_pnp_data_reg
;
642 i8042_command_reg
= i8042_pnp_command_reg
;
643 i8042_kbd_irq
= i8042_pnp_kbd_irq
;
644 i8042_aux_irq
= i8042_pnp_aux_irq
;
650 static inline int i8042_pnp_init(void) { return 0; }
651 static inline void i8042_pnp_exit(void) { }
654 static int __init
i8042_platform_init(void)
659 * On ix86 platforms touching the i8042 data register region can do really
660 * bad things. Because of this the region is always reserved on ix86 boxes.
662 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
666 i8042_kbd_irq
= I8042_MAP_IRQ(1);
667 i8042_aux_irq
= I8042_MAP_IRQ(12);
669 retval
= i8042_pnp_init();
673 #if defined(__ia64__)
678 if (dmi_check_system(i8042_dmi_noloop_table
))
681 if (dmi_check_system(i8042_dmi_nomux_table
))
684 if (dmi_check_system(i8042_dmi_dritek_table
))
686 #endif /* CONFIG_X86 */
691 static inline void i8042_platform_exit(void)
696 #endif /* _I8042_X86IA64IO_H */