1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
11 #include <asm/x86_init.h>
18 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
19 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
20 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
27 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
29 # define I8042_MAP_IRQ(x) (x)
32 #define I8042_KBD_IRQ i8042_kbd_irq
33 #define I8042_AUX_IRQ i8042_aux_irq
35 static int i8042_kbd_irq;
36 static int i8042_aux_irq;
42 #define I8042_COMMAND_REG i8042_command_reg
43 #define I8042_STATUS_REG i8042_command_reg
44 #define I8042_DATA_REG i8042_data_reg
46 static int i8042_command_reg = 0x64;
47 static int i8042_data_reg = 0x60;
50 static inline int i8042_read_data(void)
52 return inb(I8042_DATA_REG);
55 static inline int i8042_read_status(void)
57 return inb(I8042_STATUS_REG);
60 static inline void i8042_write_data(int val)
62 outb(val, I8042_DATA_REG);
65 static inline void i8042_write_command(int val)
67 outb(val, I8042_COMMAND_REG);
72 #include <linux/dmi.h>
74 static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
77 * Arima-Rioworks HDAMB -
78 * AUX LOOP command does not raise AUX IRQ
81 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
82 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
83 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
89 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
90 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
91 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
95 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
97 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
98 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
99 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
104 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
105 DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
110 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
111 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
112 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
117 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
118 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
119 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
123 /* Dell Embedded Box PC 3000 */
125 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
126 DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
132 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
133 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
134 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
138 /* ULI EV4873 - AUX LOOP does not work properly */
140 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
141 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
142 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
146 /* Microsoft Virtual Machine */
148 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
149 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
150 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
154 /* Medion MAM 2070 */
156 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
157 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
158 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
162 /* Medion Akoya E7225 */
164 DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
165 DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
166 DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
172 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
173 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
174 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
180 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
181 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
182 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
186 /* Gigabyte M1022M netbook */
188 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
189 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
190 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
194 /* Gigabyte Spring Peak - defines wrong chassis type */
196 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
197 DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
201 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
203 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
204 DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
208 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
210 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
211 DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
216 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
217 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
218 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
223 DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
224 DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
229 DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
230 DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
237 * Some Fujitsu notebooks are having trouble with touchpads if
238 * active multiplexing mode is activated. Luckily they don't have
239 * external PS/2 ports so we can safely disable it.
240 * ... apparently some Toshibas don't like MUX mode either and
241 * die horrible death on reboot.
243 static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
245 /* Fujitsu Lifebook P7010/P7010D */
247 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
248 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
252 /* Fujitsu Lifebook P7010 */
254 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
255 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
259 /* Fujitsu Lifebook P5020D */
261 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
262 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
266 /* Fujitsu Lifebook S2000 */
268 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
269 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
273 /* Fujitsu Lifebook S6230 */
275 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
276 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
280 /* Fujitsu Lifebook T725 laptop */
282 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
283 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
287 /* Fujitsu Lifebook U745 */
289 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
290 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
296 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
297 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
301 /* Fujitsu-Siemens Lifebook T3010 */
303 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
304 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
308 /* Fujitsu-Siemens Lifebook E4010 */
310 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
311 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
315 /* Fujitsu-Siemens Amilo Pro 2010 */
317 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
318 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
322 /* Fujitsu-Siemens Amilo Pro 2030 */
324 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
325 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
330 * No data is coming from the touchscreen unless KBC
333 /* Panasonic CF-29 */
335 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
336 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
341 * HP Pavilion DV4017EA -
342 * errors on MUX ports are reported without raising AUXDATA
343 * causing "spurious NAK" messages.
346 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
347 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
352 * HP Pavilion ZT1000 -
353 * like DV4017EA does not raise AUXERR for errors on MUX ports.
356 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
357 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
358 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
363 * HP Pavilion DV4270ca -
364 * like DV4017EA does not raise AUXERR for errors on MUX ports.
367 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
368 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
373 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
374 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
379 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
380 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
385 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
386 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
391 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
392 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
396 /* Sharp Actius MM20 */
398 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
399 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
403 /* Sony Vaio FS-115b */
405 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
406 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
411 * Sony Vaio FZ-240E -
412 * reset and GET ID commands issued via KBD port are
413 * sometimes being delivered to AUX3.
416 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
417 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
422 * Most (all?) VAIOs do not have external PS/2 ports nor
423 * they implement active multiplexing properly, and
424 * MUX discovery usually messes up keyboard/touchpad.
427 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
428 DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
434 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
435 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
439 /* Lenovo 3000 n100 */
441 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
442 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
446 /* Lenovo XiaoXin Air 12 */
448 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
449 DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
454 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
455 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
459 /* Acer Aspire 5710 */
461 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
462 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
466 /* Acer Aspire 7738 */
468 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
469 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
473 /* Gericom Bellagio */
475 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
476 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
482 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
483 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
489 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
490 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
496 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
497 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
501 /* Dell Vostro 1510 */
503 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
504 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
508 /* Acer Aspire 5536 */
510 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
511 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
512 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
516 /* Dell Vostro V13 */
518 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
519 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
523 /* Newer HP Pavilion dv4 models */
525 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
526 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
532 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
533 DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
537 /* Avatar AVIU-145A6 */
539 DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
540 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
546 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
547 DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
553 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
554 DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
560 * Touchpad stops working in mux mode when dis- + re-enabled
561 * with the touchpad enable/disable toggle hotkey
564 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
565 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
569 /* Entroware Proteus */
571 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
572 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
573 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
579 static const struct dmi_system_id i8042_dmi_forcemux_table[] __initconst = {
582 * Sony Vaio VGN-CS series require MUX or the touch sensor
583 * buttons will disturb touchpad operation
586 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
587 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
594 * On some Asus laptops, just running self tests cause problems.
596 static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
599 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
600 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
604 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
605 DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
610 static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
614 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
615 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
619 /* LG Electronics X110 */
621 DMI_MATCH(DMI_BOARD_NAME, "X110"),
622 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
626 /* Acer Aspire One 150 */
628 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
629 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
634 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
635 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
640 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
641 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
646 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
647 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
652 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
653 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
658 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
659 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
664 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
665 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
670 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
671 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
677 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
678 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
682 /* Medion Akoya Mini E1210 */
684 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
685 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
689 /* Medion Akoya E1222 */
691 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
692 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
698 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
699 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
703 /* Dell Vostro 1320 */
705 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
706 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
710 /* Dell Vostro 1520 */
712 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
713 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
717 /* Dell Vostro 1720 */
719 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
720 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
724 /* Lenovo Ideapad U455 */
726 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
727 DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
731 /* Lenovo ThinkPad L460 */
733 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
734 DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
738 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
740 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
741 DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
745 /* Lenovo ThinkPad Twist S230u */
747 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
748 DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
752 /* Entroware Proteus */
754 DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
755 DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
756 DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
763 static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
765 /* Intel MBO Desktop D845PESV */
767 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
768 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
773 * Intel NUC D54250WYK - does not have i8042 controller but
774 * declares PS/2 devices in DSDT.
777 DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
778 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
784 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
785 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
789 /* Acer Aspire 5 A515 */
791 DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
792 DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
798 static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
801 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
806 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
811 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
816 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
823 static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
825 /* Dell Vostro V13 */
827 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
828 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
832 /* Newer HP Pavilion dv4 models */
834 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
835 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
839 /* Fujitsu A544 laptop */
840 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
842 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
843 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
847 /* Fujitsu AH544 laptop */
848 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
850 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
851 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
855 /* Fujitsu Lifebook T725 laptop */
857 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
858 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
862 /* Fujitsu U574 laptop */
863 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
865 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
866 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
870 /* Fujitsu UH554 laptop */
872 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
873 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
880 * Some Wistron based laptops need us to explicitly enable the 'Dritek
881 * keyboard extension' to make their extra keys start generating scancodes.
882 * Originally, this was just confined to older laptops, but a few Acer laptops
883 * have turned up in 2007 that also need this again.
885 static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
887 /* Acer Aspire 5100 */
889 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
890 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
894 /* Acer Aspire 5610 */
896 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
897 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
901 /* Acer Aspire 5630 */
903 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
904 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
908 /* Acer Aspire 5650 */
910 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
911 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
915 /* Acer Aspire 5680 */
917 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
918 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
922 /* Acer Aspire 5720 */
924 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
925 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
929 /* Acer Aspire 9110 */
931 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
932 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
936 /* Acer TravelMate 660 */
938 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
939 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
943 /* Acer TravelMate 2490 */
945 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
946 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
950 /* Acer TravelMate 4280 */
952 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
953 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
960 * Some laptops need keyboard reset before probing for the trackpad to get
961 * it detected, initialised & finally work.
963 static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
965 /* Gigabyte P35 v2 - Elantech touchpad */
967 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
968 DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
972 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
974 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
975 DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
979 /* Gigabyte P34 - Elantech touchpad */
981 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
982 DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
986 /* Gigabyte P57 - Elantech touchpad */
988 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
989 DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
993 /* Schenker XMG C504 - Elantech touchpad */
995 DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
996 DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1002 #endif /* CONFIG_X86 */
1005 #include <linux/pnp.h>
1007 static bool i8042_pnp_kbd_registered;
1008 static unsigned int i8042_pnp_kbd_devices;
1009 static bool i8042_pnp_aux_registered;
1010 static unsigned int i8042_pnp_aux_devices;
1012 static int i8042_pnp_command_reg;
1013 static int i8042_pnp_data_reg;
1014 static int i8042_pnp_kbd_irq;
1015 static int i8042_pnp_aux_irq;
1017 static char i8042_pnp_kbd_name[32];
1018 static char i8042_pnp_aux_name[32];
1020 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1022 strlcpy(dst, "PNP:", dst_size);
1025 strlcat(dst, " ", dst_size);
1026 strlcat(dst, id->id, dst_size);
1031 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1033 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1034 i8042_pnp_data_reg = pnp_port_start(dev,0);
1036 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1037 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1039 if (pnp_irq_valid(dev,0))
1040 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1042 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1043 if (strlen(pnp_dev_name(dev))) {
1044 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1045 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1047 i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1048 sizeof(i8042_kbd_firmware_id));
1050 /* Keyboard ports are always supposed to be wakeup-enabled */
1051 device_set_wakeup_enable(&dev->dev, true);
1053 i8042_pnp_kbd_devices++;
1057 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1059 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1060 i8042_pnp_data_reg = pnp_port_start(dev,0);
1062 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1063 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1065 if (pnp_irq_valid(dev, 0))
1066 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1068 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1069 if (strlen(pnp_dev_name(dev))) {
1070 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1071 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1073 i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1074 sizeof(i8042_aux_firmware_id));
1076 i8042_pnp_aux_devices++;
1080 static const struct pnp_device_id pnp_kbd_devids[] = {
1081 { .id = "PNP0300", .driver_data = 0 },
1082 { .id = "PNP0301", .driver_data = 0 },
1083 { .id = "PNP0302", .driver_data = 0 },
1084 { .id = "PNP0303", .driver_data = 0 },
1085 { .id = "PNP0304", .driver_data = 0 },
1086 { .id = "PNP0305", .driver_data = 0 },
1087 { .id = "PNP0306", .driver_data = 0 },
1088 { .id = "PNP0309", .driver_data = 0 },
1089 { .id = "PNP030a", .driver_data = 0 },
1090 { .id = "PNP030b", .driver_data = 0 },
1091 { .id = "PNP0320", .driver_data = 0 },
1092 { .id = "PNP0343", .driver_data = 0 },
1093 { .id = "PNP0344", .driver_data = 0 },
1094 { .id = "PNP0345", .driver_data = 0 },
1095 { .id = "CPQA0D7", .driver_data = 0 },
1098 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1100 static struct pnp_driver i8042_pnp_kbd_driver = {
1101 .name = "i8042 kbd",
1102 .id_table = pnp_kbd_devids,
1103 .probe = i8042_pnp_kbd_probe,
1105 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1106 .suppress_bind_attrs = true,
1110 static const struct pnp_device_id pnp_aux_devids[] = {
1111 { .id = "AUI0200", .driver_data = 0 },
1112 { .id = "FJC6000", .driver_data = 0 },
1113 { .id = "FJC6001", .driver_data = 0 },
1114 { .id = "PNP0f03", .driver_data = 0 },
1115 { .id = "PNP0f0b", .driver_data = 0 },
1116 { .id = "PNP0f0e", .driver_data = 0 },
1117 { .id = "PNP0f12", .driver_data = 0 },
1118 { .id = "PNP0f13", .driver_data = 0 },
1119 { .id = "PNP0f19", .driver_data = 0 },
1120 { .id = "PNP0f1c", .driver_data = 0 },
1121 { .id = "SYN0801", .driver_data = 0 },
1124 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1126 static struct pnp_driver i8042_pnp_aux_driver = {
1127 .name = "i8042 aux",
1128 .id_table = pnp_aux_devids,
1129 .probe = i8042_pnp_aux_probe,
1131 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1132 .suppress_bind_attrs = true,
1136 static void i8042_pnp_exit(void)
1138 if (i8042_pnp_kbd_registered) {
1139 i8042_pnp_kbd_registered = false;
1140 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1143 if (i8042_pnp_aux_registered) {
1144 i8042_pnp_aux_registered = false;
1145 pnp_unregister_driver(&i8042_pnp_aux_driver);
1149 static int __init i8042_pnp_init(void)
1151 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1152 bool pnp_data_busted = false;
1156 if (dmi_check_system(i8042_dmi_nopnp_table))
1161 pr_info("PNP detection disabled\n");
1165 err = pnp_register_driver(&i8042_pnp_kbd_driver);
1167 i8042_pnp_kbd_registered = true;
1169 err = pnp_register_driver(&i8042_pnp_aux_driver);
1171 i8042_pnp_aux_registered = true;
1173 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1175 #if defined(__ia64__)
1178 pr_info("PNP: No PS/2 controller found.\n");
1179 if (x86_platform.legacy.i8042 !=
1180 X86_LEGACY_I8042_EXPECTED_PRESENT)
1182 pr_info("Probing ports directly.\n");
1187 if (i8042_pnp_kbd_devices)
1188 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1189 "%d", i8042_pnp_kbd_irq);
1190 if (i8042_pnp_aux_devices)
1191 snprintf(aux_irq_str, sizeof(aux_irq_str),
1192 "%d", i8042_pnp_aux_irq);
1194 pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1195 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1197 i8042_pnp_data_reg, i8042_pnp_command_reg,
1198 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1201 #if defined(__ia64__)
1202 if (!i8042_pnp_kbd_devices)
1204 if (!i8042_pnp_aux_devices)
1208 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1209 i8042_pnp_data_reg != i8042_data_reg) ||
1210 !i8042_pnp_data_reg) {
1211 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1212 i8042_pnp_data_reg, i8042_data_reg);
1213 i8042_pnp_data_reg = i8042_data_reg;
1214 pnp_data_busted = true;
1217 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1218 i8042_pnp_command_reg != i8042_command_reg) ||
1219 !i8042_pnp_command_reg) {
1220 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1221 i8042_pnp_command_reg, i8042_command_reg);
1222 i8042_pnp_command_reg = i8042_command_reg;
1223 pnp_data_busted = true;
1226 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1227 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1229 i8042_pnp_kbd_irq = i8042_kbd_irq;
1230 pnp_data_busted = true;
1233 if (!i8042_noaux && !i8042_pnp_aux_irq) {
1234 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1235 pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1236 "if this is incorrect please boot with i8042.nopnp\n");
1239 pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1241 i8042_pnp_aux_irq = i8042_aux_irq;
1245 i8042_data_reg = i8042_pnp_data_reg;
1246 i8042_command_reg = i8042_pnp_command_reg;
1247 i8042_kbd_irq = i8042_pnp_kbd_irq;
1248 i8042_aux_irq = i8042_pnp_aux_irq;
1251 i8042_bypass_aux_irq_test = !pnp_data_busted &&
1252 dmi_check_system(i8042_dmi_laptop_table);
1258 #else /* !CONFIG_PNP */
1259 static inline int i8042_pnp_init(void) { return 0; }
1260 static inline void i8042_pnp_exit(void) { }
1261 #endif /* CONFIG_PNP */
1263 static int __init i8042_platform_init(void)
1269 /* Just return if platform does not have i8042 controller */
1270 if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1275 * On ix86 platforms touching the i8042 data register region can do really
1276 * bad things. Because of this the region is always reserved on ix86 boxes.
1278 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
1282 i8042_kbd_irq = I8042_MAP_IRQ(1);
1283 i8042_aux_irq = I8042_MAP_IRQ(12);
1285 retval = i8042_pnp_init();
1289 #if defined(__ia64__)
1290 i8042_reset = I8042_RESET_ALWAYS;
1294 /* Honor module parameter when value is not default */
1295 if (i8042_reset == I8042_RESET_DEFAULT) {
1296 if (dmi_check_system(i8042_dmi_reset_table))
1297 i8042_reset = I8042_RESET_ALWAYS;
1299 if (dmi_check_system(i8042_dmi_noselftest_table))
1300 i8042_reset = I8042_RESET_NEVER;
1303 if (dmi_check_system(i8042_dmi_noloop_table))
1304 i8042_noloop = true;
1306 if (dmi_check_system(i8042_dmi_nomux_table))
1309 if (dmi_check_system(i8042_dmi_forcemux_table))
1310 i8042_nomux = false;
1312 if (dmi_check_system(i8042_dmi_notimeout_table))
1313 i8042_notimeout = true;
1315 if (dmi_check_system(i8042_dmi_dritek_table))
1316 i8042_dritek = true;
1318 if (dmi_check_system(i8042_dmi_kbdreset_table))
1319 i8042_kbdreset = true;
1322 * A20 was already enabled during early kernel init. But some buggy
1323 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1324 * resume from S3. So we do it here and hope that nothing breaks.
1326 i8042_command(&a20_on, 0x10d1);
1327 i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
1328 #endif /* CONFIG_X86 */
1333 static inline void i8042_platform_exit(void)
1338 #endif /* _I8042_X86IA64IO_H */