1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _I8042_X86IA64IO_H
3 #define _I8042_X86IA64IO_H
7 #include <asm/x86_init.h>
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 #define SERIO_QUIRK_NOKBD BIT(0)
71 #define SERIO_QUIRK_NOAUX BIT(1)
72 #define SERIO_QUIRK_NOMUX BIT(2)
73 #define SERIO_QUIRK_FORCEMUX BIT(3)
74 #define SERIO_QUIRK_UNLOCK BIT(4)
75 #define SERIO_QUIRK_PROBE_DEFER BIT(5)
76 #define SERIO_QUIRK_RESET_ALWAYS BIT(6)
77 #define SERIO_QUIRK_RESET_NEVER BIT(7)
78 #define SERIO_QUIRK_DIECT BIT(8)
79 #define SERIO_QUIRK_DUMBKBD BIT(9)
80 #define SERIO_QUIRK_NOLOOP BIT(10)
81 #define SERIO_QUIRK_NOTIMEOUT BIT(11)
82 #define SERIO_QUIRK_KBDRESET BIT(12)
83 #define SERIO_QUIRK_DRITEK BIT(13)
84 #define SERIO_QUIRK_NOPNP BIT(14)
86 /* Quirk table for different mainboards. Options similar or identical to i8042
88 * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored.
89 * This allows entries to overwrite vendor wide quirks on a per device basis.
90 * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR
91 * and/or DMI_BOARD_VENDOR to make it easier to avoid dublicate entries.
93 static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
96 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
97 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
99 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
103 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
104 DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
106 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
111 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
112 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
114 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
117 /* ASUS ZenBook UX425UA */
119 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
120 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"),
122 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
125 /* ASUS ZenBook UM325UA */
127 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
128 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"),
130 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
133 * On some Asus laptops, just running self tests cause problems.
137 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
138 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
140 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
144 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
145 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
147 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
150 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
152 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
153 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
154 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
156 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
161 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
162 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
163 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
165 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
169 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
170 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
172 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
175 /* Acer Aspire 5710 */
177 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
178 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
180 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
183 /* Acer Aspire 7738 */
185 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
186 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
188 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
191 /* Acer Aspire 5536 */
193 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
194 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
195 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
197 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
202 * Touchpad stops working in mux mode when dis- + re-enabled
203 * with the touchpad enable/disable toggle hotkey
206 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
207 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
209 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
212 /* Acer Aspire One 150 */
214 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
215 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
217 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
220 /* Acer Aspire One 532h */
222 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
223 DMI_MATCH(DMI_PRODUCT_NAME, "AO532h"),
225 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
229 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
230 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
232 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
236 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
237 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
239 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
243 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
244 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
246 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
250 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
251 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
253 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
257 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
258 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
260 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
264 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
265 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
267 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
271 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
272 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
274 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
277 * Some Wistron based laptops need us to explicitly enable the 'Dritek
278 * keyboard extension' to make their extra keys start generating scancodes.
279 * Originally, this was just confined to older laptops, but a few Acer laptops
280 * have turned up in 2007 that also need this again.
283 /* Acer Aspire 5100 */
285 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
286 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
288 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
291 /* Acer Aspire 5610 */
293 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
294 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
296 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
299 /* Acer Aspire 5630 */
301 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
302 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
304 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
307 /* Acer Aspire 5650 */
309 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
310 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
312 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
315 /* Acer Aspire 5680 */
317 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
318 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
320 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
323 /* Acer Aspire 5720 */
325 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
326 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
328 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
331 /* Acer Aspire 9110 */
333 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
334 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
336 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
339 /* Acer TravelMate 660 */
341 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
342 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
344 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
347 /* Acer TravelMate 2490 */
349 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
350 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
352 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
355 /* Acer TravelMate 4280 */
357 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
358 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
360 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
365 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
366 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
368 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
372 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
373 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
375 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
380 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
381 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
383 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
387 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
388 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
389 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
391 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
395 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
396 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
397 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
399 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
404 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
405 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
407 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
410 /* Dell Embedded Box PC 3000 */
412 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
413 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
415 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
420 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
421 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
423 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
426 /* Dell Vostro 1510 */
428 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
429 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
431 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
434 /* Dell Vostro V13 */
436 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
437 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
439 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
442 /* Dell Vostro 1320 */
444 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
445 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
447 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
450 /* Dell Vostro 1520 */
452 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
453 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
455 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
458 /* Dell Vostro 1720 */
460 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
461 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
463 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
466 /* Entroware Proteus */
468 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
469 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
470 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
472 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
475 * Some Fujitsu notebooks are having trouble with touchpads if
476 * active multiplexing mode is activated. Luckily they don't have
477 * external PS/2 ports so we can safely disable it.
478 * ... apparently some Toshibas don't like MUX mode either and
479 * die horrible death on reboot.
482 /* Fujitsu Lifebook P7010/P7010D */
484 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
485 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
487 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
490 /* Fujitsu Lifebook P5020D */
492 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
493 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
495 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
498 /* Fujitsu Lifebook S2000 */
500 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
501 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
503 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
506 /* Fujitsu Lifebook S6230 */
508 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
509 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
511 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
514 /* Fujitsu Lifebook T725 laptop */
516 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
517 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
519 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
522 /* Fujitsu Lifebook U745 */
524 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
525 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
527 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
532 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
533 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
535 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
538 /* Fujitsu A544 laptop */
539 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
541 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
542 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
544 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
547 /* Fujitsu AH544 laptop */
548 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
550 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
551 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
553 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
556 /* Fujitsu U574 laptop */
557 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
559 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
560 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
562 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
565 /* Fujitsu UH554 laptop */
567 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
568 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
570 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
573 /* Fujitsu Lifebook P7010 */
575 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
576 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
578 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
581 /* Fujitsu-Siemens Lifebook T3010 */
583 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
584 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
586 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
589 /* Fujitsu-Siemens Lifebook E4010 */
591 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
592 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
594 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
597 /* Fujitsu-Siemens Amilo Pro 2010 */
599 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
600 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
602 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
605 /* Fujitsu-Siemens Amilo Pro 2030 */
607 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
608 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
610 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
615 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
616 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
617 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
619 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
622 /* Gigabyte Spring Peak - defines wrong chassis type */
624 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
625 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
627 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
630 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
632 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
633 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
635 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
638 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
640 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
641 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
643 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
646 * Some laptops need keyboard reset before probing for the trackpad to get
647 * it detected, initialised & finally work.
650 /* Gigabyte P35 v2 - Elantech touchpad */
652 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
653 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
655 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
658 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
660 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
661 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
663 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
666 /* Gigabyte P34 - Elantech touchpad */
668 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
669 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
671 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
674 /* Gigabyte P57 - Elantech touchpad */
676 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
677 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
679 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
682 /* Gericom Bellagio */
684 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
685 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
687 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
690 /* Gigabyte M1022M netbook */
692 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
693 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
694 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
696 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
700 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
701 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
702 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
704 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
708 * HP Pavilion DV4017EA -
709 * errors on MUX ports are reported without raising AUXDATA
710 * causing "spurious NAK" messages.
713 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
714 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
716 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
720 * HP Pavilion ZT1000 -
721 * like DV4017EA does not raise AUXERR for errors on MUX ports.
724 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
725 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
726 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
728 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
732 * HP Pavilion DV4270ca -
733 * like DV4017EA does not raise AUXERR for errors on MUX ports.
736 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
737 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
739 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
742 /* Newer HP Pavilion dv4 models */
744 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
745 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
747 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
752 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
753 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
755 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
758 /* Avatar AVIU-145A6 */
760 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
761 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
763 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
766 /* Intel MBO Desktop D845PESV */
768 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
769 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
771 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
775 * Intel NUC D54250WYK - does not have i8042 controller but
776 * declares PS/2 devices in DSDT.
779 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
780 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
782 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
785 /* Lenovo 3000 n100 */
787 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
788 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
790 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
793 /* Lenovo XiaoXin Air 12 */
795 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
796 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
798 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
803 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
804 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
806 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
809 /* Lenovo Ideapad U455 */
811 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
812 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
814 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
817 /* Lenovo ThinkPad L460 */
819 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
820 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
822 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
825 /* Lenovo ThinkPad Twist S230u */
827 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
828 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
830 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
833 /* LG Electronics X110 */
835 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
836 DMI_MATCH(DMI_BOARD_NAME, "X110"),
838 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
841 /* Medion Akoya Mini E1210 */
843 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
844 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
846 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
849 /* Medion Akoya E1222 */
851 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
852 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
854 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
859 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
860 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
862 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
866 * No data is coming from the touchscreen unless KBC
869 /* Panasonic CF-29 */
871 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
872 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
874 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
877 /* Medion Akoya E7225 */
879 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
880 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
881 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
883 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
886 /* Microsoft Virtual Machine */
888 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
889 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
890 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
892 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
895 /* Medion MAM 2070 */
897 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
898 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
899 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
901 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
906 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
907 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
909 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
914 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
915 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
916 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
918 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
922 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
923 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
925 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
928 /* Acer Aspire 5 A515 */
930 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
931 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
933 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
936 /* ULI EV4873 - AUX LOOP does not work properly */
938 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
939 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
940 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
942 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
946 * Arima-Rioworks HDAMB -
947 * AUX LOOP command does not raise AUX IRQ
950 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
951 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
952 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
954 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
957 /* Sharp Actius MM20 */
959 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
960 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
962 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
966 * Sony Vaio FZ-240E -
967 * reset and GET ID commands issued via KBD port are
968 * sometimes being delivered to AUX3.
971 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
972 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
974 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
978 * Most (all?) VAIOs do not have external PS/2 ports nor
979 * they implement active multiplexing properly, and
980 * MUX discovery usually messes up keyboard/touchpad.
983 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
984 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
986 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
989 /* Sony Vaio FS-115b */
991 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
992 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
994 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
998 * Sony Vaio VGN-CS series require MUX or the touch sensor
999 * buttons will disturb touchpad operation
1002 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1003 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1005 .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1009 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1010 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1012 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1016 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1017 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1019 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1023 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1024 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1026 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1029 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1030 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1031 * none of them have an external PS/2 port so this can safely be set for
1032 * all of them. These two are based on a Clevo design, but have the
1033 * board_name changed.
1037 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1038 DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1040 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1041 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1045 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1046 DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1048 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1049 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1054 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1055 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1057 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1060 * Some laptops need keyboard reset before probing for the trackpad to get
1061 * it detected, initialised & finally work.
1064 /* Schenker XMG C504 - Elantech touchpad */
1066 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1067 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1069 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1074 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1075 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1076 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1078 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1081 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1082 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1083 * none of them have an external PS/2 port so this can safely be set for
1085 * Clevo barebones come with board_vendor and/or system_vendor set to
1086 * either the very generic string "Notebook" and/or a different value
1087 * for each individual reseller. The only somewhat universal way to
1088 * identify them is by board_name.
1092 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1094 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1095 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1099 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1101 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1102 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1106 DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1108 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1109 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1113 DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1115 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1116 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1120 DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1122 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1123 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1127 DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1129 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1130 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1133 * At least one modern Clevo barebone has the touchpad connected both
1134 * via PS/2 and i2c interface. This causes a race condition between the
1135 * psmouse and i2c-hid driver. Since the full capability of the touchpad
1136 * is available via the i2c interface and the device has no external
1137 * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1138 * this issue. The known affected device is the
1139 * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1140 * the two different dmi strings below. NS50MU is not a typo!
1144 DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1146 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1147 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1152 DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1154 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1155 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1160 DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1162 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1163 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1167 * This is only a partial board_name and might be followed by
1168 * another letter or number. DMI_MATCH however does do partial
1172 DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"),
1174 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1175 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1178 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
1180 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
1182 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1183 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1187 * This is only a partial board_name and might be followed by
1188 * another letter or number. DMI_MATCH however does do partial
1192 DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"),
1194 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1195 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1199 * This is only a partial board_name and might be followed by
1200 * another letter or number. DMI_MATCH however does do partial
1204 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"),
1206 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1207 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1211 * This is only a partial board_name and might be followed by
1212 * another letter or number. DMI_MATCH however does do partial
1216 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"),
1218 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1219 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1223 * This is only a partial board_name and might be followed by
1224 * another letter or number. DMI_MATCH however does do partial
1228 DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"),
1230 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1231 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1235 DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1237 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1238 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1242 DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1244 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1245 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1249 DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1251 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1252 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1258 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1261 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1266 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1271 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1276 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1283 #endif /* CONFIG_X86 */
1286 #include <linux/pnp.h>
1288 static bool i8042_pnp_kbd_registered;
1289 static unsigned int i8042_pnp_kbd_devices;
1290 static bool i8042_pnp_aux_registered;
1291 static unsigned int i8042_pnp_aux_devices;
1293 static int i8042_pnp_command_reg;
1294 static int i8042_pnp_data_reg;
1295 static int i8042_pnp_kbd_irq;
1296 static int i8042_pnp_aux_irq;
1298 static char i8042_pnp_kbd_name[32];
1299 static char i8042_pnp_aux_name[32];
1301 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1303 strlcpy(dst, "PNP:", dst_size);
1306 strlcat(dst, " ", dst_size);
1307 strlcat(dst, id->id, dst_size);
1312 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1314 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1315 i8042_pnp_data_reg = pnp_port_start(dev,0);
1317 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1318 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1320 if (pnp_irq_valid(dev,0))
1321 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1323 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1324 if (strlen(pnp_dev_name(dev))) {
1325 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1326 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1328 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1329 sizeof(i8042_kbd_firmware_id));
1330 i8042_kbd_fwnode = dev_fwnode(&dev->dev);
1332 /* Keyboard ports are always supposed to be wakeup-enabled */
1333 device_set_wakeup_enable(&dev->dev, true);
1335 i8042_pnp_kbd_devices++;
1339 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1341 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1342 i8042_pnp_data_reg = pnp_port_start(dev,0);
1344 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1345 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1347 if (pnp_irq_valid(dev, 0))
1348 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1350 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1351 if (strlen(pnp_dev_name(dev))) {
1352 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1353 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1355 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1356 sizeof(i8042_aux_firmware_id));
1358 i8042_pnp_aux_devices++;
1362 static const struct pnp_device_id pnp_kbd_devids[] = {
1363 { .id = "PNP0300", .driver_data = 0 },
1364 { .id = "PNP0301", .driver_data = 0 },
1365 { .id = "PNP0302", .driver_data = 0 },
1366 { .id = "PNP0303", .driver_data = 0 },
1367 { .id = "PNP0304", .driver_data = 0 },
1368 { .id = "PNP0305", .driver_data = 0 },
1369 { .id = "PNP0306", .driver_data = 0 },
1370 { .id = "PNP0309", .driver_data = 0 },
1371 { .id = "PNP030a", .driver_data = 0 },
1372 { .id = "PNP030b", .driver_data = 0 },
1373 { .id = "PNP0320", .driver_data = 0 },
1374 { .id = "PNP0343", .driver_data = 0 },
1375 { .id = "PNP0344", .driver_data = 0 },
1376 { .id = "PNP0345", .driver_data = 0 },
1377 { .id = "CPQA0D7", .driver_data = 0 },
1380 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1382 static struct pnp_driver i8042_pnp_kbd_driver = {
1383 .name = "i8042 kbd",
1384 .id_table = pnp_kbd_devids,
1385 .probe = i8042_pnp_kbd_probe,
1387 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1388 .suppress_bind_attrs = true,
1392 static const struct pnp_device_id pnp_aux_devids[] = {
1393 { .id = "AUI0200", .driver_data = 0 },
1394 { .id = "FJC6000", .driver_data = 0 },
1395 { .id = "FJC6001", .driver_data = 0 },
1396 { .id = "PNP0f03", .driver_data = 0 },
1397 { .id = "PNP0f0b", .driver_data = 0 },
1398 { .id = "PNP0f0e", .driver_data = 0 },
1399 { .id = "PNP0f12", .driver_data = 0 },
1400 { .id = "PNP0f13", .driver_data = 0 },
1401 { .id = "PNP0f19", .driver_data = 0 },
1402 { .id = "PNP0f1c", .driver_data = 0 },
1403 { .id = "SYN0801", .driver_data = 0 },
1406 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1408 static struct pnp_driver i8042_pnp_aux_driver = {
1409 .name = "i8042 aux",
1410 .id_table = pnp_aux_devids,
1411 .probe = i8042_pnp_aux_probe,
1413 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1414 .suppress_bind_attrs = true,
1418 static void i8042_pnp_exit(void)
1420 if (i8042_pnp_kbd_registered) {
1421 i8042_pnp_kbd_registered = false;
1422 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1425 if (i8042_pnp_aux_registered) {
1426 i8042_pnp_aux_registered = false;
1427 pnp_unregister_driver(&i8042_pnp_aux_driver);
1431 static int __init i8042_pnp_init(void)
1433 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1434 bool pnp_data_busted = false;
1438 pr_info("PNP detection disabled\n");
1442 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1444 i8042_pnp_kbd_registered = true;
1446 err = pnp_register_driver(&i8042_pnp_aux_driver);
1448 i8042_pnp_aux_registered = true;
1450 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1452 #if defined(__ia64__)
1455 pr_info("PNP: No PS/2 controller found.\n");
1456 if (x86_platform.legacy.i8042 !=
1457 X86_LEGACY_I8042_EXPECTED_PRESENT)
1459 pr_info("Probing ports directly.\n");
1464 if (i8042_pnp_kbd_devices)
1465 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1466 "%d", i8042_pnp_kbd_irq);
1467 if (i8042_pnp_aux_devices)
1468 snprintf(aux_irq_str, sizeof(aux_irq_str),
1469 "%d", i8042_pnp_aux_irq);
1471 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1472 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1474 i8042_pnp_data_reg, i8042_pnp_command_reg,
1475 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1478 #if defined(__ia64__)
1479 if (!i8042_pnp_kbd_devices)
1481 if (!i8042_pnp_aux_devices)
1485 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1486 i8042_pnp_data_reg != i8042_data_reg) ||
1487 !i8042_pnp_data_reg) {
1488 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1489 i8042_pnp_data_reg, i8042_data_reg);
1490 i8042_pnp_data_reg = i8042_data_reg;
1491 pnp_data_busted = true;
1494 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1495 i8042_pnp_command_reg != i8042_command_reg) ||
1496 !i8042_pnp_command_reg) {
1497 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1498 i8042_pnp_command_reg, i8042_command_reg);
1499 i8042_pnp_command_reg = i8042_command_reg;
1500 pnp_data_busted = true;
1503 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1504 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1506 i8042_pnp_kbd_irq = i8042_kbd_irq;
1507 pnp_data_busted = true;
1510 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1511 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1512 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1513 "if this is incorrect please boot with i8042.nopnp\n");
1516 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1518 i8042_pnp_aux_irq = i8042_aux_irq;
1522 i8042_data_reg = i8042_pnp_data_reg;
1523 i8042_command_reg = i8042_pnp_command_reg;
1524 i8042_kbd_irq = i8042_pnp_kbd_irq;
1525 i8042_aux_irq = i8042_pnp_aux_irq;
1528 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1529 dmi_check_system(i8042_dmi_laptop_table);
1535 #else /* !CONFIG_PNP */
1536 static inline int i8042_pnp_init(void) { return 0; }
1537 static inline void i8042_pnp_exit(void) { }
1538 #endif /* CONFIG_PNP */
1542 static void __init i8042_check_quirks(void)
1544 const struct dmi_system_id *device_quirk_info;
1547 device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1548 if (!device_quirk_info)
1551 quirks = (uintptr_t)device_quirk_info->driver_data;
1553 if (quirks & SERIO_QUIRK_NOKBD)
1555 if (quirks & SERIO_QUIRK_NOAUX)
1557 if (quirks & SERIO_QUIRK_NOMUX)
1559 if (quirks & SERIO_QUIRK_FORCEMUX)
1560 i8042_nomux = false;
1561 if (quirks & SERIO_QUIRK_UNLOCK)
1562 i8042_unlock = true;
1563 if (quirks & SERIO_QUIRK_PROBE_DEFER)
1564 i8042_probe_defer = true;
1565 /* Honor module parameter when value is not default */
1566 if (i8042_reset == I8042_RESET_DEFAULT) {
1567 if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1568 i8042_reset = I8042_RESET_ALWAYS;
1569 if (quirks & SERIO_QUIRK_RESET_NEVER)
1570 i8042_reset = I8042_RESET_NEVER;
1572 if (quirks & SERIO_QUIRK_DIECT)
1573 i8042_direct = true;
1574 if (quirks & SERIO_QUIRK_DUMBKBD)
1575 i8042_dumbkbd = true;
1576 if (quirks & SERIO_QUIRK_NOLOOP)
1577 i8042_noloop = true;
1578 if (quirks & SERIO_QUIRK_NOTIMEOUT)
1579 i8042_notimeout = true;
1580 if (quirks & SERIO_QUIRK_KBDRESET)
1581 i8042_kbdreset = true;
1582 if (quirks & SERIO_QUIRK_DRITEK)
1583 i8042_dritek = true;
1585 if (quirks & SERIO_QUIRK_NOPNP)
1590 static inline void i8042_check_quirks(void) {}
1593 static int __init i8042_platform_init(void)
1599 /* Just return if platform does not have i8042 controller */
1600 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1605 * On ix86 platforms touching the i8042 data register region can do really
1606 * bad things. Because of this the region is always reserved on ix86 boxes.
1608 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1612 i8042_kbd_irq = I8042_MAP_IRQ(1);
1613 i8042_aux_irq = I8042_MAP_IRQ(12);
1615 #if defined(__ia64__)
1616 i8042_reset = I8042_RESET_ALWAYS;
1619 i8042_check_quirks();
1621 pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
1622 i8042_nokbd ? " nokbd" : "",
1623 i8042_noaux ? " noaux" : "",
1624 i8042_nomux ? " nomux" : "",
1625 i8042_unlock ? " unlock" : "",
1626 i8042_probe_defer ? "probe_defer" : "",
1627 i8042_reset == I8042_RESET_DEFAULT ?
1628 "" : i8042_reset == I8042_RESET_ALWAYS ?
1629 " reset_always" : " reset_never",
1630 i8042_direct ? " direct" : "",
1631 i8042_dumbkbd ? " dumbkbd" : "",
1632 i8042_noloop ? " noloop" : "",
1633 i8042_notimeout ? " notimeout" : "",
1634 i8042_kbdreset ? " kbdreset" : "",
1636 i8042_dritek ? " dritek" : "",
1641 i8042_nopnp ? " nopnp" : "");
1646 retval = i8042_pnp_init();
1652 * A20 was already enabled during early kernel init. But some buggy
1653 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1654 * resume from S3. So we do it here and hope that nothing breaks.
1656 i8042_command(&a20_on, 0x10d1);
1657 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1658 #endif /* CONFIG_X86 */
1663 static inline void i8042_platform_exit(void)
1668 #endif /* _I8042_X86IA64IO_H */