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.
11 #include <asm/x86_init.h>
18 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
19 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
20 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
27 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
29 # define I8042_MAP_IRQ(x) (x)
32 #define I8042_KBD_IRQ i8042_kbd_irq
33 #define I8042_AUX_IRQ i8042_aux_irq
35 static int i8042_kbd_irq;
36 static int i8042_aux_irq;
42 #define I8042_COMMAND_REG i8042_command_reg
43 #define I8042_STATUS_REG i8042_command_reg
44 #define I8042_DATA_REG i8042_data_reg
46 static int i8042_command_reg = 0x64;
47 static int i8042_data_reg = 0x60;
50 static inline int i8042_read_data(void)
52 return inb(I8042_DATA_REG);
55 static inline int i8042_read_status(void)
57 return inb(I8042_STATUS_REG);
60 static inline void i8042_write_data(int val)
62 outb(val, I8042_DATA_REG);
65 static inline void i8042_write_command(int val)
67 outb(val, I8042_COMMAND_REG);
72 #include <linux/dmi.h>
74 #define SERIO_QUIRK_NOKBD BIT(0)
75 #define SERIO_QUIRK_NOAUX BIT(1)
76 #define SERIO_QUIRK_NOMUX BIT(2)
77 #define SERIO_QUIRK_FORCEMUX BIT(3)
78 #define SERIO_QUIRK_UNLOCK BIT(4)
79 #define SERIO_QUIRK_PROBE_DEFER BIT(5)
80 #define SERIO_QUIRK_RESET_ALWAYS BIT(6)
81 #define SERIO_QUIRK_RESET_NEVER BIT(7)
82 #define SERIO_QUIRK_DIECT BIT(8)
83 #define SERIO_QUIRK_DUMBKBD BIT(9)
84 #define SERIO_QUIRK_NOLOOP BIT(10)
85 #define SERIO_QUIRK_NOTIMEOUT BIT(11)
86 #define SERIO_QUIRK_KBDRESET BIT(12)
87 #define SERIO_QUIRK_DRITEK BIT(13)
88 #define SERIO_QUIRK_NOPNP BIT(14)
90 /* Quirk table for different mainboards. Options similar or identical to i8042
92 * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored.
93 * This allows entries to overwrite vendor wide quirks on a per device basis.
94 * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR
95 * and/or DMI_BOARD_VENDOR to make it easier to avoid dublicate entries.
97 static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
100 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
101 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
103 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
107 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
108 DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
110 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
115 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
116 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
118 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
121 /* ASUS ZenBook UX425UA */
123 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
124 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"),
126 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
129 /* ASUS ZenBook UM325UA */
131 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
132 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"),
134 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
137 * On some Asus laptops, just running self tests cause problems.
141 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
142 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
144 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
148 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
149 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
151 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
154 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
156 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
157 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
158 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
160 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
165 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
166 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
167 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
169 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
173 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
174 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
176 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
179 /* Acer Aspire 5710 */
181 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
182 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
184 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
187 /* Acer Aspire 7738 */
189 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
190 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
192 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
195 /* Acer Aspire 5536 */
197 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
198 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
199 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
201 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
206 * Touchpad stops working in mux mode when dis- + re-enabled
207 * with the touchpad enable/disable toggle hotkey
210 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
211 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
213 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
216 /* Acer Aspire One 150 */
218 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
219 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
221 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
225 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
226 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
228 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
232 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
233 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
235 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
239 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
240 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
242 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
246 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
247 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
249 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
253 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
254 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
256 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
260 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
261 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
263 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
267 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
268 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
270 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
273 * Some Wistron based laptops need us to explicitly enable the 'Dritek
274 * keyboard extension' to make their extra keys start generating scancodes.
275 * Originally, this was just confined to older laptops, but a few Acer laptops
276 * have turned up in 2007 that also need this again.
279 /* Acer Aspire 5100 */
281 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
282 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
284 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
287 /* Acer Aspire 5610 */
289 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
290 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
292 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
295 /* Acer Aspire 5630 */
297 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
298 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
300 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
303 /* Acer Aspire 5650 */
305 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
306 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
308 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
311 /* Acer Aspire 5680 */
313 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
314 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
316 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
319 /* Acer Aspire 5720 */
321 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
322 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
324 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
327 /* Acer Aspire 9110 */
329 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
330 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
332 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
335 /* Acer TravelMate 660 */
337 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
338 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
340 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
343 /* Acer TravelMate 2490 */
345 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
346 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
348 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
351 /* Acer TravelMate 4280 */
353 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
354 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
356 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
359 /* Acer TravelMate P459-G2-M */
361 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
362 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
364 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
369 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
370 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
372 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
376 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
377 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
379 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
384 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
385 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
387 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
391 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
392 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
393 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
395 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
399 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
400 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
401 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
403 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
408 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
409 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
411 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
414 /* Dell Embedded Box PC 3000 */
416 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
417 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
419 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
424 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
425 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
427 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
430 /* Dell Vostro 1510 */
432 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
433 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
435 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
438 /* Dell Vostro V13 */
440 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
441 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
443 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
446 /* Dell Vostro 1320 */
448 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
449 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
451 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
454 /* Dell Vostro 1520 */
456 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
457 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
459 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
462 /* Dell Vostro 1720 */
464 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
465 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
467 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
470 /* Entroware Proteus */
472 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
473 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
474 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
476 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
479 * Some Fujitsu notebooks are having trouble with touchpads if
480 * active multiplexing mode is activated. Luckily they don't have
481 * external PS/2 ports so we can safely disable it.
482 * ... apparently some Toshibas don't like MUX mode either and
483 * die horrible death on reboot.
486 /* Fujitsu Lifebook P7010/P7010D */
488 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
489 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
491 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
494 /* Fujitsu Lifebook P5020D */
496 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
497 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
499 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
502 /* Fujitsu Lifebook S2000 */
504 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
505 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
507 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
510 /* Fujitsu Lifebook S6230 */
512 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
513 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
515 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
518 /* Fujitsu Lifebook T725 laptop */
520 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
521 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
523 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
526 /* Fujitsu Lifebook U745 */
528 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
529 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
531 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
536 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
537 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
539 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
542 /* Fujitsu A544 laptop */
543 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
545 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
546 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
548 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
551 /* Fujitsu AH544 laptop */
552 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
554 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
555 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
557 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
560 /* Fujitsu U574 laptop */
561 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
563 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
564 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
566 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
569 /* Fujitsu UH554 laptop */
571 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
572 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
574 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
577 /* Fujitsu Lifebook P7010 */
579 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
580 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
582 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
585 /* Fujitsu-Siemens Lifebook T3010 */
587 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
588 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
590 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
593 /* Fujitsu-Siemens Lifebook E4010 */
595 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
596 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
598 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
601 /* Fujitsu-Siemens Amilo Pro 2010 */
603 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
604 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
606 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
609 /* Fujitsu-Siemens Amilo Pro 2030 */
611 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
612 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
614 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
617 /* Fujitsu Lifebook A574/H */
619 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
620 DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
622 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
625 /* Fujitsu Lifebook E5411 */
627 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
628 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
630 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
635 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
636 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
637 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
639 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
642 /* Gigabyte Spring Peak - defines wrong chassis type */
644 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
645 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
647 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
650 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
652 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
653 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
655 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
658 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
660 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
661 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
663 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
666 * Some laptops need keyboard reset before probing for the trackpad to get
667 * it detected, initialised & finally work.
670 /* Gigabyte P35 v2 - Elantech touchpad */
672 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
673 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
675 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
678 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
680 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
681 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
683 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
686 /* Gigabyte P34 - Elantech touchpad */
688 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
689 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
691 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
694 /* Gigabyte P57 - Elantech touchpad */
696 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
697 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
699 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
702 /* Gericom Bellagio */
704 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
705 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
707 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
710 /* Gigabyte M1022M netbook */
712 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
713 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
714 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
716 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
720 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
721 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
722 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
724 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
728 * HP Pavilion DV4017EA -
729 * errors on MUX ports are reported without raising AUXDATA
730 * causing "spurious NAK" messages.
733 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
734 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
736 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
740 * HP Pavilion ZT1000 -
741 * like DV4017EA does not raise AUXERR for errors on MUX ports.
744 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
745 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
746 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
748 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
752 * HP Pavilion DV4270ca -
753 * like DV4017EA does not raise AUXERR for errors on MUX ports.
756 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
757 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
759 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
762 /* Newer HP Pavilion dv4 models */
764 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
765 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
767 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
772 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
773 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
775 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
778 /* Avatar AVIU-145A6 */
780 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
781 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
783 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
786 /* Intel MBO Desktop D845PESV */
788 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
789 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
791 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
795 * Intel NUC D54250WYK - does not have i8042 controller but
796 * declares PS/2 devices in DSDT.
799 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
800 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
802 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
805 /* Lenovo 3000 n100 */
807 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
808 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
810 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
813 /* Lenovo XiaoXin Air 12 */
815 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
816 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
818 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
823 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
824 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
826 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
829 /* Lenovo Ideapad U455 */
831 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
832 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
834 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
837 /* Lenovo ThinkPad L460 */
839 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
840 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
842 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
845 /* Lenovo ThinkPad Twist S230u */
847 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
848 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
850 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
853 /* LG Electronics X110 */
855 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
856 DMI_MATCH(DMI_BOARD_NAME, "X110"),
858 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
861 /* Medion Akoya Mini E1210 */
863 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
864 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
866 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
869 /* Medion Akoya E1222 */
871 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
872 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
874 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
879 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
880 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
882 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
886 * No data is coming from the touchscreen unless KBC
889 /* Panasonic CF-29 */
891 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
892 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
894 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
897 /* Medion Akoya E7225 */
899 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
900 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
901 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
903 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
906 /* Microsoft Virtual Machine */
908 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
909 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
910 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
912 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
915 /* Medion MAM 2070 */
917 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
918 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
919 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
921 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
926 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
927 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
929 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
932 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
934 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
935 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
937 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
942 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
943 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
944 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
946 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
950 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
951 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
953 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
956 /* Acer Aspire 5 A515 */
958 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
959 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
961 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
964 /* ULI EV4873 - AUX LOOP does not work properly */
966 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
967 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
968 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
970 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
974 * Arima-Rioworks HDAMB -
975 * AUX LOOP command does not raise AUX IRQ
978 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
979 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
980 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
982 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
985 /* Sharp Actius MM20 */
987 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
988 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
990 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
994 * Sony Vaio FZ-240E -
995 * reset and GET ID commands issued via KBD port are
996 * sometimes being delivered to AUX3.
999 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1000 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
1002 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1006 * Most (all?) VAIOs do not have external PS/2 ports nor
1007 * they implement active multiplexing properly, and
1008 * MUX discovery usually messes up keyboard/touchpad.
1011 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1012 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
1014 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1017 /* Sony Vaio FS-115b */
1019 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1020 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1022 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1026 * Sony Vaio VGN-CS series require MUX or the touch sensor
1027 * buttons will disturb touchpad operation
1030 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1031 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1033 .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1037 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1038 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1040 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1044 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1045 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1047 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1051 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1052 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1054 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1057 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1058 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1059 * none of them have an external PS/2 port so this can safely be set for
1060 * all of them. These two are based on a Clevo design, but have the
1061 * board_name changed.
1065 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1066 DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1068 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1069 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1073 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1074 DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1076 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1077 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1082 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1083 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1085 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1088 * Some laptops need keyboard reset before probing for the trackpad to get
1089 * it detected, initialised & finally work.
1092 /* Schenker XMG C504 - Elantech touchpad */
1094 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1095 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1097 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1102 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1103 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1104 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1106 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1109 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1110 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1111 * none of them have an external PS/2 port so this can safely be set for
1113 * Clevo barebones come with board_vendor and/or system_vendor set to
1114 * either the very generic string "Notebook" and/or a different value
1115 * for each individual reseller. The only somewhat universal way to
1116 * identify them is by board_name.
1120 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1122 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1123 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1127 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1129 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1130 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1134 DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1136 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1137 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1141 DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1143 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1144 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1148 DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1150 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1151 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1155 DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1157 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1158 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1161 * At least one modern Clevo barebone has the touchpad connected both
1162 * via PS/2 and i2c interface. This causes a race condition between the
1163 * psmouse and i2c-hid driver. Since the full capability of the touchpad
1164 * is available via the i2c interface and the device has no external
1165 * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1166 * this issue. The known affected device is the
1167 * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1168 * the two different dmi strings below. NS50MU is not a typo!
1172 DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1174 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1175 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1180 DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1182 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1183 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1188 DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
1190 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
1194 DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1196 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1197 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1201 DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1203 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1204 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1208 DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
1210 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1211 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1213 /* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
1216 DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"),
1218 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
1222 DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1224 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1225 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1229 DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1231 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1232 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1238 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1241 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1246 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1251 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1256 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1263 #endif /* CONFIG_X86 */
1266 #include <linux/pnp.h>
1268 static bool i8042_pnp_kbd_registered;
1269 static unsigned int i8042_pnp_kbd_devices;
1270 static bool i8042_pnp_aux_registered;
1271 static unsigned int i8042_pnp_aux_devices;
1273 static int i8042_pnp_command_reg;
1274 static int i8042_pnp_data_reg;
1275 static int i8042_pnp_kbd_irq;
1276 static int i8042_pnp_aux_irq;
1278 static char i8042_pnp_kbd_name[32];
1279 static char i8042_pnp_aux_name[32];
1281 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1283 strlcpy(dst, "PNP:", dst_size);
1286 strlcat(dst, " ", dst_size);
1287 strlcat(dst, id->id, dst_size);
1292 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1294 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1295 i8042_pnp_data_reg = pnp_port_start(dev,0);
1297 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1298 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1300 if (pnp_irq_valid(dev,0))
1301 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1303 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1304 if (strlen(pnp_dev_name(dev))) {
1305 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1306 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1308 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1309 sizeof(i8042_kbd_firmware_id));
1311 /* Keyboard ports are always supposed to be wakeup-enabled */
1312 device_set_wakeup_enable(&dev->dev, true);
1314 i8042_pnp_kbd_devices++;
1318 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1320 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1321 i8042_pnp_data_reg = pnp_port_start(dev,0);
1323 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1324 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1326 if (pnp_irq_valid(dev, 0))
1327 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1329 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1330 if (strlen(pnp_dev_name(dev))) {
1331 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1332 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1334 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1335 sizeof(i8042_aux_firmware_id));
1337 i8042_pnp_aux_devices++;
1341 static const struct pnp_device_id pnp_kbd_devids[] = {
1342 { .id = "PNP0300", .driver_data = 0 },
1343 { .id = "PNP0301", .driver_data = 0 },
1344 { .id = "PNP0302", .driver_data = 0 },
1345 { .id = "PNP0303", .driver_data = 0 },
1346 { .id = "PNP0304", .driver_data = 0 },
1347 { .id = "PNP0305", .driver_data = 0 },
1348 { .id = "PNP0306", .driver_data = 0 },
1349 { .id = "PNP0309", .driver_data = 0 },
1350 { .id = "PNP030a", .driver_data = 0 },
1351 { .id = "PNP030b", .driver_data = 0 },
1352 { .id = "PNP0320", .driver_data = 0 },
1353 { .id = "PNP0343", .driver_data = 0 },
1354 { .id = "PNP0344", .driver_data = 0 },
1355 { .id = "PNP0345", .driver_data = 0 },
1356 { .id = "CPQA0D7", .driver_data = 0 },
1359 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1361 static struct pnp_driver i8042_pnp_kbd_driver = {
1362 .name = "i8042 kbd",
1363 .id_table = pnp_kbd_devids,
1364 .probe = i8042_pnp_kbd_probe,
1366 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1367 .suppress_bind_attrs = true,
1371 static const struct pnp_device_id pnp_aux_devids[] = {
1372 { .id = "AUI0200", .driver_data = 0 },
1373 { .id = "FJC6000", .driver_data = 0 },
1374 { .id = "FJC6001", .driver_data = 0 },
1375 { .id = "PNP0f03", .driver_data = 0 },
1376 { .id = "PNP0f0b", .driver_data = 0 },
1377 { .id = "PNP0f0e", .driver_data = 0 },
1378 { .id = "PNP0f12", .driver_data = 0 },
1379 { .id = "PNP0f13", .driver_data = 0 },
1380 { .id = "PNP0f19", .driver_data = 0 },
1381 { .id = "PNP0f1c", .driver_data = 0 },
1382 { .id = "SYN0801", .driver_data = 0 },
1385 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1387 static struct pnp_driver i8042_pnp_aux_driver = {
1388 .name = "i8042 aux",
1389 .id_table = pnp_aux_devids,
1390 .probe = i8042_pnp_aux_probe,
1392 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1393 .suppress_bind_attrs = true,
1397 static void i8042_pnp_exit(void)
1399 if (i8042_pnp_kbd_registered) {
1400 i8042_pnp_kbd_registered = false;
1401 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1404 if (i8042_pnp_aux_registered) {
1405 i8042_pnp_aux_registered = false;
1406 pnp_unregister_driver(&i8042_pnp_aux_driver);
1410 static int __init i8042_pnp_init(void)
1412 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1413 bool pnp_data_busted = false;
1417 pr_info("PNP detection disabled\n");
1421 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1423 i8042_pnp_kbd_registered = true;
1425 err = pnp_register_driver(&i8042_pnp_aux_driver);
1427 i8042_pnp_aux_registered = true;
1429 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1431 #if defined(__ia64__)
1434 pr_info("PNP: No PS/2 controller found.\n");
1435 if (x86_platform.legacy.i8042 !=
1436 X86_LEGACY_I8042_EXPECTED_PRESENT)
1438 pr_info("Probing ports directly.\n");
1443 if (i8042_pnp_kbd_devices)
1444 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1445 "%d", i8042_pnp_kbd_irq);
1446 if (i8042_pnp_aux_devices)
1447 snprintf(aux_irq_str, sizeof(aux_irq_str),
1448 "%d", i8042_pnp_aux_irq);
1450 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1451 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1453 i8042_pnp_data_reg, i8042_pnp_command_reg,
1454 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1457 #if defined(__ia64__)
1458 if (!i8042_pnp_kbd_devices)
1460 if (!i8042_pnp_aux_devices)
1464 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1465 i8042_pnp_data_reg != i8042_data_reg) ||
1466 !i8042_pnp_data_reg) {
1467 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1468 i8042_pnp_data_reg, i8042_data_reg);
1469 i8042_pnp_data_reg = i8042_data_reg;
1470 pnp_data_busted = true;
1473 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1474 i8042_pnp_command_reg != i8042_command_reg) ||
1475 !i8042_pnp_command_reg) {
1476 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1477 i8042_pnp_command_reg, i8042_command_reg);
1478 i8042_pnp_command_reg = i8042_command_reg;
1479 pnp_data_busted = true;
1482 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1483 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1485 i8042_pnp_kbd_irq = i8042_kbd_irq;
1486 pnp_data_busted = true;
1489 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1490 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1491 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1492 "if this is incorrect please boot with i8042.nopnp\n");
1495 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1497 i8042_pnp_aux_irq = i8042_aux_irq;
1501 i8042_data_reg = i8042_pnp_data_reg;
1502 i8042_command_reg = i8042_pnp_command_reg;
1503 i8042_kbd_irq = i8042_pnp_kbd_irq;
1504 i8042_aux_irq = i8042_pnp_aux_irq;
1507 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1508 dmi_check_system(i8042_dmi_laptop_table);
1514 #else /* !CONFIG_PNP */
1515 static inline int i8042_pnp_init(void) { return 0; }
1516 static inline void i8042_pnp_exit(void) { }
1517 #endif /* CONFIG_PNP */
1521 static void __init i8042_check_quirks(void)
1523 const struct dmi_system_id *device_quirk_info;
1526 device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1527 if (!device_quirk_info)
1530 quirks = (uintptr_t)device_quirk_info->driver_data;
1532 if (quirks & SERIO_QUIRK_NOKBD)
1534 if (quirks & SERIO_QUIRK_NOAUX)
1536 if (quirks & SERIO_QUIRK_NOMUX)
1538 if (quirks & SERIO_QUIRK_FORCEMUX)
1539 i8042_nomux = false;
1540 if (quirks & SERIO_QUIRK_UNLOCK)
1541 i8042_unlock = true;
1542 if (quirks & SERIO_QUIRK_PROBE_DEFER)
1543 i8042_probe_defer = true;
1544 /* Honor module parameter when value is not default */
1545 if (i8042_reset == I8042_RESET_DEFAULT) {
1546 if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1547 i8042_reset = I8042_RESET_ALWAYS;
1548 if (quirks & SERIO_QUIRK_RESET_NEVER)
1549 i8042_reset = I8042_RESET_NEVER;
1551 if (quirks & SERIO_QUIRK_DIECT)
1552 i8042_direct = true;
1553 if (quirks & SERIO_QUIRK_DUMBKBD)
1554 i8042_dumbkbd = true;
1555 if (quirks & SERIO_QUIRK_NOLOOP)
1556 i8042_noloop = true;
1557 if (quirks & SERIO_QUIRK_NOTIMEOUT)
1558 i8042_notimeout = true;
1559 if (quirks & SERIO_QUIRK_KBDRESET)
1560 i8042_kbdreset = true;
1561 if (quirks & SERIO_QUIRK_DRITEK)
1562 i8042_dritek = true;
1564 if (quirks & SERIO_QUIRK_NOPNP)
1569 static inline void i8042_check_quirks(void) {}
1572 static int __init i8042_platform_init(void)
1578 /* Just return if platform does not have i8042 controller */
1579 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1584 * On ix86 platforms touching the i8042 data register region can do really
1585 * bad things. Because of this the region is always reserved on ix86 boxes.
1587 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1591 i8042_kbd_irq = I8042_MAP_IRQ(1);
1592 i8042_aux_irq = I8042_MAP_IRQ(12);
1594 #if defined(__ia64__)
1595 i8042_reset = I8042_RESET_ALWAYS;
1598 i8042_check_quirks();
1600 retval = i8042_pnp_init();
1606 * A20 was already enabled during early kernel init. But some buggy
1607 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1608 * resume from S3. So we do it here and hope that nothing breaks.
1610 i8042_command(&a20_on, 0x10d1);
1611 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1612 #endif /* CONFIG_X86 */
1617 static inline void i8042_platform_exit(void)
1622 #endif /* _I8042_X86IA64IO_H */