GNU Linux-libre 4.19.286-gnu1
[releases.git] / drivers / input / serio / i8042-x86ia64io.h
1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
3
4 /*
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.
8  */
9
10 #ifdef CONFIG_X86
11 #include <asm/x86_init.h>
12 #endif
13
14 /*
15  * Names.
16  */
17
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"
21
22 /*
23  * IRQs.
24  */
25
26 #if defined(__ia64__)
27 # define I8042_MAP_IRQ(x)       isa_irq_to_vector((x))
28 #else
29 # define I8042_MAP_IRQ(x)       (x)
30 #endif
31
32 #define I8042_KBD_IRQ   i8042_kbd_irq
33 #define I8042_AUX_IRQ   i8042_aux_irq
34
35 static int i8042_kbd_irq;
36 static int i8042_aux_irq;
37
38 /*
39  * Register numbers.
40  */
41
42 #define I8042_COMMAND_REG       i8042_command_reg
43 #define I8042_STATUS_REG        i8042_command_reg
44 #define I8042_DATA_REG          i8042_data_reg
45
46 static int i8042_command_reg = 0x64;
47 static int i8042_data_reg = 0x60;
48
49
50 static inline int i8042_read_data(void)
51 {
52         return inb(I8042_DATA_REG);
53 }
54
55 static inline int i8042_read_status(void)
56 {
57         return inb(I8042_STATUS_REG);
58 }
59
60 static inline void i8042_write_data(int val)
61 {
62         outb(val, I8042_DATA_REG);
63 }
64
65 static inline void i8042_write_command(int val)
66 {
67         outb(val, I8042_COMMAND_REG);
68 }
69
70 #ifdef CONFIG_X86
71
72 #include <linux/dmi.h>
73
74 #define SERIO_QUIRK_NOKBD               BIT(0)
75 #define SERIO_QUIRK_NOAUX               BIT(1)
76 #define SERIO_QUIRK_NOMUX               BIT(2)
77 #define SERIO_QUIRK_FORCEMUX            BIT(3)
78 #define SERIO_QUIRK_UNLOCK              BIT(4)
79 #define SERIO_QUIRK_PROBE_DEFER         BIT(5)
80 #define SERIO_QUIRK_RESET_ALWAYS        BIT(6)
81 #define SERIO_QUIRK_RESET_NEVER         BIT(7)
82 #define SERIO_QUIRK_DIECT               BIT(8)
83 #define SERIO_QUIRK_DUMBKBD             BIT(9)
84 #define SERIO_QUIRK_NOLOOP              BIT(10)
85 #define SERIO_QUIRK_NOTIMEOUT           BIT(11)
86 #define SERIO_QUIRK_KBDRESET            BIT(12)
87 #define SERIO_QUIRK_DRITEK              BIT(13)
88 #define SERIO_QUIRK_NOPNP               BIT(14)
89
90 /* Quirk table for different mainboards. Options similar or identical to i8042
91  * module parameters.
92  * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored.
93  * This allows entries to overwrite vendor wide quirks on a per device basis.
94  * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR
95  * and/or DMI_BOARD_VENDOR to make it easier to avoid dublicate entries.
96  */
97 static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
98         {
99                 .matches = {
100                         DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
101                         DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
102                 },
103                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
104         },
105         {
106                 .matches = {
107                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
108                         DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
109                 },
110                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
111         },
112         {
113                 /* Asus X450LCP */
114                 .matches = {
115                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
116                         DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
117                 },
118                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
119         },
120         {
121                 /* ASUS ZenBook UX425UA */
122                 .matches = {
123                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
124                         DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425UA"),
125                 },
126                 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
127         },
128         {
129                 /* ASUS ZenBook UM325UA */
130                 .matches = {
131                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
132                         DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325UA_UM325UA"),
133                 },
134                 .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
135         },
136         /*
137          * On some Asus laptops, just running self tests cause problems.
138          */
139         {
140                 .matches = {
141                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
142                         DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
143                 },
144                 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
145         },
146         {
147                 .matches = {
148                         DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
149                         DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
150                 },
151                 .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
152         },
153         {
154                 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
155                 .matches = {
156                         DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
157                         DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
158                         DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
159                 },
160                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
161         },
162         {
163                 /* ASUS G1S */
164                 .matches = {
165                         DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
166                         DMI_MATCH(DMI_BOARD_NAME, "G1S"),
167                         DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
168                 },
169                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
170         },
171         {
172                 .matches = {
173                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
174                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
175                 },
176                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
177         },
178         {
179                 /* Acer Aspire 5710 */
180                 .matches = {
181                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
182                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
183                 },
184                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
185         },
186         {
187                 /* Acer Aspire 7738 */
188                 .matches = {
189                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
190                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
191                 },
192                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
193         },
194         {
195                 /* Acer Aspire 5536 */
196                 .matches = {
197                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
198                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
199                         DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
200                 },
201                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
202         },
203         {
204                 /*
205                  * Acer Aspire 5738z
206                  * Touchpad stops working in mux mode when dis- + re-enabled
207                  * with the touchpad enable/disable toggle hotkey
208                  */
209                 .matches = {
210                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
211                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
212                 },
213                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
214         },
215         {
216                 /* Acer Aspire One 150 */
217                 .matches = {
218                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
219                         DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
220                 },
221                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
222         },
223         {
224                 .matches = {
225                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
226                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
227                 },
228                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
229         },
230         {
231                 .matches = {
232                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
233                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
234                 },
235                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
236         },
237         {
238                 .matches = {
239                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
240                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
241                 },
242                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
243         },
244         {
245                 .matches = {
246                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
247                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
248                 },
249                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
250         },
251         {
252                 .matches = {
253                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
254                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
255                 },
256                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
257         },
258         {
259                 .matches = {
260                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
261                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
262                 },
263                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
264         },
265         {
266                 .matches = {
267                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
268                         DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
269                 },
270                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
271         },
272         /*
273          * Some Wistron based laptops need us to explicitly enable the 'Dritek
274          * keyboard extension' to make their extra keys start generating scancodes.
275          * Originally, this was just confined to older laptops, but a few Acer laptops
276          * have turned up in 2007 that also need this again.
277          */
278         {
279                 /* Acer Aspire 5100 */
280                 .matches = {
281                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
282                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
283                 },
284                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
285         },
286         {
287                 /* Acer Aspire 5610 */
288                 .matches = {
289                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
290                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
291                 },
292                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
293         },
294         {
295                 /* Acer Aspire 5630 */
296                 .matches = {
297                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
298                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
299                 },
300                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
301         },
302         {
303                 /* Acer Aspire 5650 */
304                 .matches = {
305                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
306                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
307                 },
308                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
309         },
310         {
311                 /* Acer Aspire 5680 */
312                 .matches = {
313                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
314                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
315                 },
316                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
317         },
318         {
319                 /* Acer Aspire 5720 */
320                 .matches = {
321                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
322                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
323                 },
324                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
325         },
326         {
327                 /* Acer Aspire 9110 */
328                 .matches = {
329                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
330                         DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
331                 },
332                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
333         },
334         {
335                 /* Acer TravelMate 660 */
336                 .matches = {
337                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
338                         DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
339                 },
340                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
341         },
342         {
343                 /* Acer TravelMate 2490 */
344                 .matches = {
345                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
346                         DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
347                 },
348                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
349         },
350         {
351                 /* Acer TravelMate 4280 */
352                 .matches = {
353                         DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
354                         DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
355                 },
356                 .driver_data = (void *)(SERIO_QUIRK_DRITEK)
357         },
358         {
359                 /* Amoi M636/A737 */
360                 .matches = {
361                         DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
362                         DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
363                 },
364                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
365         },
366         {
367                 .matches = {
368                         DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
369                         DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
370                 },
371                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
372         },
373         {
374                 /* Compal HEL80I */
375                 .matches = {
376                         DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
377                         DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
378                 },
379                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
380         },
381         {
382                 .matches = {
383                         DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
384                         DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
385                         DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
386                 },
387                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
388         },
389         {
390                 .matches = {
391                         DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
392                         DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
393                         DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
394                 },
395                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
396         },
397         {
398                 /* Advent 4211 */
399                 .matches = {
400                         DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
401                         DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
402                 },
403                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
404         },
405         {
406                 /* Dell Embedded Box PC 3000 */
407                 .matches = {
408                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
409                         DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
410                 },
411                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
412         },
413         {
414                 /* Dell XPS M1530 */
415                 .matches = {
416                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
417                         DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
418                 },
419                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
420         },
421         {
422                 /* Dell Vostro 1510 */
423                 .matches = {
424                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
425                         DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
426                 },
427                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
428         },
429         {
430                 /* Dell Vostro V13 */
431                 .matches = {
432                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
433                         DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
434                 },
435                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
436         },
437         {
438                 /* Dell Vostro 1320 */
439                 .matches = {
440                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
441                         DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
442                 },
443                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
444         },
445         {
446                 /* Dell Vostro 1520 */
447                 .matches = {
448                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
449                         DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
450                 },
451                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
452         },
453         {
454                 /* Dell Vostro 1720 */
455                 .matches = {
456                         DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
457                         DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
458                 },
459                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
460         },
461         {
462                 /* Entroware Proteus */
463                 .matches = {
464                         DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
465                         DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
466                         DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
467                 },
468                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
469         },
470         /*
471          * Some Fujitsu notebooks are having trouble with touchpads if
472          * active multiplexing mode is activated. Luckily they don't have
473          * external PS/2 ports so we can safely disable it.
474          * ... apparently some Toshibas don't like MUX mode either and
475          * die horrible death on reboot.
476          */
477         {
478                 /* Fujitsu Lifebook P7010/P7010D */
479                 .matches = {
480                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
481                         DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
482                 },
483                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
484         },
485         {
486                 /* Fujitsu Lifebook P5020D */
487                 .matches = {
488                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
489                         DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
490                 },
491                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
492         },
493         {
494                 /* Fujitsu Lifebook S2000 */
495                 .matches = {
496                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
497                         DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
498                 },
499                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
500         },
501         {
502                 /* Fujitsu Lifebook S6230 */
503                 .matches = {
504                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
505                         DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
506                 },
507                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
508         },
509         {
510                 /* Fujitsu Lifebook T725 laptop */
511                 .matches = {
512                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
513                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
514                 },
515                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
516         },
517         {
518                 /* Fujitsu Lifebook U745 */
519                 .matches = {
520                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
521                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
522                 },
523                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
524         },
525         {
526                 /* Fujitsu T70H */
527                 .matches = {
528                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
529                         DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
530                 },
531                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
532         },
533         {
534                 /* Fujitsu A544 laptop */
535                 /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
536                 .matches = {
537                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
538                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
539                 },
540                 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
541         },
542         {
543                 /* Fujitsu AH544 laptop */
544                 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
545                 .matches = {
546                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
547                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
548                 },
549                 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
550         },
551         {
552                 /* Fujitsu U574 laptop */
553                 /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
554                 .matches = {
555                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
556                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
557                 },
558                 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
559         },
560         {
561                 /* Fujitsu UH554 laptop */
562                 .matches = {
563                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
564                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
565                 },
566                 .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
567         },
568         {
569                 /* Fujitsu Lifebook P7010 */
570                 .matches = {
571                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
572                         DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
573                 },
574                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
575         },
576         {
577                 /* Fujitsu-Siemens Lifebook T3010 */
578                 .matches = {
579                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
580                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
581                 },
582                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
583         },
584         {
585                 /* Fujitsu-Siemens Lifebook E4010 */
586                 .matches = {
587                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
588                         DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
589                 },
590                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
591         },
592         {
593                 /* Fujitsu-Siemens Amilo Pro 2010 */
594                 .matches = {
595                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
596                         DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
597                 },
598                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
599         },
600         {
601                 /* Fujitsu-Siemens Amilo Pro 2030 */
602                 .matches = {
603                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
604                         DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
605                 },
606                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
607         },
608         {
609                 /* Fujitsu Lifebook A574/H */
610                 .matches = {
611                         DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
612                         DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
613                 },
614                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
615         },
616         {
617                 /* Gigabyte M912 */
618                 .matches = {
619                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
620                         DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
621                         DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
622                 },
623                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
624         },
625         {
626                 /* Gigabyte Spring Peak - defines wrong chassis type */
627                 .matches = {
628                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
629                         DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
630                 },
631                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
632         },
633         {
634                 /* Gigabyte T1005 - defines wrong chassis type ("Other") */
635                 .matches = {
636                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
637                         DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
638                 },
639                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
640         },
641         {
642                 /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
643                 .matches = {
644                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
645                         DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
646                 },
647                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
648         },
649         /*
650          * Some laptops need keyboard reset before probing for the trackpad to get
651          * it detected, initialised & finally work.
652          */
653         {
654                 /* Gigabyte P35 v2 - Elantech touchpad */
655                 .matches = {
656                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
657                         DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
658                 },
659                 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
660         },
661                 {
662                 /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
663                 .matches = {
664                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
665                         DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
666                 },
667                 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
668         },
669         {
670                 /* Gigabyte P34 - Elantech touchpad */
671                 .matches = {
672                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
673                         DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
674                 },
675                 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
676         },
677         {
678                 /* Gigabyte P57 - Elantech touchpad */
679                 .matches = {
680                         DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
681                         DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
682                 },
683                 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
684         },
685         {
686                 /* Gericom Bellagio */
687                 .matches = {
688                         DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
689                         DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
690                 },
691                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
692         },
693         {
694                 /* Gigabyte M1022M netbook */
695                 .matches = {
696                         DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
697                         DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
698                         DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
699                 },
700                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
701         },
702         {
703                 .matches = {
704                         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
705                         DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
706                         DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
707                 },
708                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
709         },
710         {
711                 /*
712                  * HP Pavilion DV4017EA -
713                  * errors on MUX ports are reported without raising AUXDATA
714                  * causing "spurious NAK" messages.
715                  */
716                 .matches = {
717                         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
718                         DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
719                 },
720                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
721         },
722         {
723                 /*
724                  * HP Pavilion ZT1000 -
725                  * like DV4017EA does not raise AUXERR for errors on MUX ports.
726                  */
727                 .matches = {
728                         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
729                         DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
730                         DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
731                 },
732                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
733         },
734         {
735                 /*
736                  * HP Pavilion DV4270ca -
737                  * like DV4017EA does not raise AUXERR for errors on MUX ports.
738                  */
739                 .matches = {
740                         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
741                         DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
742                 },
743                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
744         },
745         {
746                 /* Newer HP Pavilion dv4 models */
747                 .matches = {
748                         DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
749                         DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
750                 },
751                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
752         },
753         {
754                 /* IBM 2656 */
755                 .matches = {
756                         DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
757                         DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
758                 },
759                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
760         },
761         {
762                 /* Avatar AVIU-145A6 */
763                 .matches = {
764                         DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
765                         DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
766                 },
767                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
768         },
769         {
770                 /* Intel MBO Desktop D845PESV */
771                 .matches = {
772                         DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
773                         DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
774                 },
775                 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
776         },
777         {
778                 /*
779                  * Intel NUC D54250WYK - does not have i8042 controller but
780                  * declares PS/2 devices in DSDT.
781                  */
782                 .matches = {
783                         DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
784                         DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
785                 },
786                 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
787         },
788         {
789                 /* Lenovo 3000 n100 */
790                 .matches = {
791                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
792                         DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
793                 },
794                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
795         },
796         {
797                 /* Lenovo XiaoXin Air 12 */
798                 .matches = {
799                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
800                         DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
801                 },
802                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
803         },
804         {
805                 /* Lenovo LaVie Z */
806                 .matches = {
807                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
808                         DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
809                 },
810                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
811         },
812         {
813                 /* Lenovo Ideapad U455 */
814                 .matches = {
815                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
816                         DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
817                 },
818                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
819         },
820         {
821                 /* Lenovo ThinkPad L460 */
822                 .matches = {
823                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
824                         DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
825                 },
826                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
827         },
828         {
829                 /* Lenovo ThinkPad Twist S230u */
830                 .matches = {
831                         DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
832                         DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
833                 },
834                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
835         },
836         {
837                 /* LG Electronics X110 */
838                 .matches = {
839                         DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
840                         DMI_MATCH(DMI_BOARD_NAME, "X110"),
841                 },
842                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
843         },
844         {
845                 /* Medion Akoya Mini E1210 */
846                 .matches = {
847                         DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
848                         DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
849                 },
850                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
851         },
852         {
853                 /* Medion Akoya E1222 */
854                 .matches = {
855                         DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
856                         DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
857                 },
858                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
859         },
860         {
861                 /* MSI Wind U-100 */
862                 .matches = {
863                         DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
864                         DMI_MATCH(DMI_BOARD_NAME, "U-100"),
865                 },
866                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
867         },
868         {
869                 /*
870                  * No data is coming from the touchscreen unless KBC
871                  * is in legacy mode.
872                  */
873                 /* Panasonic CF-29 */
874                 .matches = {
875                         DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
876                         DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
877                 },
878                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
879         },
880         {
881                 /* Medion Akoya E7225 */
882                 .matches = {
883                         DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
884                         DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
885                         DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
886                 },
887                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
888         },
889         {
890                 /* Microsoft Virtual Machine */
891                 .matches = {
892                         DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
893                         DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
894                         DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
895                 },
896                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
897         },
898         {
899                 /* Medion MAM 2070 */
900                 .matches = {
901                         DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
902                         DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
903                         DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
904                 },
905                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
906         },
907         {
908                 /* TUXEDO BU1406 */
909                 .matches = {
910                         DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
911                         DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
912                 },
913                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
914         },
915         {
916                 /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
917                 .matches = {
918                         DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
919                         DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
920                 },
921                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
922         },
923         {
924                 /* OQO Model 01 */
925                 .matches = {
926                         DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
927                         DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
928                         DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
929                 },
930                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
931         },
932         {
933                 .matches = {
934                         DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
935                         DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
936                 },
937                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
938         },
939         {
940                 /* Acer Aspire 5 A515 */
941                 .matches = {
942                         DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
943                         DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
944                 },
945                 .driver_data = (void *)(SERIO_QUIRK_NOPNP)
946         },
947         {
948                 /* ULI EV4873 - AUX LOOP does not work properly */
949                 .matches = {
950                         DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
951                         DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
952                         DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
953                 },
954                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
955         },
956         {
957                 /*
958                  * Arima-Rioworks HDAMB -
959                  * AUX LOOP command does not raise AUX IRQ
960                  */
961                 .matches = {
962                         DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
963                         DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
964                         DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
965                 },
966                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
967         },
968         {
969                 /* Sharp Actius MM20 */
970                 .matches = {
971                         DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
972                         DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
973                 },
974                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
975         },
976         {
977                 /*
978                  * Sony Vaio FZ-240E -
979                  * reset and GET ID commands issued via KBD port are
980                  * sometimes being delivered to AUX3.
981                  */
982                 .matches = {
983                         DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
984                         DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
985                 },
986                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
987         },
988         {
989                 /*
990                  * Most (all?) VAIOs do not have external PS/2 ports nor
991                  * they implement active multiplexing properly, and
992                  * MUX discovery usually messes up keyboard/touchpad.
993                  */
994                 .matches = {
995                         DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
996                         DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
997                 },
998                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
999         },
1000         {
1001                 /* Sony Vaio FS-115b */
1002                 .matches = {
1003                         DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1004                         DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1005                 },
1006                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1007         },
1008         {
1009                 /*
1010                  * Sony Vaio VGN-CS series require MUX or the touch sensor
1011                  * buttons will disturb touchpad operation
1012                  */
1013                 .matches = {
1014                         DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1015                         DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1016                 },
1017                 .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1018         },
1019         {
1020                 .matches = {
1021                         DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1022                         DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1023                 },
1024                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1025         },
1026         {
1027                 .matches = {
1028                         DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1029                         DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1030                 },
1031                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1032         },
1033         {
1034                 .matches = {
1035                         DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1036                         DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1037                 },
1038                 .driver_data = (void *)(SERIO_QUIRK_NOMUX)
1039         },
1040         /*
1041          * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1042          * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1043          * none of them have an external PS/2 port so this can safely be set for
1044          * all of them. These two are based on a Clevo design, but have the
1045          * board_name changed.
1046          */
1047         {
1048                 .matches = {
1049                         DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1050                         DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1051                 },
1052                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1053                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1054         },
1055         {
1056                 .matches = {
1057                         DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1058                         DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1059                 },
1060                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1061                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1062         },
1063         {
1064                 /* Mivvy M310 */
1065                 .matches = {
1066                         DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1067                         DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1068                 },
1069                 .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1070         },
1071         /*
1072          * Some laptops need keyboard reset before probing for the trackpad to get
1073          * it detected, initialised & finally work.
1074          */
1075         {
1076                 /* Schenker XMG C504 - Elantech touchpad */
1077                 .matches = {
1078                         DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1079                         DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1080                 },
1081                 .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1082         },
1083         {
1084                 /* Blue FB5601 */
1085                 .matches = {
1086                         DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1087                         DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1088                         DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1089                 },
1090                 .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1091         },
1092         /*
1093          * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1094          * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1095          * none of them have an external PS/2 port so this can safely be set for
1096          * all of them.
1097          * Clevo barebones come with board_vendor and/or system_vendor set to
1098          * either the very generic string "Notebook" and/or a different value
1099          * for each individual reseller. The only somewhat universal way to
1100          * identify them is by board_name.
1101          */
1102         {
1103                 .matches = {
1104                         DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1105                 },
1106                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1107                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1108         },
1109         {
1110                 .matches = {
1111                         DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1112                 },
1113                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1114                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1115         },
1116         {
1117                 .matches = {
1118                         DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1119                 },
1120                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1121                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1122         },
1123         {
1124                 .matches = {
1125                         DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1126                 },
1127                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1128                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1129         },
1130         {
1131                 .matches = {
1132                         DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1133                 },
1134                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1135                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1136         },
1137         {
1138                 .matches = {
1139                         DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1140                 },
1141                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1142                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1143         },
1144         /*
1145          * At least one modern Clevo barebone has the touchpad connected both
1146          * via PS/2 and i2c interface. This causes a race condition between the
1147          * psmouse and i2c-hid driver. Since the full capability of the touchpad
1148          * is available via the i2c interface and the device has no external
1149          * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1150          * this issue. The known affected device is the
1151          * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1152          * the two different dmi strings below. NS50MU is not a typo!
1153          */
1154         {
1155                 .matches = {
1156                         DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1157                 },
1158                 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1159                                         SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1160                                         SERIO_QUIRK_NOPNP)
1161         },
1162         {
1163                 .matches = {
1164                         DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1165                 },
1166                 .driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1167                                         SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1168                                         SERIO_QUIRK_NOPNP)
1169         },
1170         {
1171                 .matches = {
1172                         DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1173                 },
1174                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1175                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1176         },
1177         {
1178                 .matches = {
1179                         DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1180                 },
1181                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1182                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1183         },
1184         {
1185                 .matches = {
1186                         DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
1187                 },
1188                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1189                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1190         },
1191         {
1192                 .matches = {
1193                         DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1194                 },
1195                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1196                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1197         },
1198         {
1199                 .matches = {
1200                         DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1201                 },
1202                 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1203                                         SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1204         },
1205         { }
1206 };
1207
1208 #ifdef CONFIG_PNP
1209 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1210         {
1211                 .matches = {
1212                         DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1213                 },
1214         },
1215         {
1216                 .matches = {
1217                         DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1218                 },
1219         },
1220         {
1221                 .matches = {
1222                         DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1223                 },
1224         },
1225         {
1226                 .matches = {
1227                         DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1228                 },
1229         },
1230         { }
1231 };
1232 #endif
1233
1234 #endif /* CONFIG_X86 */
1235
1236 #ifdef CONFIG_PNP
1237 #include <linux/pnp.h>
1238
1239 static bool i8042_pnp_kbd_registered;
1240 static unsigned int i8042_pnp_kbd_devices;
1241 static bool i8042_pnp_aux_registered;
1242 static unsigned int i8042_pnp_aux_devices;
1243
1244 static int i8042_pnp_command_reg;
1245 static int i8042_pnp_data_reg;
1246 static int i8042_pnp_kbd_irq;
1247 static int i8042_pnp_aux_irq;
1248
1249 static char i8042_pnp_kbd_name[32];
1250 static char i8042_pnp_aux_name[32];
1251
1252 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1253 {
1254         strlcpy(dst, "PNP:", dst_size);
1255
1256         while (id) {
1257                 strlcat(dst, " ", dst_size);
1258                 strlcat(dst, id->id, dst_size);
1259                 id = id->next;
1260         }
1261 }
1262
1263 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1264 {
1265         if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1266                 i8042_pnp_data_reg = pnp_port_start(dev,0);
1267
1268         if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1269                 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1270
1271         if (pnp_irq_valid(dev,0))
1272                 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1273
1274         strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1275         if (strlen(pnp_dev_name(dev))) {
1276                 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1277                 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1278         }
1279         i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1280                                sizeof(i8042_kbd_firmware_id));
1281
1282         /* Keyboard ports are always supposed to be wakeup-enabled */
1283         device_set_wakeup_enable(&dev->dev, true);
1284
1285         i8042_pnp_kbd_devices++;
1286         return 0;
1287 }
1288
1289 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1290 {
1291         if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1292                 i8042_pnp_data_reg = pnp_port_start(dev,0);
1293
1294         if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1295                 i8042_pnp_command_reg = pnp_port_start(dev, 1);
1296
1297         if (pnp_irq_valid(dev, 0))
1298                 i8042_pnp_aux_irq = pnp_irq(dev, 0);
1299
1300         strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1301         if (strlen(pnp_dev_name(dev))) {
1302                 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1303                 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1304         }
1305         i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1306                                sizeof(i8042_aux_firmware_id));
1307
1308         i8042_pnp_aux_devices++;
1309         return 0;
1310 }
1311
1312 static const struct pnp_device_id pnp_kbd_devids[] = {
1313         { .id = "PNP0300", .driver_data = 0 },
1314         { .id = "PNP0301", .driver_data = 0 },
1315         { .id = "PNP0302", .driver_data = 0 },
1316         { .id = "PNP0303", .driver_data = 0 },
1317         { .id = "PNP0304", .driver_data = 0 },
1318         { .id = "PNP0305", .driver_data = 0 },
1319         { .id = "PNP0306", .driver_data = 0 },
1320         { .id = "PNP0309", .driver_data = 0 },
1321         { .id = "PNP030a", .driver_data = 0 },
1322         { .id = "PNP030b", .driver_data = 0 },
1323         { .id = "PNP0320", .driver_data = 0 },
1324         { .id = "PNP0343", .driver_data = 0 },
1325         { .id = "PNP0344", .driver_data = 0 },
1326         { .id = "PNP0345", .driver_data = 0 },
1327         { .id = "CPQA0D7", .driver_data = 0 },
1328         { .id = "", },
1329 };
1330 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1331
1332 static struct pnp_driver i8042_pnp_kbd_driver = {
1333         .name           = "i8042 kbd",
1334         .id_table       = pnp_kbd_devids,
1335         .probe          = i8042_pnp_kbd_probe,
1336         .driver         = {
1337                 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1338                 .suppress_bind_attrs = true,
1339         },
1340 };
1341
1342 static const struct pnp_device_id pnp_aux_devids[] = {
1343         { .id = "AUI0200", .driver_data = 0 },
1344         { .id = "FJC6000", .driver_data = 0 },
1345         { .id = "FJC6001", .driver_data = 0 },
1346         { .id = "PNP0f03", .driver_data = 0 },
1347         { .id = "PNP0f0b", .driver_data = 0 },
1348         { .id = "PNP0f0e", .driver_data = 0 },
1349         { .id = "PNP0f12", .driver_data = 0 },
1350         { .id = "PNP0f13", .driver_data = 0 },
1351         { .id = "PNP0f19", .driver_data = 0 },
1352         { .id = "PNP0f1c", .driver_data = 0 },
1353         { .id = "SYN0801", .driver_data = 0 },
1354         { .id = "", },
1355 };
1356 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1357
1358 static struct pnp_driver i8042_pnp_aux_driver = {
1359         .name           = "i8042 aux",
1360         .id_table       = pnp_aux_devids,
1361         .probe          = i8042_pnp_aux_probe,
1362         .driver         = {
1363                 .probe_type = PROBE_FORCE_SYNCHRONOUS,
1364                 .suppress_bind_attrs = true,
1365         },
1366 };
1367
1368 static void i8042_pnp_exit(void)
1369 {
1370         if (i8042_pnp_kbd_registered) {
1371                 i8042_pnp_kbd_registered = false;
1372                 pnp_unregister_driver(&i8042_pnp_kbd_driver);
1373         }
1374
1375         if (i8042_pnp_aux_registered) {
1376                 i8042_pnp_aux_registered = false;
1377                 pnp_unregister_driver(&i8042_pnp_aux_driver);
1378         }
1379 }
1380
1381 static int __init i8042_pnp_init(void)
1382 {
1383         char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1384         bool pnp_data_busted = false;
1385         int err;
1386
1387         if (i8042_nopnp) {
1388                 pr_info("PNP detection disabled\n");
1389                 return 0;
1390         }
1391
1392         err = pnp_register_driver(&i8042_pnp_kbd_driver);
1393         if (!err)
1394                 i8042_pnp_kbd_registered = true;
1395
1396         err = pnp_register_driver(&i8042_pnp_aux_driver);
1397         if (!err)
1398                 i8042_pnp_aux_registered = true;
1399
1400         if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1401                 i8042_pnp_exit();
1402 #if defined(__ia64__)
1403                 return -ENODEV;
1404 #else
1405                 pr_info("PNP: No PS/2 controller found.\n");
1406                 if (x86_platform.legacy.i8042 !=
1407                                 X86_LEGACY_I8042_EXPECTED_PRESENT)
1408                         return -ENODEV;
1409                 pr_info("Probing ports directly.\n");
1410                 return 0;
1411 #endif
1412         }
1413
1414         if (i8042_pnp_kbd_devices)
1415                 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1416                         "%d", i8042_pnp_kbd_irq);
1417         if (i8042_pnp_aux_devices)
1418                 snprintf(aux_irq_str, sizeof(aux_irq_str),
1419                         "%d", i8042_pnp_aux_irq);
1420
1421         pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1422                 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1423                 i8042_pnp_aux_name,
1424                 i8042_pnp_data_reg, i8042_pnp_command_reg,
1425                 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1426                 aux_irq_str);
1427
1428 #if defined(__ia64__)
1429         if (!i8042_pnp_kbd_devices)
1430                 i8042_nokbd = true;
1431         if (!i8042_pnp_aux_devices)
1432                 i8042_noaux = true;
1433 #endif
1434
1435         if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1436               i8042_pnp_data_reg != i8042_data_reg) ||
1437             !i8042_pnp_data_reg) {
1438                 pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1439                         i8042_pnp_data_reg, i8042_data_reg);
1440                 i8042_pnp_data_reg = i8042_data_reg;
1441                 pnp_data_busted = true;
1442         }
1443
1444         if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1445               i8042_pnp_command_reg != i8042_command_reg) ||
1446             !i8042_pnp_command_reg) {
1447                 pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1448                         i8042_pnp_command_reg, i8042_command_reg);
1449                 i8042_pnp_command_reg = i8042_command_reg;
1450                 pnp_data_busted = true;
1451         }
1452
1453         if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1454                 pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1455                         i8042_kbd_irq);
1456                 i8042_pnp_kbd_irq = i8042_kbd_irq;
1457                 pnp_data_busted = true;
1458         }
1459
1460         if (!i8042_noaux && !i8042_pnp_aux_irq) {
1461                 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1462                         pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1463                                 "if this is incorrect please boot with i8042.nopnp\n");
1464                         i8042_noaux = true;
1465                 } else {
1466                         pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1467                                 i8042_aux_irq);
1468                         i8042_pnp_aux_irq = i8042_aux_irq;
1469                 }
1470         }
1471
1472         i8042_data_reg = i8042_pnp_data_reg;
1473         i8042_command_reg = i8042_pnp_command_reg;
1474         i8042_kbd_irq = i8042_pnp_kbd_irq;
1475         i8042_aux_irq = i8042_pnp_aux_irq;
1476
1477 #ifdef CONFIG_X86
1478         i8042_bypass_aux_irq_test = !pnp_data_busted &&
1479                                     dmi_check_system(i8042_dmi_laptop_table);
1480 #endif
1481
1482         return 0;
1483 }
1484
1485 #else  /* !CONFIG_PNP */
1486 static inline int i8042_pnp_init(void) { return 0; }
1487 static inline void i8042_pnp_exit(void) { }
1488 #endif /* CONFIG_PNP */
1489
1490
1491 #ifdef CONFIG_X86
1492 static void __init i8042_check_quirks(void)
1493 {
1494         const struct dmi_system_id *device_quirk_info;
1495         uintptr_t quirks;
1496
1497         device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1498         if (!device_quirk_info)
1499                 return;
1500
1501         quirks = (uintptr_t)device_quirk_info->driver_data;
1502
1503         if (quirks & SERIO_QUIRK_NOKBD)
1504                 i8042_nokbd = true;
1505         if (quirks & SERIO_QUIRK_NOAUX)
1506                 i8042_noaux = true;
1507         if (quirks & SERIO_QUIRK_NOMUX)
1508                 i8042_nomux = true;
1509         if (quirks & SERIO_QUIRK_FORCEMUX)
1510                 i8042_nomux = false;
1511         if (quirks & SERIO_QUIRK_UNLOCK)
1512                 i8042_unlock = true;
1513         if (quirks & SERIO_QUIRK_PROBE_DEFER)
1514                 i8042_probe_defer = true;
1515         /* Honor module parameter when value is not default */
1516         if (i8042_reset == I8042_RESET_DEFAULT) {
1517                 if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1518                         i8042_reset = I8042_RESET_ALWAYS;
1519                 if (quirks & SERIO_QUIRK_RESET_NEVER)
1520                         i8042_reset = I8042_RESET_NEVER;
1521         }
1522         if (quirks & SERIO_QUIRK_DIECT)
1523                 i8042_direct = true;
1524         if (quirks & SERIO_QUIRK_DUMBKBD)
1525                 i8042_dumbkbd = true;
1526         if (quirks & SERIO_QUIRK_NOLOOP)
1527                 i8042_noloop = true;
1528         if (quirks & SERIO_QUIRK_NOTIMEOUT)
1529                 i8042_notimeout = true;
1530         if (quirks & SERIO_QUIRK_KBDRESET)
1531                 i8042_kbdreset = true;
1532         if (quirks & SERIO_QUIRK_DRITEK)
1533                 i8042_dritek = true;
1534 #ifdef CONFIG_PNP
1535         if (quirks & SERIO_QUIRK_NOPNP)
1536                 i8042_nopnp = true;
1537 #endif
1538 }
1539 #else
1540 static inline void i8042_check_quirks(void) {}
1541 #endif
1542
1543 static int __init i8042_platform_init(void)
1544 {
1545         int retval;
1546
1547 #ifdef CONFIG_X86
1548         u8 a20_on = 0xdf;
1549         /* Just return if platform does not have i8042 controller */
1550         if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1551                 return -ENODEV;
1552 #endif
1553
1554 /*
1555  * On ix86 platforms touching the i8042 data register region can do really
1556  * bad things. Because of this the region is always reserved on ix86 boxes.
1557  *
1558  *      if (!request_region(I8042_DATA_REG, 16, "i8042"))
1559  *              return -EBUSY;
1560  */
1561
1562         i8042_kbd_irq = I8042_MAP_IRQ(1);
1563         i8042_aux_irq = I8042_MAP_IRQ(12);
1564
1565 #if defined(__ia64__)
1566         i8042_reset = I8042_RESET_ALWAYS;
1567 #endif
1568
1569         i8042_check_quirks();
1570
1571         retval = i8042_pnp_init();
1572         if (retval)
1573                 return retval;
1574
1575 #ifdef CONFIG_X86
1576         /*
1577          * A20 was already enabled during early kernel init. But some buggy
1578          * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1579          * resume from S3. So we do it here and hope that nothing breaks.
1580          */
1581         i8042_command(&a20_on, 0x10d1);
1582         i8042_command(NULL, 0x00ff);    /* Null command for SMM firmware */
1583 #endif /* CONFIG_X86 */
1584
1585         return retval;
1586 }
1587
1588 static inline void i8042_platform_exit(void)
1589 {
1590         i8042_pnp_exit();
1591 }
1592
1593 #endif /* _I8042_X86IA64IO_H */