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 static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
73 * Arima-Rioworks HDAMB -
74 * AUX LOOP command does not raise AUX IRQ
77 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
78 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
79 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
85 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
86 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
87 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
91 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
93 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
94 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
95 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
100 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
101 DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
106 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
107 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
108 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
113 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
114 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
115 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
119 /* Dell Embedded Box PC 3000 */
121 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
122 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
128 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
129 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
130 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
134 /* ULI EV4873 - AUX LOOP does not work properly */
136 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
137 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
138 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
142 /* Microsoft Virtual Machine */
144 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
145 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
146 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
150 /* Medion MAM 2070 */
152 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
153 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
154 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
158 /* Medion Akoya E7225 */
160 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
161 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
162 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
168 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
169 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
170 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
176 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
177 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
178 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
182 /* Gigabyte M1022M netbook */
184 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
185 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
186 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
190 /* Gigabyte Spring Peak - defines wrong chassis type */
192 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
193 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
197 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
199 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
200 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
204 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
206 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
207 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
212 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
213 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
214 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
219 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
220 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
227 * Some Fujitsu notebooks are having trouble with touchpads if
228 * active multiplexing mode is activated. Luckily they don't have
229 * external PS/2 ports so we can safely disable it.
230 * ... apparently some Toshibas don't like MUX mode either and
231 * die horrible death on reboot.
233 static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
235 /* Fujitsu Lifebook P7010/P7010D */
237 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
238 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
242 /* Fujitsu Lifebook P7010 */
244 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
245 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
249 /* Fujitsu Lifebook P5020D */
251 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
252 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
256 /* Fujitsu Lifebook S2000 */
258 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
259 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
263 /* Fujitsu Lifebook S6230 */
265 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
266 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
270 /* Fujitsu Lifebook U745 */
272 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
273 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
279 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
280 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
284 /* Fujitsu-Siemens Lifebook T3010 */
286 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
287 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
291 /* Fujitsu-Siemens Lifebook E4010 */
293 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
294 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
298 /* Fujitsu-Siemens Amilo Pro 2010 */
300 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
301 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
305 /* Fujitsu-Siemens Amilo Pro 2030 */
307 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
308 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
313 * No data is coming from the touchscreen unless KBC
316 /* Panasonic CF-29 */
318 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
319 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
324 * HP Pavilion DV4017EA -
325 * errors on MUX ports are reported without raising AUXDATA
326 * causing "spurious NAK" messages.
329 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
330 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
335 * HP Pavilion ZT1000 -
336 * like DV4017EA does not raise AUXERR for errors on MUX ports.
339 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
340 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
341 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
346 * HP Pavilion DV4270ca -
347 * like DV4017EA does not raise AUXERR for errors on MUX ports.
350 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
351 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
356 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
357 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
362 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
363 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
368 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
369 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
374 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
375 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
379 /* Sharp Actius MM20 */
381 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
382 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
386 /* Sony Vaio FS-115b */
388 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
389 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
394 * Sony Vaio FZ-240E -
395 * reset and GET ID commands issued via KBD port are
396 * sometimes being delivered to AUX3.
399 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
400 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
405 * Most (all?) VAIOs do not have external PS/2 ports nor
406 * they implement active multiplexing properly, and
407 * MUX discovery usually messes up keyboard/touchpad.
410 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
411 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
417 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
418 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
422 /* Lenovo 3000 n100 */
424 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
425 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
430 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
431 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
435 /* Acer Aspire 5710 */
437 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
438 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
442 /* Acer Aspire 7738 */
444 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
445 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
449 /* Gericom Bellagio */
451 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
452 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
458 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
459 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
465 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
466 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
472 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
473 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
477 /* Dell Vostro 1510 */
479 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
480 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
484 /* Acer Aspire 5536 */
486 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
487 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
488 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
492 /* Dell Vostro V13 */
494 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
495 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
499 /* Newer HP Pavilion dv4 models */
501 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
502 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
508 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
509 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
513 /* Avatar AVIU-145A6 */
515 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
516 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
522 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
523 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
529 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
530 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
536 * Touchpad stops working in mux mode when dis- + re-enabled
537 * with the touchpad enable/disable toggle hotkey
540 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
541 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
547 static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
550 * Sony Vaio VGN-CS series require MUX or the touch sensor
551 * buttons will disturb touchpad operation
554 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
555 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
562 * On some Asus laptops, just running self tests cause problems.
564 static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
567 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
568 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
573 static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
577 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
578 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
582 /* LG Electronics X110 */
584 DMI_MATCH(DMI_BOARD_NAME, "X110"),
585 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
589 /* Acer Aspire One 150 */
591 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
592 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
598 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
599 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
603 /* Medion Akoya Mini E1210 */
605 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
606 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
610 /* Medion Akoya E1222 */
612 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
613 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
619 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
620 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
624 /* Dell Vostro 1320 */
626 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
627 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
631 /* Dell Vostro 1520 */
633 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
634 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
638 /* Dell Vostro 1720 */
640 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
641 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
645 /* Lenovo Ideapad U455 */
647 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
648 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
652 /* Lenovo ThinkPad L460 */
654 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
655 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
659 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
661 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
662 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
666 /* Lenovo ThinkPad Twist S230u */
668 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
669 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
676 static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
678 /* Intel MBO Desktop D845PESV */
680 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
681 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
686 * Intel NUC D54250WYK - does not have i8042 controller but
687 * declares PS/2 devices in DSDT.
690 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
691 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
697 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
698 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
704 static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
707 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
712 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
717 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
722 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
729 static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
731 /* Dell Vostro V13 */
733 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
734 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
738 /* Newer HP Pavilion dv4 models */
740 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
741 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
745 /* Fujitsu A544 laptop */
746 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
748 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
749 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
753 /* Fujitsu AH544 laptop */
754 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
756 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
757 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
761 /* Fujitsu U574 laptop */
762 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
764 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
765 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
769 /* Fujitsu UH554 laptop */
771 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
772 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
779 * Some Wistron based laptops need us to explicitly enable the 'Dritek
780 * keyboard extension' to make their extra keys start generating scancodes.
781 * Originally, this was just confined to older laptops, but a few Acer laptops
782 * have turned up in 2007 that also need this again.
784 static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
786 /* Acer Aspire 5100 */
788 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
789 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
793 /* Acer Aspire 5610 */
795 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
796 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
800 /* Acer Aspire 5630 */
802 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
803 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
807 /* Acer Aspire 5650 */
809 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
810 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
814 /* Acer Aspire 5680 */
816 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
817 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
821 /* Acer Aspire 5720 */
823 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
824 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
828 /* Acer Aspire 9110 */
830 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
831 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
835 /* Acer TravelMate 660 */
837 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
838 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
842 /* Acer TravelMate 2490 */
844 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
845 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
849 /* Acer TravelMate 4280 */
851 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
852 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
859 * Some laptops need keyboard reset before probing for the trackpad to get
860 * it detected, initialised & finally work.
862 static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
864 /* Gigabyte P35 v2 - Elantech touchpad */
866 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
867 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
871 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
873 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
874 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
878 /* Gigabyte P34 - Elantech touchpad */
880 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
881 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
885 /* Gigabyte P57 - Elantech touchpad */
887 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
888 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
892 /* Schenker XMG C504 - Elantech touchpad */
894 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
895 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
901 #endif /* CONFIG_X86 */
904 #include <linux/pnp.h>
906 static bool i8042_pnp_kbd_registered;
907 static unsigned int i8042_pnp_kbd_devices;
908 static bool i8042_pnp_aux_registered;
909 static unsigned int i8042_pnp_aux_devices;
911 static int i8042_pnp_command_reg;
912 static int i8042_pnp_data_reg;
913 static int i8042_pnp_kbd_irq;
914 static int i8042_pnp_aux_irq;
916 static char i8042_pnp_kbd_name[32];
917 static char i8042_pnp_aux_name[32];
919 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
921 strlcpy(dst, "PNP:", dst_size);
924 strlcat(dst, " ", dst_size);
925 strlcat(dst, id->id, dst_size);
930 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
932 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
933 i8042_pnp_data_reg = pnp_port_start(dev,0);
935 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
936 i8042_pnp_command_reg = pnp_port_start(dev, 1);
938 if (pnp_irq_valid(dev,0))
939 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
941 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
942 if (strlen(pnp_dev_name(dev))) {
943 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
944 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
946 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
947 sizeof(i8042_kbd_firmware_id));
949 /* Keyboard ports are always supposed to be wakeup-enabled */
950 device_set_wakeup_enable(&dev->dev, true);
952 i8042_pnp_kbd_devices++;
956 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
958 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
959 i8042_pnp_data_reg = pnp_port_start(dev,0);
961 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
962 i8042_pnp_command_reg = pnp_port_start(dev, 1);
964 if (pnp_irq_valid(dev, 0))
965 i8042_pnp_aux_irq = pnp_irq(dev, 0);
967 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
968 if (strlen(pnp_dev_name(dev))) {
969 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
970 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
972 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
973 sizeof(i8042_aux_firmware_id));
975 i8042_pnp_aux_devices++;
979 static const struct pnp_device_id pnp_kbd_devids[] = {
980 { .id = "PNP0300", .driver_data = 0 },
981 { .id = "PNP0301", .driver_data = 0 },
982 { .id = "PNP0302", .driver_data = 0 },
983 { .id = "PNP0303", .driver_data = 0 },
984 { .id = "PNP0304", .driver_data = 0 },
985 { .id = "PNP0305", .driver_data = 0 },
986 { .id = "PNP0306", .driver_data = 0 },
987 { .id = "PNP0309", .driver_data = 0 },
988 { .id = "PNP030a", .driver_data = 0 },
989 { .id = "PNP030b", .driver_data = 0 },
990 { .id = "PNP0320", .driver_data = 0 },
991 { .id = "PNP0343", .driver_data = 0 },
992 { .id = "PNP0344", .driver_data = 0 },
993 { .id = "PNP0345", .driver_data = 0 },
994 { .id = "CPQA0D7", .driver_data = 0 },
997 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
999 static struct pnp_driver i8042_pnp_kbd_driver = {
1000 .name = "i8042 kbd",
1001 .id_table = pnp_kbd_devids,
1002 .probe = i8042_pnp_kbd_probe,
1004 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1005 .suppress_bind_attrs = true,
1009 static const struct pnp_device_id pnp_aux_devids[] = {
1010 { .id = "AUI0200", .driver_data = 0 },
1011 { .id = "FJC6000", .driver_data = 0 },
1012 { .id = "FJC6001", .driver_data = 0 },
1013 { .id = "PNP0f03", .driver_data = 0 },
1014 { .id = "PNP0f0b", .driver_data = 0 },
1015 { .id = "PNP0f0e", .driver_data = 0 },
1016 { .id = "PNP0f12", .driver_data = 0 },
1017 { .id = "PNP0f13", .driver_data = 0 },
1018 { .id = "PNP0f19", .driver_data = 0 },
1019 { .id = "PNP0f1c", .driver_data = 0 },
1020 { .id = "SYN0801", .driver_data = 0 },
1023 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1025 static struct pnp_driver i8042_pnp_aux_driver = {
1026 .name = "i8042 aux",
1027 .id_table = pnp_aux_devids,
1028 .probe = i8042_pnp_aux_probe,
1030 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1031 .suppress_bind_attrs = true,
1035 static void i8042_pnp_exit(void)
1037 if (i8042_pnp_kbd_registered) {
1038 i8042_pnp_kbd_registered = false;
1039 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1042 if (i8042_pnp_aux_registered) {
1043 i8042_pnp_aux_registered = false;
1044 pnp_unregister_driver(&i8042_pnp_aux_driver);
1048 static int __init i8042_pnp_init(void)
1050 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1051 bool pnp_data_busted = false;
1055 if (dmi_check_system(i8042_dmi_nopnp_table))
1060 pr_info("PNP detection disabled\n");
1064 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1066 i8042_pnp_kbd_registered = true;
1068 err = pnp_register_driver(&i8042_pnp_aux_driver);
1070 i8042_pnp_aux_registered = true;
1072 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1074 #if defined(__ia64__)
1077 pr_info("PNP: No PS/2 controller found.\n");
1078 if (x86_platform.legacy.i8042 !=
1079 X86_LEGACY_I8042_EXPECTED_PRESENT)
1081 pr_info("Probing ports directly.\n");
1086 if (i8042_pnp_kbd_devices)
1087 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1088 "%d", i8042_pnp_kbd_irq);
1089 if (i8042_pnp_aux_devices)
1090 snprintf(aux_irq_str, sizeof(aux_irq_str),
1091 "%d", i8042_pnp_aux_irq);
1093 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1094 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1096 i8042_pnp_data_reg, i8042_pnp_command_reg,
1097 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1100 #if defined(__ia64__)
1101 if (!i8042_pnp_kbd_devices)
1103 if (!i8042_pnp_aux_devices)
1107 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1108 i8042_pnp_data_reg != i8042_data_reg) ||
1109 !i8042_pnp_data_reg) {
1110 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1111 i8042_pnp_data_reg, i8042_data_reg);
1112 i8042_pnp_data_reg = i8042_data_reg;
1113 pnp_data_busted = true;
1116 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1117 i8042_pnp_command_reg != i8042_command_reg) ||
1118 !i8042_pnp_command_reg) {
1119 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1120 i8042_pnp_command_reg, i8042_command_reg);
1121 i8042_pnp_command_reg = i8042_command_reg;
1122 pnp_data_busted = true;
1125 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1126 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1128 i8042_pnp_kbd_irq = i8042_kbd_irq;
1129 pnp_data_busted = true;
1132 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1133 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1134 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1135 "if this is incorrect please boot with i8042.nopnp\n");
1138 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1140 i8042_pnp_aux_irq = i8042_aux_irq;
1144 i8042_data_reg = i8042_pnp_data_reg;
1145 i8042_command_reg = i8042_pnp_command_reg;
1146 i8042_kbd_irq = i8042_pnp_kbd_irq;
1147 i8042_aux_irq = i8042_pnp_aux_irq;
1150 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1151 dmi_check_system(i8042_dmi_laptop_table);
1157 #else /* !CONFIG_PNP */
1158 static inline int i8042_pnp_init(void) { return 0; }
1159 static inline void i8042_pnp_exit(void) { }
1160 #endif /* CONFIG_PNP */
1162 static int __init i8042_platform_init(void)
1168 /* Just return if platform does not have i8042 controller */
1169 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1174 * On ix86 platforms touching the i8042 data register region can do really
1175 * bad things. Because of this the region is always reserved on ix86 boxes.
1177 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1181 i8042_kbd_irq = I8042_MAP_IRQ(1);
1182 i8042_aux_irq = I8042_MAP_IRQ(12);
1184 retval = i8042_pnp_init();
1188 #if defined(__ia64__)
1189 i8042_reset = I8042_RESET_ALWAYS;
1193 /* Honor module parameter when value is not default */
1194 if (i8042_reset == I8042_RESET_DEFAULT) {
1195 if (dmi_check_system(i8042_dmi_reset_table))
1196 i8042_reset = I8042_RESET_ALWAYS;
1198 if (dmi_check_system(i8042_dmi_noselftest_table))
1199 i8042_reset = I8042_RESET_NEVER;
1202 if (dmi_check_system(i8042_dmi_noloop_table))
1203 i8042_noloop = true;
1205 if (dmi_check_system(i8042_dmi_nomux_table))
1208 if (dmi_check_system(i8042_dmi_forcemux_table))
1209 i8042_nomux = false;
1211 if (dmi_check_system(i8042_dmi_notimeout_table))
1212 i8042_notimeout = true;
1214 if (dmi_check_system(i8042_dmi_dritek_table))
1215 i8042_dritek = true;
1217 if (dmi_check_system(i8042_dmi_kbdreset_table))
1218 i8042_kbdreset = true;
1221 * A20 was already enabled during early kernel init. But some buggy
1222 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1223 * resume from S3. So we do it here and hope that nothing breaks.
1225 i8042_command(&a20_on, 0x10d1);
1226 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1227 #endif /* CONFIG_X86 */
1232 static inline void i8042_platform_exit(void)
1237 #endif /* _I8042_X86IA64IO_H */