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)
366 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
367 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
369 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
373 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
374 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
376 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
381 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
382 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
384 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
388 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
389 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
390 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
392 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
396 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
397 DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
398 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
400 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
405 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
406 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
408 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
411 /* Dell Embedded Box PC 3000 */
413 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
414 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
416 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
421 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
422 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
424 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
427 /* Dell Vostro 1510 */
429 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
430 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
432 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
435 /* Dell Vostro V13 */
437 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
438 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
440 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
443 /* Dell Vostro 1320 */
445 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
446 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
448 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
451 /* Dell Vostro 1520 */
453 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
454 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
456 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
459 /* Dell Vostro 1720 */
461 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
462 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
464 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
467 /* Entroware Proteus */
469 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
470 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
471 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
473 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
476 * Some Fujitsu notebooks are having trouble with touchpads if
477 * active multiplexing mode is activated. Luckily they don't have
478 * external PS/2 ports so we can safely disable it.
479 * ... apparently some Toshibas don't like MUX mode either and
480 * die horrible death on reboot.
483 /* Fujitsu Lifebook P7010/P7010D */
485 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
486 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
488 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
491 /* Fujitsu Lifebook P5020D */
493 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
494 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
496 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
499 /* Fujitsu Lifebook S2000 */
501 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
502 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
504 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
507 /* Fujitsu Lifebook S6230 */
509 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
510 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
512 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
515 /* Fujitsu Lifebook T725 laptop */
517 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
518 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
520 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
523 /* Fujitsu Lifebook U745 */
525 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
526 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
528 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
533 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
534 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
536 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
539 /* Fujitsu A544 laptop */
540 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
542 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
543 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
545 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
548 /* Fujitsu AH544 laptop */
549 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
551 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
552 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
554 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
557 /* Fujitsu U574 laptop */
558 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
560 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
561 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
563 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
566 /* Fujitsu UH554 laptop */
568 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
569 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
571 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
574 /* Fujitsu Lifebook P7010 */
576 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
577 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
579 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
582 /* Fujitsu-Siemens Lifebook T3010 */
584 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
585 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
587 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
590 /* Fujitsu-Siemens Lifebook E4010 */
592 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
593 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
595 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
598 /* Fujitsu-Siemens Amilo Pro 2010 */
600 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
601 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
603 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
606 /* Fujitsu-Siemens Amilo Pro 2030 */
608 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
609 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
611 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
614 /* Fujitsu Lifebook A574/H */
616 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
617 DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
619 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
624 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
625 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
626 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
628 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
631 /* Gigabyte Spring Peak - defines wrong chassis type */
633 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
634 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
636 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
639 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
641 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
642 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
644 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
647 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
649 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
650 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
652 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
655 * Some laptops need keyboard reset before probing for the trackpad to get
656 * it detected, initialised & finally work.
659 /* Gigabyte P35 v2 - Elantech touchpad */
661 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
662 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
664 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
667 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
669 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
670 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
672 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
675 /* Gigabyte P34 - Elantech touchpad */
677 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
678 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
680 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
683 /* Gigabyte P57 - Elantech touchpad */
685 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
686 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
688 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
691 /* Gericom Bellagio */
693 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
694 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
696 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
699 /* Gigabyte M1022M netbook */
701 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
702 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
703 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
705 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
709 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
710 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
711 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
713 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
717 * HP Pavilion DV4017EA -
718 * errors on MUX ports are reported without raising AUXDATA
719 * causing "spurious NAK" messages.
722 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
723 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
725 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
729 * HP Pavilion ZT1000 -
730 * like DV4017EA does not raise AUXERR for errors on MUX ports.
733 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
734 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
735 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
737 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
741 * HP Pavilion DV4270ca -
742 * like DV4017EA does not raise AUXERR for errors on MUX ports.
745 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
746 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
748 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
751 /* Newer HP Pavilion dv4 models */
753 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
754 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
756 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
761 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
762 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
764 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
767 /* Avatar AVIU-145A6 */
769 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
770 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
772 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
775 /* Intel MBO Desktop D845PESV */
777 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
778 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
780 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
784 * Intel NUC D54250WYK - does not have i8042 controller but
785 * declares PS/2 devices in DSDT.
788 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
789 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
791 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
794 /* Lenovo 3000 n100 */
796 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
797 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
799 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
802 /* Lenovo XiaoXin Air 12 */
804 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
805 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
807 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
812 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
813 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
815 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
818 /* Lenovo Ideapad U455 */
820 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
821 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
823 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
826 /* Lenovo ThinkPad L460 */
828 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
829 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
831 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
834 /* Lenovo ThinkPad Twist S230u */
836 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
837 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
839 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
842 /* LG Electronics X110 */
844 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
845 DMI_MATCH(DMI_BOARD_NAME, "X110"),
847 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
850 /* Medion Akoya Mini E1210 */
852 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
853 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
855 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
858 /* Medion Akoya E1222 */
860 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
861 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
863 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
868 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
869 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
871 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
875 * No data is coming from the touchscreen unless KBC
878 /* Panasonic CF-29 */
880 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
881 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
883 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
886 /* Medion Akoya E7225 */
888 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
889 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
890 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
892 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
895 /* Microsoft Virtual Machine */
897 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
898 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
899 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
901 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
904 /* Medion MAM 2070 */
906 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
907 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
908 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
910 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
915 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
916 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
918 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
923 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
924 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
925 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
927 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
931 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
932 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
934 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
937 /* Acer Aspire 5 A515 */
939 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
940 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
942 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
945 /* ULI EV4873 - AUX LOOP does not work properly */
947 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
948 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
949 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
951 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
955 * Arima-Rioworks HDAMB -
956 * AUX LOOP command does not raise AUX IRQ
959 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
960 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
961 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
963 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
966 /* Sharp Actius MM20 */
968 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
969 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
971 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
975 * Sony Vaio FZ-240E -
976 * reset and GET ID commands issued via KBD port are
977 * sometimes being delivered to AUX3.
980 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
981 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
983 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
987 * Most (all?) VAIOs do not have external PS/2 ports nor
988 * they implement active multiplexing properly, and
989 * MUX discovery usually messes up keyboard/touchpad.
992 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
993 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
995 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
998 /* Sony Vaio FS-115b */
1000 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1001 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1003 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1007 * Sony Vaio VGN-CS series require MUX or the touch sensor
1008 * buttons will disturb touchpad operation
1011 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1012 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1014 .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1018 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1019 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1021 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1025 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1026 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1028 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1032 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1033 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1035 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1038 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1039 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1040 * none of them have an external PS/2 port so this can safely be set for
1041 * all of them. These two are based on a Clevo design, but have the
1042 * board_name changed.
1046 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1047 DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1049 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1050 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1054 DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1055 DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1057 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1058 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1063 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1064 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1066 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1069 * Some laptops need keyboard reset before probing for the trackpad to get
1070 * it detected, initialised & finally work.
1073 /* Schenker XMG C504 - Elantech touchpad */
1075 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1076 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1078 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1083 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1084 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1085 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1087 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1090 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1091 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1092 * none of them have an external PS/2 port so this can safely be set for
1094 * Clevo barebones come with board_vendor and/or system_vendor set to
1095 * either the very generic string "Notebook" and/or a different value
1096 * for each individual reseller. The only somewhat universal way to
1097 * identify them is by board_name.
1101 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1103 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1104 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1108 DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1110 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1111 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1115 DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1117 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1118 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1122 DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1124 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1125 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1129 * Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
1130 * the keyboard very laggy for ~5 seconds after boot and
1131 * sometimes also after resume.
1132 * However both are required for the keyboard to not fail
1133 * completely sometimes after boot or resume.
1136 DMI_MATCH(DMI_BOARD_NAME, "N150CU"),
1138 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1139 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1143 DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1145 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1146 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1150 * Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
1151 * the keyboard very laggy for ~5 seconds after boot and
1152 * sometimes also after resume.
1153 * However both are required for the keyboard to not fail
1154 * completely sometimes after boot or resume.
1157 DMI_MATCH(DMI_BOARD_NAME, "NHxxRZQ"),
1159 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1160 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1164 DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1166 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1167 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1170 * At least one modern Clevo barebone has the touchpad connected both
1171 * via PS/2 and i2c interface. This causes a race condition between the
1172 * psmouse and i2c-hid driver. Since the full capability of the touchpad
1173 * is available via the i2c interface and the device has no external
1174 * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1175 * this issue. The known affected device is the
1176 * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1177 * the two different dmi strings below. NS50MU is not a typo!
1181 DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1183 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1184 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1189 DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1191 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1192 SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1197 DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1199 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1200 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1204 * This is only a partial board_name and might be followed by
1205 * another letter or number. DMI_MATCH however does do partial
1209 DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"),
1211 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1212 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1215 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
1217 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
1219 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1220 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1224 * This is only a partial board_name and might be followed by
1225 * another letter or number. DMI_MATCH however does do partial
1229 DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"),
1231 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1232 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1236 * This is only a partial board_name and might be followed by
1237 * another letter or number. DMI_MATCH however does do partial
1241 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"),
1243 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1244 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1248 * This is only a partial board_name and might be followed by
1249 * another letter or number. DMI_MATCH however does do partial
1253 DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"),
1255 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1256 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1260 * This is only a partial board_name and might be followed by
1261 * another letter or number. DMI_MATCH however does do partial
1265 DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"),
1267 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1268 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1272 DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1274 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1275 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1279 DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
1281 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1282 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1284 /* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
1287 DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"),
1289 .driver_data = (void *)(SERIO_QUIRK_NOAUX)
1293 DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1295 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1296 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1300 DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1302 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1303 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1309 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1312 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1317 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1322 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1327 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1334 #endif /* CONFIG_X86 */
1337 #include <linux/pnp.h>
1339 static bool i8042_pnp_kbd_registered;
1340 static unsigned int i8042_pnp_kbd_devices;
1341 static bool i8042_pnp_aux_registered;
1342 static unsigned int i8042_pnp_aux_devices;
1344 static int i8042_pnp_command_reg;
1345 static int i8042_pnp_data_reg;
1346 static int i8042_pnp_kbd_irq;
1347 static int i8042_pnp_aux_irq;
1349 static char i8042_pnp_kbd_name[32];
1350 static char i8042_pnp_aux_name[32];
1352 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1354 strscpy(dst, "PNP:", dst_size);
1357 strlcat(dst, " ", dst_size);
1358 strlcat(dst, id->id, dst_size);
1363 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1365 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1366 i8042_pnp_data_reg = pnp_port_start(dev,0);
1368 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1369 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1371 if (pnp_irq_valid(dev,0))
1372 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1374 strscpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1375 if (strlen(pnp_dev_name(dev))) {
1376 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1377 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1379 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1380 sizeof(i8042_kbd_firmware_id));
1381 i8042_kbd_fwnode = dev_fwnode(&dev->dev);
1383 /* Keyboard ports are always supposed to be wakeup-enabled */
1384 device_set_wakeup_enable(&dev->dev, true);
1386 i8042_pnp_kbd_devices++;
1390 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1392 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1393 i8042_pnp_data_reg = pnp_port_start(dev,0);
1395 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1396 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1398 if (pnp_irq_valid(dev, 0))
1399 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1401 strscpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1402 if (strlen(pnp_dev_name(dev))) {
1403 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1404 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1406 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1407 sizeof(i8042_aux_firmware_id));
1409 i8042_pnp_aux_devices++;
1413 static const struct pnp_device_id pnp_kbd_devids[] = {
1414 { .id = "PNP0300", .driver_data = 0 },
1415 { .id = "PNP0301", .driver_data = 0 },
1416 { .id = "PNP0302", .driver_data = 0 },
1417 { .id = "PNP0303", .driver_data = 0 },
1418 { .id = "PNP0304", .driver_data = 0 },
1419 { .id = "PNP0305", .driver_data = 0 },
1420 { .id = "PNP0306", .driver_data = 0 },
1421 { .id = "PNP0309", .driver_data = 0 },
1422 { .id = "PNP030a", .driver_data = 0 },
1423 { .id = "PNP030b", .driver_data = 0 },
1424 { .id = "PNP0320", .driver_data = 0 },
1425 { .id = "PNP0343", .driver_data = 0 },
1426 { .id = "PNP0344", .driver_data = 0 },
1427 { .id = "PNP0345", .driver_data = 0 },
1428 { .id = "CPQA0D7", .driver_data = 0 },
1431 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1433 static struct pnp_driver i8042_pnp_kbd_driver = {
1434 .name = "i8042 kbd",
1435 .id_table = pnp_kbd_devids,
1436 .probe = i8042_pnp_kbd_probe,
1438 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1439 .suppress_bind_attrs = true,
1443 static const struct pnp_device_id pnp_aux_devids[] = {
1444 { .id = "AUI0200", .driver_data = 0 },
1445 { .id = "FJC6000", .driver_data = 0 },
1446 { .id = "FJC6001", .driver_data = 0 },
1447 { .id = "PNP0f03", .driver_data = 0 },
1448 { .id = "PNP0f0b", .driver_data = 0 },
1449 { .id = "PNP0f0e", .driver_data = 0 },
1450 { .id = "PNP0f12", .driver_data = 0 },
1451 { .id = "PNP0f13", .driver_data = 0 },
1452 { .id = "PNP0f19", .driver_data = 0 },
1453 { .id = "PNP0f1c", .driver_data = 0 },
1454 { .id = "SYN0801", .driver_data = 0 },
1457 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1459 static struct pnp_driver i8042_pnp_aux_driver = {
1460 .name = "i8042 aux",
1461 .id_table = pnp_aux_devids,
1462 .probe = i8042_pnp_aux_probe,
1464 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1465 .suppress_bind_attrs = true,
1469 static void i8042_pnp_exit(void)
1471 if (i8042_pnp_kbd_registered) {
1472 i8042_pnp_kbd_registered = false;
1473 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1476 if (i8042_pnp_aux_registered) {
1477 i8042_pnp_aux_registered = false;
1478 pnp_unregister_driver(&i8042_pnp_aux_driver);
1482 static int __init i8042_pnp_init(void)
1484 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1485 bool pnp_data_busted = false;
1489 pr_info("PNP detection disabled\n");
1493 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1495 i8042_pnp_kbd_registered = true;
1497 err = pnp_register_driver(&i8042_pnp_aux_driver);
1499 i8042_pnp_aux_registered = true;
1501 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1503 #if defined(__ia64__)
1506 pr_info("PNP: No PS/2 controller found.\n");
1507 #if defined(__loongarch__)
1508 if (acpi_disabled == 0)
1511 if (x86_platform.legacy.i8042 !=
1512 X86_LEGACY_I8042_EXPECTED_PRESENT)
1515 pr_info("Probing ports directly.\n");
1520 if (i8042_pnp_kbd_devices)
1521 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1522 "%d", i8042_pnp_kbd_irq);
1523 if (i8042_pnp_aux_devices)
1524 snprintf(aux_irq_str, sizeof(aux_irq_str),
1525 "%d", i8042_pnp_aux_irq);
1527 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1528 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1530 i8042_pnp_data_reg, i8042_pnp_command_reg,
1531 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1534 #if defined(__ia64__)
1535 if (!i8042_pnp_kbd_devices)
1537 if (!i8042_pnp_aux_devices)
1541 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1542 i8042_pnp_data_reg != i8042_data_reg) ||
1543 !i8042_pnp_data_reg) {
1544 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1545 i8042_pnp_data_reg, i8042_data_reg);
1546 i8042_pnp_data_reg = i8042_data_reg;
1547 pnp_data_busted = true;
1550 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1551 i8042_pnp_command_reg != i8042_command_reg) ||
1552 !i8042_pnp_command_reg) {
1553 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1554 i8042_pnp_command_reg, i8042_command_reg);
1555 i8042_pnp_command_reg = i8042_command_reg;
1556 pnp_data_busted = true;
1559 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1560 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1562 i8042_pnp_kbd_irq = i8042_kbd_irq;
1563 pnp_data_busted = true;
1566 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1567 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1568 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1569 "if this is incorrect please boot with i8042.nopnp\n");
1572 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1574 i8042_pnp_aux_irq = i8042_aux_irq;
1578 i8042_data_reg = i8042_pnp_data_reg;
1579 i8042_command_reg = i8042_pnp_command_reg;
1580 i8042_kbd_irq = i8042_pnp_kbd_irq;
1581 i8042_aux_irq = i8042_pnp_aux_irq;
1584 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1585 dmi_check_system(i8042_dmi_laptop_table);
1591 #else /* !CONFIG_PNP */
1592 static inline int i8042_pnp_init(void) { return 0; }
1593 static inline void i8042_pnp_exit(void) { }
1594 #endif /* CONFIG_PNP */
1598 static void __init i8042_check_quirks(void)
1600 const struct dmi_system_id *device_quirk_info;
1603 device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1604 if (!device_quirk_info)
1607 quirks = (uintptr_t)device_quirk_info->driver_data;
1609 if (quirks & SERIO_QUIRK_NOKBD)
1611 if (quirks & SERIO_QUIRK_NOAUX)
1613 if (quirks & SERIO_QUIRK_NOMUX)
1615 if (quirks & SERIO_QUIRK_FORCEMUX)
1616 i8042_nomux = false;
1617 if (quirks & SERIO_QUIRK_UNLOCK)
1618 i8042_unlock = true;
1619 if (quirks & SERIO_QUIRK_PROBE_DEFER)
1620 i8042_probe_defer = true;
1621 /* Honor module parameter when value is not default */
1622 if (i8042_reset == I8042_RESET_DEFAULT) {
1623 if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1624 i8042_reset = I8042_RESET_ALWAYS;
1625 if (quirks & SERIO_QUIRK_RESET_NEVER)
1626 i8042_reset = I8042_RESET_NEVER;
1628 if (quirks & SERIO_QUIRK_DIECT)
1629 i8042_direct = true;
1630 if (quirks & SERIO_QUIRK_DUMBKBD)
1631 i8042_dumbkbd = true;
1632 if (quirks & SERIO_QUIRK_NOLOOP)
1633 i8042_noloop = true;
1634 if (quirks & SERIO_QUIRK_NOTIMEOUT)
1635 i8042_notimeout = true;
1636 if (quirks & SERIO_QUIRK_KBDRESET)
1637 i8042_kbdreset = true;
1638 if (quirks & SERIO_QUIRK_DRITEK)
1639 i8042_dritek = true;
1641 if (quirks & SERIO_QUIRK_NOPNP)
1646 static inline void i8042_check_quirks(void) {}
1649 static int __init i8042_platform_init(void)
1655 /* Just return if platform does not have i8042 controller */
1656 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1661 * On ix86 platforms touching the i8042 data register region can do really
1662 * bad things. Because of this the region is always reserved on ix86 boxes.
1664 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1668 i8042_kbd_irq = I8042_MAP_IRQ(1);
1669 i8042_aux_irq = I8042_MAP_IRQ(12);
1671 #if defined(__ia64__)
1672 i8042_reset = I8042_RESET_ALWAYS;
1675 i8042_check_quirks();
1677 pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
1678 i8042_nokbd ? " nokbd" : "",
1679 i8042_noaux ? " noaux" : "",
1680 i8042_nomux ? " nomux" : "",
1681 i8042_unlock ? " unlock" : "",
1682 i8042_probe_defer ? "probe_defer" : "",
1683 i8042_reset == I8042_RESET_DEFAULT ?
1684 "" : i8042_reset == I8042_RESET_ALWAYS ?
1685 " reset_always" : " reset_never",
1686 i8042_direct ? " direct" : "",
1687 i8042_dumbkbd ? " dumbkbd" : "",
1688 i8042_noloop ? " noloop" : "",
1689 i8042_notimeout ? " notimeout" : "",
1690 i8042_kbdreset ? " kbdreset" : "",
1692 i8042_dritek ? " dritek" : "",
1697 i8042_nopnp ? " nopnp" : "");
1702 retval = i8042_pnp_init();
1708 * A20 was already enabled during early kernel init. But some buggy
1709 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1710 * resume from S3. So we do it here and hope that nothing breaks.
1712 i8042_command(&a20_on, 0x10d1);
1713 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1714 #endif /* CONFIG_X86 */
1719 static inline void i8042_platform_exit(void)
1724 #endif /* _I8042_ACPIPNPIO_H */