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