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"),
225 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
226 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
233 * Some Fujitsu notebooks are having trouble with touchpads if
234 * active multiplexing mode is activated. Luckily they don't have
235 * external PS/2 ports so we can safely disable it.
236 * ... apparently some Toshibas don't like MUX mode either and
237 * die horrible death on reboot.
239 static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
241 /* Fujitsu Lifebook P7010/P7010D */
243 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
244 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
248 /* Fujitsu Lifebook P7010 */
250 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
251 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
255 /* Fujitsu Lifebook P5020D */
257 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
258 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
262 /* Fujitsu Lifebook S2000 */
264 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
265 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
269 /* Fujitsu Lifebook S6230 */
271 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
272 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
276 /* Fujitsu Lifebook T725 laptop */
278 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
279 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
283 /* Fujitsu Lifebook U745 */
285 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
286 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
292 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
293 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
297 /* Fujitsu-Siemens Lifebook T3010 */
299 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
300 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
304 /* Fujitsu-Siemens Lifebook E4010 */
306 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
307 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
311 /* Fujitsu-Siemens Amilo Pro 2010 */
313 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
314 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
318 /* Fujitsu-Siemens Amilo Pro 2030 */
320 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
321 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
326 * No data is coming from the touchscreen unless KBC
329 /* Panasonic CF-29 */
331 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
332 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
337 * HP Pavilion DV4017EA -
338 * errors on MUX ports are reported without raising AUXDATA
339 * causing "spurious NAK" messages.
342 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
343 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
348 * HP Pavilion ZT1000 -
349 * like DV4017EA does not raise AUXERR for errors on MUX ports.
352 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
353 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
354 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
359 * HP Pavilion DV4270ca -
360 * like DV4017EA does not raise AUXERR for errors on MUX ports.
363 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
364 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
369 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
370 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
375 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
376 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
381 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
382 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
387 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
388 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
392 /* Sharp Actius MM20 */
394 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
395 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
399 /* Sony Vaio FS-115b */
401 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
402 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
407 * Sony Vaio FZ-240E -
408 * reset and GET ID commands issued via KBD port are
409 * sometimes being delivered to AUX3.
412 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
413 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
418 * Most (all?) VAIOs do not have external PS/2 ports nor
419 * they implement active multiplexing properly, and
420 * MUX discovery usually messes up keyboard/touchpad.
423 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
424 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
430 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
431 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
435 /* Lenovo 3000 n100 */
437 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
438 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
442 /* Lenovo XiaoXin Air 12 */
444 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
445 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
450 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
451 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
455 /* Acer Aspire 5710 */
457 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
458 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
462 /* Acer Aspire 7738 */
464 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
465 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
469 /* Gericom Bellagio */
471 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
472 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
478 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
479 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
485 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
486 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
492 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
493 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
497 /* Dell Vostro 1510 */
499 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
500 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
504 /* Acer Aspire 5536 */
506 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
507 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
508 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
512 /* Dell Vostro V13 */
514 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
515 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
519 /* Newer HP Pavilion dv4 models */
521 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
522 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
528 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
529 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
533 /* Avatar AVIU-145A6 */
535 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
536 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
542 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
543 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
549 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
550 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
556 * Touchpad stops working in mux mode when dis- + re-enabled
557 * with the touchpad enable/disable toggle hotkey
560 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
561 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
565 /* Entroware Proteus */
567 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
568 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
569 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
575 static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
578 * Sony Vaio VGN-CS series require MUX or the touch sensor
579 * buttons will disturb touchpad operation
582 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
583 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
590 * On some Asus laptops, just running self tests cause problems.
592 static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
595 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
596 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
600 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
601 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
606 static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
610 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
611 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
615 /* LG Electronics X110 */
617 DMI_MATCH(DMI_BOARD_NAME, "X110"),
618 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
622 /* Acer Aspire One 150 */
624 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
625 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
630 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
631 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
636 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
637 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
642 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
643 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
648 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
649 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
654 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
655 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
660 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
661 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
666 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
667 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
673 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
674 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
678 /* Medion Akoya Mini E1210 */
680 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
681 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
685 /* Medion Akoya E1222 */
687 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
688 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
694 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
695 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
699 /* Dell Vostro 1320 */
701 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
702 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
706 /* Dell Vostro 1520 */
708 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
709 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
713 /* Dell Vostro 1720 */
715 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
716 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
720 /* Lenovo Ideapad U455 */
722 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
723 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
727 /* Lenovo ThinkPad L460 */
729 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
730 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
734 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
736 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
737 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
741 /* Lenovo ThinkPad Twist S230u */
743 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
744 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
748 /* Entroware Proteus */
750 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
751 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
752 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
759 static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
761 /* Intel MBO Desktop D845PESV */
763 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
764 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
769 * Intel NUC D54250WYK - does not have i8042 controller but
770 * declares PS/2 devices in DSDT.
773 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
774 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
780 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
781 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
785 /* Acer Aspire 5 A515 */
787 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
788 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
794 static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
797 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
802 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
807 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
812 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
819 static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
821 /* Dell Vostro V13 */
823 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
824 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
828 /* Newer HP Pavilion dv4 models */
830 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
831 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
835 /* Fujitsu A544 laptop */
836 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
838 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
839 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
843 /* Fujitsu AH544 laptop */
844 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
846 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
847 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
851 /* Fujitsu Lifebook T725 laptop */
853 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
854 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
858 /* Fujitsu U574 laptop */
859 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
861 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
862 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
866 /* Fujitsu UH554 laptop */
868 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
869 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
876 * Some Wistron based laptops need us to explicitly enable the 'Dritek
877 * keyboard extension' to make their extra keys start generating scancodes.
878 * Originally, this was just confined to older laptops, but a few Acer laptops
879 * have turned up in 2007 that also need this again.
881 static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
883 /* Acer Aspire 5100 */
885 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
886 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
890 /* Acer Aspire 5610 */
892 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
893 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
897 /* Acer Aspire 5630 */
899 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
900 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
904 /* Acer Aspire 5650 */
906 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
907 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
911 /* Acer Aspire 5680 */
913 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
914 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
918 /* Acer Aspire 5720 */
920 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
921 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
925 /* Acer Aspire 9110 */
927 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
928 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
932 /* Acer TravelMate 660 */
934 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
935 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
939 /* Acer TravelMate 2490 */
941 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
942 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
946 /* Acer TravelMate 4280 */
948 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
949 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
956 * Some laptops need keyboard reset before probing for the trackpad to get
957 * it detected, initialised & finally work.
959 static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
961 /* Gigabyte P35 v2 - Elantech touchpad */
963 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
964 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
968 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
970 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
971 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
975 /* Gigabyte P34 - Elantech touchpad */
977 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
978 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
982 /* Gigabyte P57 - Elantech touchpad */
984 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
985 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
989 /* Schenker XMG C504 - Elantech touchpad */
991 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
992 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
998 static const struct dmi_system_id i8042_dmi_probe_defer_table[] __initconst = {
1000 /* ASUS ZenBook UX425UA */
1002 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1003 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"),
1007 /* ASUS ZenBook UM325UA */
1009 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
1010 DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"),
1016 #endif /* CONFIG_X86 */
1019 #include <linux/pnp.h>
1021 static bool i8042_pnp_kbd_registered;
1022 static unsigned int i8042_pnp_kbd_devices;
1023 static bool i8042_pnp_aux_registered;
1024 static unsigned int i8042_pnp_aux_devices;
1026 static int i8042_pnp_command_reg;
1027 static int i8042_pnp_data_reg;
1028 static int i8042_pnp_kbd_irq;
1029 static int i8042_pnp_aux_irq;
1031 static char i8042_pnp_kbd_name[32];
1032 static char i8042_pnp_aux_name[32];
1034 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1036 strlcpy(dst, "PNP:", dst_size);
1039 strlcat(dst, " ", dst_size);
1040 strlcat(dst, id->id, dst_size);
1045 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1047 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1048 i8042_pnp_data_reg = pnp_port_start(dev,0);
1050 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1051 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1053 if (pnp_irq_valid(dev,0))
1054 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1056 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1057 if (strlen(pnp_dev_name(dev))) {
1058 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1059 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1061 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1062 sizeof(i8042_kbd_firmware_id));
1064 /* Keyboard ports are always supposed to be wakeup-enabled */
1065 device_set_wakeup_enable(&dev->dev, true);
1067 i8042_pnp_kbd_devices++;
1071 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1073 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1074 i8042_pnp_data_reg = pnp_port_start(dev,0);
1076 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1077 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1079 if (pnp_irq_valid(dev, 0))
1080 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1082 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1083 if (strlen(pnp_dev_name(dev))) {
1084 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1085 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1087 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1088 sizeof(i8042_aux_firmware_id));
1090 i8042_pnp_aux_devices++;
1094 static const struct pnp_device_id pnp_kbd_devids[] = {
1095 { .id = "PNP0300", .driver_data = 0 },
1096 { .id = "PNP0301", .driver_data = 0 },
1097 { .id = "PNP0302", .driver_data = 0 },
1098 { .id = "PNP0303", .driver_data = 0 },
1099 { .id = "PNP0304", .driver_data = 0 },
1100 { .id = "PNP0305", .driver_data = 0 },
1101 { .id = "PNP0306", .driver_data = 0 },
1102 { .id = "PNP0309", .driver_data = 0 },
1103 { .id = "PNP030a", .driver_data = 0 },
1104 { .id = "PNP030b", .driver_data = 0 },
1105 { .id = "PNP0320", .driver_data = 0 },
1106 { .id = "PNP0343", .driver_data = 0 },
1107 { .id = "PNP0344", .driver_data = 0 },
1108 { .id = "PNP0345", .driver_data = 0 },
1109 { .id = "CPQA0D7", .driver_data = 0 },
1112 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1114 static struct pnp_driver i8042_pnp_kbd_driver = {
1115 .name = "i8042 kbd",
1116 .id_table = pnp_kbd_devids,
1117 .probe = i8042_pnp_kbd_probe,
1119 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1120 .suppress_bind_attrs = true,
1124 static const struct pnp_device_id pnp_aux_devids[] = {
1125 { .id = "AUI0200", .driver_data = 0 },
1126 { .id = "FJC6000", .driver_data = 0 },
1127 { .id = "FJC6001", .driver_data = 0 },
1128 { .id = "PNP0f03", .driver_data = 0 },
1129 { .id = "PNP0f0b", .driver_data = 0 },
1130 { .id = "PNP0f0e", .driver_data = 0 },
1131 { .id = "PNP0f12", .driver_data = 0 },
1132 { .id = "PNP0f13", .driver_data = 0 },
1133 { .id = "PNP0f19", .driver_data = 0 },
1134 { .id = "PNP0f1c", .driver_data = 0 },
1135 { .id = "SYN0801", .driver_data = 0 },
1138 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1140 static struct pnp_driver i8042_pnp_aux_driver = {
1141 .name = "i8042 aux",
1142 .id_table = pnp_aux_devids,
1143 .probe = i8042_pnp_aux_probe,
1145 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1146 .suppress_bind_attrs = true,
1150 static void i8042_pnp_exit(void)
1152 if (i8042_pnp_kbd_registered) {
1153 i8042_pnp_kbd_registered = false;
1154 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1157 if (i8042_pnp_aux_registered) {
1158 i8042_pnp_aux_registered = false;
1159 pnp_unregister_driver(&i8042_pnp_aux_driver);
1163 static int __init i8042_pnp_init(void)
1165 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1166 bool pnp_data_busted = false;
1170 if (dmi_check_system(i8042_dmi_nopnp_table))
1175 pr_info("PNP detection disabled\n");
1179 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1181 i8042_pnp_kbd_registered = true;
1183 err = pnp_register_driver(&i8042_pnp_aux_driver);
1185 i8042_pnp_aux_registered = true;
1187 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1189 #if defined(__ia64__)
1192 pr_info("PNP: No PS/2 controller found.\n");
1193 if (x86_platform.legacy.i8042 !=
1194 X86_LEGACY_I8042_EXPECTED_PRESENT)
1196 pr_info("Probing ports directly.\n");
1201 if (i8042_pnp_kbd_devices)
1202 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1203 "%d", i8042_pnp_kbd_irq);
1204 if (i8042_pnp_aux_devices)
1205 snprintf(aux_irq_str, sizeof(aux_irq_str),
1206 "%d", i8042_pnp_aux_irq);
1208 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1209 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1211 i8042_pnp_data_reg, i8042_pnp_command_reg,
1212 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1215 #if defined(__ia64__)
1216 if (!i8042_pnp_kbd_devices)
1218 if (!i8042_pnp_aux_devices)
1222 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1223 i8042_pnp_data_reg != i8042_data_reg) ||
1224 !i8042_pnp_data_reg) {
1225 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1226 i8042_pnp_data_reg, i8042_data_reg);
1227 i8042_pnp_data_reg = i8042_data_reg;
1228 pnp_data_busted = true;
1231 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1232 i8042_pnp_command_reg != i8042_command_reg) ||
1233 !i8042_pnp_command_reg) {
1234 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1235 i8042_pnp_command_reg, i8042_command_reg);
1236 i8042_pnp_command_reg = i8042_command_reg;
1237 pnp_data_busted = true;
1240 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1241 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1243 i8042_pnp_kbd_irq = i8042_kbd_irq;
1244 pnp_data_busted = true;
1247 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1248 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1249 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1250 "if this is incorrect please boot with i8042.nopnp\n");
1253 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1255 i8042_pnp_aux_irq = i8042_aux_irq;
1259 i8042_data_reg = i8042_pnp_data_reg;
1260 i8042_command_reg = i8042_pnp_command_reg;
1261 i8042_kbd_irq = i8042_pnp_kbd_irq;
1262 i8042_aux_irq = i8042_pnp_aux_irq;
1265 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1266 dmi_check_system(i8042_dmi_laptop_table);
1272 #else /* !CONFIG_PNP */
1273 static inline int i8042_pnp_init(void) { return 0; }
1274 static inline void i8042_pnp_exit(void) { }
1275 #endif /* CONFIG_PNP */
1277 static int __init i8042_platform_init(void)
1283 /* Just return if platform does not have i8042 controller */
1284 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1289 * On ix86 platforms touching the i8042 data register region can do really
1290 * bad things. Because of this the region is always reserved on ix86 boxes.
1292 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1296 i8042_kbd_irq = I8042_MAP_IRQ(1);
1297 i8042_aux_irq = I8042_MAP_IRQ(12);
1299 retval = i8042_pnp_init();
1303 #if defined(__ia64__)
1304 i8042_reset = I8042_RESET_ALWAYS;
1308 /* Honor module parameter when value is not default */
1309 if (i8042_reset == I8042_RESET_DEFAULT) {
1310 if (dmi_check_system(i8042_dmi_reset_table))
1311 i8042_reset = I8042_RESET_ALWAYS;
1313 if (dmi_check_system(i8042_dmi_noselftest_table))
1314 i8042_reset = I8042_RESET_NEVER;
1317 if (dmi_check_system(i8042_dmi_noloop_table))
1318 i8042_noloop = true;
1320 if (dmi_check_system(i8042_dmi_nomux_table))
1323 if (dmi_check_system(i8042_dmi_forcemux_table))
1324 i8042_nomux = false;
1326 if (dmi_check_system(i8042_dmi_notimeout_table))
1327 i8042_notimeout = true;
1329 if (dmi_check_system(i8042_dmi_dritek_table))
1330 i8042_dritek = true;
1332 if (dmi_check_system(i8042_dmi_kbdreset_table))
1333 i8042_kbdreset = true;
1335 if (dmi_check_system(i8042_dmi_probe_defer_table))
1336 i8042_probe_defer = true;
1339 * A20 was already enabled during early kernel init. But some buggy
1340 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1341 * resume from S3. So we do it here and hope that nothing breaks.
1343 i8042_command(&a20_on, 0x10d1);
1344 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1345 #endif /* CONFIG_X86 */
1350 static inline void i8042_platform_exit(void)
1355 #endif /* _I8042_X86IA64IO_H */