1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _I8042_ACPIPNPIO_H
3 #define _I8042_ACPIPNPIO_H
5 #include <linux/acpi.h>
8 #include <asm/x86_init.h>
15 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
16 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
17 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
24 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
26 # define I8042_MAP_IRQ(x) (x)
29 #define I8042_KBD_IRQ i8042_kbd_irq
30 #define I8042_AUX_IRQ i8042_aux_irq
32 static int i8042_kbd_irq;
33 static int i8042_aux_irq;
39 #define I8042_COMMAND_REG i8042_command_reg
40 #define I8042_STATUS_REG i8042_command_reg
41 #define I8042_DATA_REG i8042_data_reg
43 static int i8042_command_reg = 0x64;
44 static int i8042_data_reg = 0x60;
47 static inline int i8042_read_data(void)
49 return inb(I8042_DATA_REG);
52 static inline int i8042_read_status(void)
54 return inb(I8042_STATUS_REG);
57 static inline void i8042_write_data(int val)
59 outb(val, I8042_DATA_REG);
62 static inline void i8042_write_command(int val)
64 outb(val, I8042_COMMAND_REG);
69 #include <linux/dmi.h>
71 #define SERIO_QUIRK_NOKBD BIT(0)
72 #define SERIO_QUIRK_NOAUX BIT(1)
73 #define SERIO_QUIRK_NOMUX BIT(2)
74 #define SERIO_QUIRK_FORCEMUX BIT(3)
75 #define SERIO_QUIRK_UNLOCK BIT(4)
76 #define SERIO_QUIRK_PROBE_DEFER BIT(5)
77 #define SERIO_QUIRK_RESET_ALWAYS BIT(6)
78 #define SERIO_QUIRK_RESET_NEVER BIT(7)
79 #define SERIO_QUIRK_DIECT BIT(8)
80 #define SERIO_QUIRK_DUMBKBD BIT(9)
81 #define SERIO_QUIRK_NOLOOP BIT(10)
82 #define SERIO_QUIRK_NOTIMEOUT BIT(11)
83 #define SERIO_QUIRK_KBDRESET BIT(12)
84 #define SERIO_QUIRK_DRITEK BIT(13)
85 #define SERIO_QUIRK_NOPNP BIT(14)
87 /* Quirk table for different mainboards. Options similar or identical to i8042
89 * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored.
90 * This allows entries to overwrite vendor wide quirks on a per device basis.
91 * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR
92 * and/or DMI_BOARD_VENDOR to make it easier to avoid dublicate entries.
94 static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
97 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
98 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
100 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
104 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
105 DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
107 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
112 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
113 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
115 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
118 /* ASUS ZenBook UX425UA/QA */
120 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
121 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425"),
123 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
126 /* ASUS ZenBook UM325UA/QA */
128 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
129 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325"),
131 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
134 * On some Asus laptops, just running self tests cause problems.
138 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
139 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
141 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
145 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
146 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
148 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
151 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
153 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
154 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
155 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
157 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
162 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
163 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
164 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
166 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
170 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
171 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
173 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
176 /* Acer Aspire 5710 */
178 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
179 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
181 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
184 /* Acer Aspire 7738 */
186 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
187 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
189 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
192 /* Acer Aspire 5536 */
194 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
195 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
196 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
198 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
203 * Touchpad stops working in mux mode when dis- + re-enabled
204 * with the touchpad enable/disable toggle hotkey
207 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
208 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
210 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
213 /* Acer Aspire One 150 */
215 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
216 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
218 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
221 /* Acer Aspire One 532h */
223 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
224 DMI_MATCH(DMI_PRODUCT_NAME, "AO532h"),
226 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
230 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
231 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
233 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
237 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
238 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
240 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
244 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
245 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
247 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
251 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
252 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
254 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
258 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
259 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
261 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
265 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
266 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
268 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
272 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
273 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
275 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
278 * Some Wistron based laptops need us to explicitly enable the 'Dritek
279 * keyboard extension' to make their extra keys start generating scancodes.
280 * Originally, this was just confined to older laptops, but a few Acer laptops
281 * have turned up in 2007 that also need this again.
284 /* Acer Aspire 5100 */
286 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
287 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
289 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
292 /* Acer Aspire 5610 */
294 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
295 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
297 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
300 /* Acer Aspire 5630 */
302 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
303 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
305 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
308 /* Acer Aspire 5650 */
310 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
311 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
313 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
316 /* Acer Aspire 5680 */
318 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
319 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
321 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
324 /* Acer Aspire 5720 */
326 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
327 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
329 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
332 /* Acer Aspire 9110 */
334 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
335 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
337 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
340 /* Acer TravelMate 660 */
342 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
343 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
345 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
348 /* Acer TravelMate 2490 */
350 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
351 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
353 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
356 /* Acer TravelMate 4280 */
358 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
359 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
361 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
364 /* Acer TravelMate P459-G2-M */
366 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
367 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
369 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
374 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
375 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
377 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
381 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
382 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
384 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
389 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
390 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
392 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
396 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
397 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
398 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
400 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
404 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
405 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
406 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
408 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
413 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
414 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
416 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
419 /* Dell Embedded Box PC 3000 */
421 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
422 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
424 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
429 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
430 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
432 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
435 /* Dell Vostro 1510 */
437 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
438 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
440 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
443 /* Dell Vostro V13 */
445 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
446 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
448 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
451 /* Dell Vostro 1320 */
453 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
454 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
456 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
459 /* Dell Vostro 1520 */
461 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
462 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
464 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
467 /* Dell Vostro 1720 */
469 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
470 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
472 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
475 /* Entroware Proteus */
477 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
478 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
479 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
481 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
484 * Some Fujitsu notebooks are having trouble with touchpads if
485 * active multiplexing mode is activated. Luckily they don't have
486 * external PS/2 ports so we can safely disable it.
487 * ... apparently some Toshibas don't like MUX mode either and
488 * die horrible death on reboot.
491 /* Fujitsu Lifebook P7010/P7010D */
493 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
494 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
496 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
499 /* Fujitsu Lifebook P5020D */
501 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
502 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
504 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
507 /* Fujitsu Lifebook S2000 */
509 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
510 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
512 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
515 /* Fujitsu Lifebook S6230 */
517 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
518 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
520 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
523 /* Fujitsu Lifebook T725 laptop */
525 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
526 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
528 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
531 /* Fujitsu Lifebook U745 */
533 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
534 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
536 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
541 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
542 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
544 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
547 /* Fujitsu A544 laptop */
548 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
550 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
551 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
553 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
556 /* Fujitsu AH544 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 AH544"),
562 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
565 /* Fujitsu U574 laptop */
566 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
568 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
569 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
571 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
574 /* Fujitsu UH554 laptop */
576 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
577 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
579 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
582 /* Fujitsu Lifebook P7010 */
584 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
585 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
587 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
590 /* Fujitsu-Siemens Lifebook T3010 */
592 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
593 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
595 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
598 /* Fujitsu-Siemens Lifebook E4010 */
600 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
601 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
603 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
606 /* Fujitsu-Siemens Amilo Pro 2010 */
608 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
609 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
611 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
614 /* Fujitsu-Siemens Amilo Pro 2030 */
616 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
617 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
619 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
622 /* Fujitsu Lifebook A574/H */
624 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
625 DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
627 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
630 /* Fujitsu Lifebook E5411 */
632 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
633 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
635 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
638 /* Fujitsu Lifebook U728 */
640 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
641 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U728"),
643 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
648 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
649 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
650 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
652 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
655 /* Gigabyte Spring Peak - defines wrong chassis type */
657 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
658 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
660 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
663 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
665 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
666 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
668 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
671 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
673 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
674 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
676 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
679 * Some laptops need keyboard reset before probing for the trackpad to get
680 * it detected, initialised & finally work.
683 /* Gigabyte P35 v2 - Elantech touchpad */
685 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
686 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
688 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
691 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
693 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
694 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
696 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
699 /* Gigabyte P34 - Elantech touchpad */
701 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
702 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
704 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
707 /* Gigabyte P57 - Elantech touchpad */
709 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
710 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
712 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
715 /* Gericom Bellagio */
717 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
718 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
720 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
723 /* Gigabyte M1022M netbook */
725 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
726 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
727 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
729 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
733 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
734 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
735 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
737 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
741 * HP Pavilion DV4017EA -
742 * errors on MUX ports are reported without raising AUXDATA
743 * causing "spurious NAK" messages.
746 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
747 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
749 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
753 * HP Pavilion ZT1000 -
754 * like DV4017EA does not raise AUXERR for errors on MUX ports.
757 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
758 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
759 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
761 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
765 * HP Pavilion DV4270ca -
766 * like DV4017EA does not raise AUXERR for errors on MUX ports.
769 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
770 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
772 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
775 /* Newer HP Pavilion dv4 models */
777 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
778 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
780 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
785 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
786 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
788 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
791 /* Avatar AVIU-145A6 */
793 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
794 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
796 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
799 /* Intel MBO Desktop D845PESV */
801 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
802 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
804 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
808 * Intel NUC D54250WYK - does not have i8042 controller but
809 * declares PS/2 devices in DSDT.
812 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
813 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
815 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
818 /* Lenovo 3000 n100 */
820 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
821 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
823 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
826 /* Lenovo XiaoXin Air 12 */
828 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
829 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
831 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
836 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
837 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
839 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
842 /* Lenovo Ideapad U455 */
844 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
845 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
847 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
850 /* Lenovo ThinkPad L460 */
852 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
853 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
855 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
858 /* Lenovo ThinkPad Twist S230u */
860 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
861 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
863 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
866 /* LG Electronics X110 */
868 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
869 DMI_MATCH(DMI_BOARD_NAME, "X110"),
871 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
874 /* Medion Akoya Mini E1210 */
876 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
877 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
879 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
882 /* Medion Akoya E1222 */
884 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
885 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
887 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
892 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
893 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
895 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
899 * No data is coming from the touchscreen unless KBC
902 /* Panasonic CF-29 */
904 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
905 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
907 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
910 /* Medion Akoya E7225 */
912 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
913 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
914 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
916 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
919 /* Microsoft Virtual Machine */
921 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
922 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
923 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
925 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
928 /* Medion MAM 2070 */
930 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
931 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
932 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
934 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
939 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
940 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
942 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
947 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
948 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
949 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
951 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
955 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
956 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
958 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
961 /* Acer Aspire 5 A515 */
963 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
964 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
966 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
969 /* ULI EV4873 - AUX LOOP does not work properly */
971 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
972 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
973 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
975 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
979 * Arima-Rioworks HDAMB -
980 * AUX LOOP command does not raise AUX IRQ
983 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
984 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
985 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
987 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
990 /* Sharp Actius MM20 */
992 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
993 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
995 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
999 * Sony Vaio FZ-240E -
1000 * reset and GET ID commands issued via KBD port are
1001 * sometimes being delivered to AUX3.
1004 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1005 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
1007 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1011 * Most (all?) VAIOs do not have external PS/2 ports nor
1012 * they implement active multiplexing properly, and
1013 * MUX discovery usually messes up keyboard/touchpad.
1016 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1017 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
1019 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1022 /* Sony Vaio FS-115b */
1024 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1025 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1027 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1031 * Sony Vaio VGN-CS series require MUX or the touch sensor
1032 * buttons will disturb touchpad operation
1035 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1036 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1038 .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1042 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1043 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1045 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1049 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1050 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1052 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1056 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1057 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1059 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1062 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1063 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1064 * none of them have an external PS/2 port so this can safely be set for
1065 * all of them. These two are based on a Clevo design, but have the
1066 * board_name changed.
1070 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1071 DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1073 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1074 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1078 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1079 DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1081 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1082 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1087 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1088 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1090 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1093 * Some laptops need keyboard reset before probing for the trackpad to get
1094 * it detected, initialised & finally work.
1097 /* Schenker XMG C504 - Elantech touchpad */
1099 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1100 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1102 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1107 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1108 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1109 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1111 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1114 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1115 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1116 * none of them have an external PS/2 port so this can safely be set for
1118 * Clevo barebones come with board_vendor and/or system_vendor set to
1119 * either the very generic string "Notebook" and/or a different value
1120 * for each individual reseller. The only somewhat universal way to
1121 * identify them is by board_name.
1125 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1127 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1128 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1132 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1134 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1135 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1139 DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1141 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1142 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1146 DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1148 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1149 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1153 * Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
1154 * the keyboard very laggy for ~5 seconds after boot and
1155 * sometimes also after resume.
1156 * However both are required for the keyboard to not fail
1157 * completely sometimes after boot or resume.
1160 DMI_MATCH(DMI_BOARD_NAME, "N150CU"),
1162 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1163 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1167 DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1169 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1170 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1174 * Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
1175 * the keyboard very laggy for ~5 seconds after boot and
1176 * sometimes also after resume.
1177 * However both are required for the keyboard to not fail
1178 * completely sometimes after boot or resume.
1181 DMI_MATCH(DMI_BOARD_NAME, "NHxxRZQ"),
1183 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1184 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1188 DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1190 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1191 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1194 * At least one modern Clevo barebone has the touchpad connected both
1195 * via PS/2 and i2c interface. This causes a race condition between the
1196 * psmouse and i2c-hid driver. Since the full capability of the touchpad
1197 * is available via the i2c interface and the device has no external
1198 * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1199 * this issue. The known affected device is the
1200 * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1201 * the two different dmi strings below. NS50MU is not a typo!
1205 DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1207 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1208 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1213 DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1215 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1216 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1221 DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
1223 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
1227 DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1229 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1230 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1234 * This is only a partial board_name and might be followed by
1235 * another letter or number. DMI_MATCH however does do partial
1239 DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"),
1241 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1242 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1245 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
1247 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
1249 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1250 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1254 * This is only a partial board_name and might be followed by
1255 * another letter or number. DMI_MATCH however does do partial
1259 DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"),
1261 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1262 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1266 * This is only a partial board_name and might be followed by
1267 * another letter or number. DMI_MATCH however does do partial
1271 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"),
1273 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1274 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1278 * This is only a partial board_name and might be followed by
1279 * another letter or number. DMI_MATCH however does do partial
1283 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"),
1285 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1286 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1290 * This is only a partial board_name and might be followed by
1291 * another letter or number. DMI_MATCH however does do partial
1295 DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"),
1297 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1298 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1302 DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1304 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1305 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1309 DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
1311 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1312 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1314 /* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
1317 DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"),
1319 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
1323 DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1325 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1326 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1330 DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1332 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1333 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1339 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1342 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1347 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1352 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1357 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1364 #endif /* CONFIG_X86 */
1367 #include <linux/pnp.h>
1369 static bool i8042_pnp_kbd_registered;
1370 static unsigned int i8042_pnp_kbd_devices;
1371 static bool i8042_pnp_aux_registered;
1372 static unsigned int i8042_pnp_aux_devices;
1374 static int i8042_pnp_command_reg;
1375 static int i8042_pnp_data_reg;
1376 static int i8042_pnp_kbd_irq;
1377 static int i8042_pnp_aux_irq;
1379 static char i8042_pnp_kbd_name[32];
1380 static char i8042_pnp_aux_name[32];
1382 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1384 strscpy(dst, "PNP:", dst_size);
1387 strlcat(dst, " ", dst_size);
1388 strlcat(dst, id->id, dst_size);
1393 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1395 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1396 i8042_pnp_data_reg = pnp_port_start(dev,0);
1398 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1399 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1401 if (pnp_irq_valid(dev,0))
1402 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1404 strscpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1405 if (strlen(pnp_dev_name(dev))) {
1406 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1407 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1409 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1410 sizeof(i8042_kbd_firmware_id));
1411 i8042_kbd_fwnode = dev_fwnode(&dev->dev);
1413 /* Keyboard ports are always supposed to be wakeup-enabled */
1414 device_set_wakeup_enable(&dev->dev, true);
1416 i8042_pnp_kbd_devices++;
1420 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1422 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1423 i8042_pnp_data_reg = pnp_port_start(dev,0);
1425 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1426 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1428 if (pnp_irq_valid(dev, 0))
1429 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1431 strscpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1432 if (strlen(pnp_dev_name(dev))) {
1433 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1434 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1436 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1437 sizeof(i8042_aux_firmware_id));
1439 i8042_pnp_aux_devices++;
1443 static const struct pnp_device_id pnp_kbd_devids[] = {
1444 { .id = "PNP0300", .driver_data = 0 },
1445 { .id = "PNP0301", .driver_data = 0 },
1446 { .id = "PNP0302", .driver_data = 0 },
1447 { .id = "PNP0303", .driver_data = 0 },
1448 { .id = "PNP0304", .driver_data = 0 },
1449 { .id = "PNP0305", .driver_data = 0 },
1450 { .id = "PNP0306", .driver_data = 0 },
1451 { .id = "PNP0309", .driver_data = 0 },
1452 { .id = "PNP030a", .driver_data = 0 },
1453 { .id = "PNP030b", .driver_data = 0 },
1454 { .id = "PNP0320", .driver_data = 0 },
1455 { .id = "PNP0343", .driver_data = 0 },
1456 { .id = "PNP0344", .driver_data = 0 },
1457 { .id = "PNP0345", .driver_data = 0 },
1458 { .id = "CPQA0D7", .driver_data = 0 },
1461 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1463 static struct pnp_driver i8042_pnp_kbd_driver = {
1464 .name = "i8042 kbd",
1465 .id_table = pnp_kbd_devids,
1466 .probe = i8042_pnp_kbd_probe,
1468 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1469 .suppress_bind_attrs = true,
1473 static const struct pnp_device_id pnp_aux_devids[] = {
1474 { .id = "AUI0200", .driver_data = 0 },
1475 { .id = "FJC6000", .driver_data = 0 },
1476 { .id = "FJC6001", .driver_data = 0 },
1477 { .id = "PNP0f03", .driver_data = 0 },
1478 { .id = "PNP0f0b", .driver_data = 0 },
1479 { .id = "PNP0f0e", .driver_data = 0 },
1480 { .id = "PNP0f12", .driver_data = 0 },
1481 { .id = "PNP0f13", .driver_data = 0 },
1482 { .id = "PNP0f19", .driver_data = 0 },
1483 { .id = "PNP0f1c", .driver_data = 0 },
1484 { .id = "SYN0801", .driver_data = 0 },
1487 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1489 static struct pnp_driver i8042_pnp_aux_driver = {
1490 .name = "i8042 aux",
1491 .id_table = pnp_aux_devids,
1492 .probe = i8042_pnp_aux_probe,
1494 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1495 .suppress_bind_attrs = true,
1499 static void i8042_pnp_exit(void)
1501 if (i8042_pnp_kbd_registered) {
1502 i8042_pnp_kbd_registered = false;
1503 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1506 if (i8042_pnp_aux_registered) {
1507 i8042_pnp_aux_registered = false;
1508 pnp_unregister_driver(&i8042_pnp_aux_driver);
1512 static int __init i8042_pnp_init(void)
1514 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1515 bool pnp_data_busted = false;
1519 pr_info("PNP detection disabled\n");
1523 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1525 i8042_pnp_kbd_registered = true;
1527 err = pnp_register_driver(&i8042_pnp_aux_driver);
1529 i8042_pnp_aux_registered = true;
1531 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1533 #if defined(__ia64__)
1536 pr_info("PNP: No PS/2 controller found.\n");
1537 #if defined(__loongarch__)
1538 if (acpi_disabled == 0)
1541 if (x86_platform.legacy.i8042 !=
1542 X86_LEGACY_I8042_EXPECTED_PRESENT)
1545 pr_info("Probing ports directly.\n");
1550 if (i8042_pnp_kbd_devices)
1551 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1552 "%d", i8042_pnp_kbd_irq);
1553 if (i8042_pnp_aux_devices)
1554 snprintf(aux_irq_str, sizeof(aux_irq_str),
1555 "%d", i8042_pnp_aux_irq);
1557 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1558 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1560 i8042_pnp_data_reg, i8042_pnp_command_reg,
1561 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1564 #if defined(__ia64__)
1565 if (!i8042_pnp_kbd_devices)
1567 if (!i8042_pnp_aux_devices)
1571 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1572 i8042_pnp_data_reg != i8042_data_reg) ||
1573 !i8042_pnp_data_reg) {
1574 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1575 i8042_pnp_data_reg, i8042_data_reg);
1576 i8042_pnp_data_reg = i8042_data_reg;
1577 pnp_data_busted = true;
1580 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1581 i8042_pnp_command_reg != i8042_command_reg) ||
1582 !i8042_pnp_command_reg) {
1583 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1584 i8042_pnp_command_reg, i8042_command_reg);
1585 i8042_pnp_command_reg = i8042_command_reg;
1586 pnp_data_busted = true;
1589 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1590 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1592 i8042_pnp_kbd_irq = i8042_kbd_irq;
1593 pnp_data_busted = true;
1596 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1597 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1598 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1599 "if this is incorrect please boot with i8042.nopnp\n");
1602 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1604 i8042_pnp_aux_irq = i8042_aux_irq;
1608 i8042_data_reg = i8042_pnp_data_reg;
1609 i8042_command_reg = i8042_pnp_command_reg;
1610 i8042_kbd_irq = i8042_pnp_kbd_irq;
1611 i8042_aux_irq = i8042_pnp_aux_irq;
1614 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1615 dmi_check_system(i8042_dmi_laptop_table);
1621 #else /* !CONFIG_PNP */
1622 static inline int i8042_pnp_init(void) { return 0; }
1623 static inline void i8042_pnp_exit(void) { }
1624 #endif /* CONFIG_PNP */
1628 static void __init i8042_check_quirks(void)
1630 const struct dmi_system_id *device_quirk_info;
1633 device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1634 if (!device_quirk_info)
1637 quirks = (uintptr_t)device_quirk_info->driver_data;
1639 if (quirks & SERIO_QUIRK_NOKBD)
1641 if (quirks & SERIO_QUIRK_NOAUX)
1643 if (quirks & SERIO_QUIRK_NOMUX)
1645 if (quirks & SERIO_QUIRK_FORCEMUX)
1646 i8042_nomux = false;
1647 if (quirks & SERIO_QUIRK_UNLOCK)
1648 i8042_unlock = true;
1649 if (quirks & SERIO_QUIRK_PROBE_DEFER)
1650 i8042_probe_defer = true;
1651 /* Honor module parameter when value is not default */
1652 if (i8042_reset == I8042_RESET_DEFAULT) {
1653 if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1654 i8042_reset = I8042_RESET_ALWAYS;
1655 if (quirks & SERIO_QUIRK_RESET_NEVER)
1656 i8042_reset = I8042_RESET_NEVER;
1658 if (quirks & SERIO_QUIRK_DIECT)
1659 i8042_direct = true;
1660 if (quirks & SERIO_QUIRK_DUMBKBD)
1661 i8042_dumbkbd = true;
1662 if (quirks & SERIO_QUIRK_NOLOOP)
1663 i8042_noloop = true;
1664 if (quirks & SERIO_QUIRK_NOTIMEOUT)
1665 i8042_notimeout = true;
1666 if (quirks & SERIO_QUIRK_KBDRESET)
1667 i8042_kbdreset = true;
1668 if (quirks & SERIO_QUIRK_DRITEK)
1669 i8042_dritek = true;
1671 if (quirks & SERIO_QUIRK_NOPNP)
1676 static inline void i8042_check_quirks(void) {}
1679 static int __init i8042_platform_init(void)
1685 /* Just return if platform does not have i8042 controller */
1686 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1691 * On ix86 platforms touching the i8042 data register region can do really
1692 * bad things. Because of this the region is always reserved on ix86 boxes.
1694 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1698 i8042_kbd_irq = I8042_MAP_IRQ(1);
1699 i8042_aux_irq = I8042_MAP_IRQ(12);
1701 #if defined(__ia64__)
1702 i8042_reset = I8042_RESET_ALWAYS;
1705 i8042_check_quirks();
1707 pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
1708 i8042_nokbd ? " nokbd" : "",
1709 i8042_noaux ? " noaux" : "",
1710 i8042_nomux ? " nomux" : "",
1711 i8042_unlock ? " unlock" : "",
1712 i8042_probe_defer ? "probe_defer" : "",
1713 i8042_reset == I8042_RESET_DEFAULT ?
1714 "" : i8042_reset == I8042_RESET_ALWAYS ?
1715 " reset_always" : " reset_never",
1716 i8042_direct ? " direct" : "",
1717 i8042_dumbkbd ? " dumbkbd" : "",
1718 i8042_noloop ? " noloop" : "",
1719 i8042_notimeout ? " notimeout" : "",
1720 i8042_kbdreset ? " kbdreset" : "",
1722 i8042_dritek ? " dritek" : "",
1727 i8042_nopnp ? " nopnp" : "");
1732 retval = i8042_pnp_init();
1738 * A20 was already enabled during early kernel init. But some buggy
1739 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1740 * resume from S3. So we do it here and hope that nothing breaks.
1742 i8042_command(&a20_on, 0x10d1);
1743 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1744 #endif /* CONFIG_X86 */
1749 static inline void i8042_platform_exit(void)
1754 #endif /* _I8042_ACPIPNPIO_H */