x86/amd-iommu: Add per IOMMU reference counting
[linux/fpc-iii.git] / drivers / input / serio / i8042-x86ia64io.h
bloba537925f76511ee0d1b5cb50e5f3d18d39f62a8d
1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
4 /*
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.
8 */
11 * Names.
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"
19 * IRQs.
22 #if defined(__ia64__)
23 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
24 #else
25 # define I8042_MAP_IRQ(x) (x)
26 #endif
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;
35 * Register numbers.
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);
66 #ifdef CONFIG_X86
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",
74 .matches = {
75 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
76 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
77 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
81 .ident = "ASUS G1S",
82 .matches = {
83 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
84 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
85 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
89 /* AUX LOOP command does not raise AUX IRQ */
90 .ident = "ASUS P65UP5",
91 .matches = {
92 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
93 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
94 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
98 .ident = "Compaq Proliant 8500",
99 .matches = {
100 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
101 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
102 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
106 .ident = "Compaq Proliant DL760",
107 .matches = {
108 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
109 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
110 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
114 .ident = "OQO Model 01",
115 .matches = {
116 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
117 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
118 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
122 /* AUX LOOP does not work properly */
123 .ident = "ULI EV4873",
124 .matches = {
125 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
126 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
127 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
131 .ident = "Microsoft Virtual Machine",
132 .matches = {
133 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
134 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
135 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
139 .ident = "Medion MAM 2070",
140 .matches = {
141 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
142 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
143 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
147 .ident = "Blue FB5601",
148 .matches = {
149 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
150 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
151 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
155 .ident = "Gigabyte M912",
156 .matches = {
157 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
158 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
159 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
163 .ident = "HP DV9700",
164 .matches = {
165 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
166 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
167 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
174 * Some Fujitsu notebooks are having trouble with touchpads if
175 * active multiplexing mode is activated. Luckily they don't have
176 * external PS/2 ports so we can safely disable it.
177 * ... apparently some Toshibas don't like MUX mode either and
178 * die horrible death on reboot.
180 static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
182 .ident = "Fujitsu Lifebook P7010/P7010D",
183 .matches = {
184 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
185 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
189 .ident = "Fujitsu Lifebook P7010",
190 .matches = {
191 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
192 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
196 .ident = "Fujitsu Lifebook P5020D",
197 .matches = {
198 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
199 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
203 .ident = "Fujitsu Lifebook S2000",
204 .matches = {
205 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
206 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
210 .ident = "Fujitsu Lifebook S6230",
211 .matches = {
212 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
213 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
217 .ident = "Fujitsu T70H",
218 .matches = {
219 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
220 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
224 .ident = "Fujitsu-Siemens Lifebook T3010",
225 .matches = {
226 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
227 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
231 .ident = "Fujitsu-Siemens Lifebook E4010",
232 .matches = {
233 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
234 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
238 .ident = "Fujitsu-Siemens Amilo Pro 2010",
239 .matches = {
240 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
241 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
245 .ident = "Fujitsu-Siemens Amilo Pro 2030",
246 .matches = {
247 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
248 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
253 * No data is coming from the touchscreen unless KBC
254 * is in legacy mode.
256 .ident = "Panasonic CF-29",
257 .matches = {
258 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
259 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
264 * Errors on MUX ports are reported without raising AUXDATA
265 * causing "spurious NAK" messages.
267 .ident = "HP Pavilion DV4017EA",
268 .matches = {
269 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
270 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
275 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
277 .ident = "HP Pavilion ZT1000",
278 .matches = {
279 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
280 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
281 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
286 * Like DV4017EA does not raise AUXERR for errors on MUX ports.
288 .ident = "HP Pavilion DV4270ca",
289 .matches = {
290 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
291 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
295 .ident = "Toshiba P10",
296 .matches = {
297 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
298 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
302 .ident = "Toshiba Equium A110",
303 .matches = {
304 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
305 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
309 .ident = "Alienware Sentia",
310 .matches = {
311 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
312 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
316 .ident = "Sharp Actius MM20",
317 .matches = {
318 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
319 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
323 .ident = "Sony Vaio FS-115b",
324 .matches = {
325 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
326 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
331 * Reset and GET ID commands issued via KBD port are
332 * sometimes being delivered to AUX3.
334 .ident = "Sony Vaio FZ-240E",
335 .matches = {
336 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
337 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
341 .ident = "Amoi M636/A737",
342 .matches = {
343 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
344 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
348 .ident = "Lenovo 3000 n100",
349 .matches = {
350 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
351 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
355 .ident = "Acer Aspire 1360",
356 .matches = {
357 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
358 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
362 .ident = "Gericom Bellagio",
363 .matches = {
364 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
365 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
369 .ident = "IBM 2656",
370 .matches = {
371 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
372 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
376 .ident = "Dell XPS M1530",
377 .matches = {
378 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
379 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
383 .ident = "Compal HEL80I",
384 .matches = {
385 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
386 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
390 .ident = "Dell Vostro 1510",
391 .matches = {
392 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
393 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
397 .ident = "Acer Aspire 5536",
398 .matches = {
399 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
400 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
401 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
407 static struct dmi_system_id __initdata i8042_dmi_reset_table[] = {
409 .ident = "MSI Wind U-100",
410 .matches = {
411 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
412 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
416 .ident = "LG Electronics X110",
417 .matches = {
418 DMI_MATCH(DMI_BOARD_NAME, "X110"),
419 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
423 .ident = "Acer Aspire One 150",
424 .matches = {
425 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
426 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
430 .ident = "Advent 4211",
431 .matches = {
432 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
433 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
437 .ident = "Medion Akoya Mini E1210",
438 .matches = {
439 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
440 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
444 .ident = "Mivvy M310",
445 .matches = {
446 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
447 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
453 #ifdef CONFIG_PNP
454 static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = {
456 .ident = "Intel MBO Desktop D845PESV",
457 .matches = {
458 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
459 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
463 .ident = "MSI Wind U-100",
464 .matches = {
465 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
466 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
472 static struct dmi_system_id __initdata i8042_dmi_laptop_table[] = {
474 .ident = "Portable",
475 .matches = {
476 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
480 .ident = "Laptop",
481 .matches = {
482 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
486 .ident = "Notebook",
487 .matches = {
488 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
492 .ident = "Sub-Notebook",
493 .matches = {
494 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
499 #endif
502 * Some Wistron based laptops need us to explicitly enable the 'Dritek
503 * keyboard extension' to make their extra keys start generating scancodes.
504 * Originally, this was just confined to older laptops, but a few Acer laptops
505 * have turned up in 2007 that also need this again.
507 static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
509 .ident = "Acer Aspire 5630",
510 .matches = {
511 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
512 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
516 .ident = "Acer Aspire 5650",
517 .matches = {
518 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
519 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
523 .ident = "Acer Aspire 5680",
524 .matches = {
525 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
526 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
530 .ident = "Acer Aspire 5720",
531 .matches = {
532 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
533 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
537 .ident = "Acer Aspire 9110",
538 .matches = {
539 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
540 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
544 .ident = "Acer TravelMate 660",
545 .matches = {
546 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
547 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
551 .ident = "Acer TravelMate 2490",
552 .matches = {
553 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
554 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
558 .ident = "Acer TravelMate 4280",
559 .matches = {
560 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
561 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
567 #endif /* CONFIG_X86 */
569 #ifdef CONFIG_PNP
570 #include <linux/pnp.h>
572 static bool i8042_pnp_kbd_registered;
573 static unsigned int i8042_pnp_kbd_devices;
574 static bool i8042_pnp_aux_registered;
575 static unsigned int i8042_pnp_aux_devices;
577 static int i8042_pnp_command_reg;
578 static int i8042_pnp_data_reg;
579 static int i8042_pnp_kbd_irq;
580 static int i8042_pnp_aux_irq;
582 static char i8042_pnp_kbd_name[32];
583 static char i8042_pnp_aux_name[32];
585 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
587 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
588 i8042_pnp_data_reg = pnp_port_start(dev,0);
590 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
591 i8042_pnp_command_reg = pnp_port_start(dev, 1);
593 if (pnp_irq_valid(dev,0))
594 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
596 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
597 if (strlen(pnp_dev_name(dev))) {
598 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
599 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
602 i8042_pnp_kbd_devices++;
603 return 0;
606 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
608 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
609 i8042_pnp_data_reg = pnp_port_start(dev,0);
611 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
612 i8042_pnp_command_reg = pnp_port_start(dev, 1);
614 if (pnp_irq_valid(dev, 0))
615 i8042_pnp_aux_irq = pnp_irq(dev, 0);
617 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
618 if (strlen(pnp_dev_name(dev))) {
619 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
620 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
623 i8042_pnp_aux_devices++;
624 return 0;
627 static struct pnp_device_id pnp_kbd_devids[] = {
628 { .id = "PNP0303", .driver_data = 0 },
629 { .id = "PNP030b", .driver_data = 0 },
630 { .id = "", },
633 static struct pnp_driver i8042_pnp_kbd_driver = {
634 .name = "i8042 kbd",
635 .id_table = pnp_kbd_devids,
636 .probe = i8042_pnp_kbd_probe,
639 static struct pnp_device_id pnp_aux_devids[] = {
640 { .id = "FJC6000", .driver_data = 0 },
641 { .id = "FJC6001", .driver_data = 0 },
642 { .id = "PNP0f03", .driver_data = 0 },
643 { .id = "PNP0f0b", .driver_data = 0 },
644 { .id = "PNP0f0e", .driver_data = 0 },
645 { .id = "PNP0f12", .driver_data = 0 },
646 { .id = "PNP0f13", .driver_data = 0 },
647 { .id = "PNP0f19", .driver_data = 0 },
648 { .id = "PNP0f1c", .driver_data = 0 },
649 { .id = "SYN0801", .driver_data = 0 },
650 { .id = "", },
653 static struct pnp_driver i8042_pnp_aux_driver = {
654 .name = "i8042 aux",
655 .id_table = pnp_aux_devids,
656 .probe = i8042_pnp_aux_probe,
659 static void i8042_pnp_exit(void)
661 if (i8042_pnp_kbd_registered) {
662 i8042_pnp_kbd_registered = false;
663 pnp_unregister_driver(&i8042_pnp_kbd_driver);
666 if (i8042_pnp_aux_registered) {
667 i8042_pnp_aux_registered = false;
668 pnp_unregister_driver(&i8042_pnp_aux_driver);
672 static int __init i8042_pnp_init(void)
674 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
675 bool pnp_data_busted = false;
676 int err;
678 #ifdef CONFIG_X86
679 if (dmi_check_system(i8042_dmi_nopnp_table))
680 i8042_nopnp = true;
681 #endif
683 if (i8042_nopnp) {
684 printk(KERN_INFO "i8042: PNP detection disabled\n");
685 return 0;
688 err = pnp_register_driver(&i8042_pnp_kbd_driver);
689 if (!err)
690 i8042_pnp_kbd_registered = true;
692 err = pnp_register_driver(&i8042_pnp_aux_driver);
693 if (!err)
694 i8042_pnp_aux_registered = true;
696 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
697 i8042_pnp_exit();
698 #if defined(__ia64__)
699 return -ENODEV;
700 #else
701 printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
702 return 0;
703 #endif
706 if (i8042_pnp_kbd_devices)
707 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
708 "%d", i8042_pnp_kbd_irq);
709 if (i8042_pnp_aux_devices)
710 snprintf(aux_irq_str, sizeof(aux_irq_str),
711 "%d", i8042_pnp_aux_irq);
713 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
714 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
715 i8042_pnp_aux_name,
716 i8042_pnp_data_reg, i8042_pnp_command_reg,
717 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
718 aux_irq_str);
720 #if defined(__ia64__)
721 if (!i8042_pnp_kbd_devices)
722 i8042_nokbd = true;
723 if (!i8042_pnp_aux_devices)
724 i8042_noaux = true;
725 #endif
727 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
728 i8042_pnp_data_reg != i8042_data_reg) ||
729 !i8042_pnp_data_reg) {
730 printk(KERN_WARNING
731 "PNP: PS/2 controller has invalid data port %#x; "
732 "using default %#x\n",
733 i8042_pnp_data_reg, i8042_data_reg);
734 i8042_pnp_data_reg = i8042_data_reg;
735 pnp_data_busted = true;
738 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
739 i8042_pnp_command_reg != i8042_command_reg) ||
740 !i8042_pnp_command_reg) {
741 printk(KERN_WARNING
742 "PNP: PS/2 controller has invalid command port %#x; "
743 "using default %#x\n",
744 i8042_pnp_command_reg, i8042_command_reg);
745 i8042_pnp_command_reg = i8042_command_reg;
746 pnp_data_busted = true;
749 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
750 printk(KERN_WARNING
751 "PNP: PS/2 controller doesn't have KBD irq; "
752 "using default %d\n", i8042_kbd_irq);
753 i8042_pnp_kbd_irq = i8042_kbd_irq;
754 pnp_data_busted = true;
757 if (!i8042_noaux && !i8042_pnp_aux_irq) {
758 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
759 printk(KERN_WARNING
760 "PNP: PS/2 appears to have AUX port disabled, "
761 "if this is incorrect please boot with "
762 "i8042.nopnp\n");
763 i8042_noaux = true;
764 } else {
765 printk(KERN_WARNING
766 "PNP: PS/2 controller doesn't have AUX irq; "
767 "using default %d\n", i8042_aux_irq);
768 i8042_pnp_aux_irq = i8042_aux_irq;
772 i8042_data_reg = i8042_pnp_data_reg;
773 i8042_command_reg = i8042_pnp_command_reg;
774 i8042_kbd_irq = i8042_pnp_kbd_irq;
775 i8042_aux_irq = i8042_pnp_aux_irq;
777 #ifdef CONFIG_X86
778 i8042_bypass_aux_irq_test = !pnp_data_busted &&
779 dmi_check_system(i8042_dmi_laptop_table);
780 #endif
782 return 0;
785 #else
786 static inline int i8042_pnp_init(void) { return 0; }
787 static inline void i8042_pnp_exit(void) { }
788 #endif
790 static int __init i8042_platform_init(void)
792 int retval;
795 * On ix86 platforms touching the i8042 data register region can do really
796 * bad things. Because of this the region is always reserved on ix86 boxes.
798 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
799 * return -EBUSY;
802 i8042_kbd_irq = I8042_MAP_IRQ(1);
803 i8042_aux_irq = I8042_MAP_IRQ(12);
805 retval = i8042_pnp_init();
806 if (retval)
807 return retval;
809 #if defined(__ia64__)
810 i8042_reset = true;
811 #endif
813 #ifdef CONFIG_X86
814 if (dmi_check_system(i8042_dmi_reset_table))
815 i8042_reset = true;
817 if (dmi_check_system(i8042_dmi_noloop_table))
818 i8042_noloop = true;
820 if (dmi_check_system(i8042_dmi_nomux_table))
821 i8042_nomux = true;
823 if (dmi_check_system(i8042_dmi_dritek_table))
824 i8042_dritek = true;
825 #endif /* CONFIG_X86 */
827 return retval;
830 static inline void i8042_platform_exit(void)
832 i8042_pnp_exit();
835 #endif /* _I8042_X86IA64IO_H */