• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #ifndef _I8042_ACPIPNPIO_H
3 #define _I8042_ACPIPNPIO_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 
i8042_read_data(void)46 static inline int i8042_read_data(void)
47 {
48 	return inb(I8042_DATA_REG);
49 }
50 
i8042_read_status(void)51 static inline int i8042_read_status(void)
52 {
53 	return inb(I8042_STATUS_REG);
54 }
55 
i8042_write_data(int val)56 static inline void i8042_write_data(int val)
57 {
58 	outb(val, I8042_DATA_REG);
59 }
60 
i8042_write_command(int val)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 		.matches = {
221 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
222 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
223 		},
224 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
225 	},
226 	{
227 		.matches = {
228 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
229 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
230 		},
231 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
232 	},
233 	{
234 		.matches = {
235 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
236 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
237 		},
238 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
239 	},
240 	{
241 		.matches = {
242 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
243 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
244 		},
245 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
246 	},
247 	{
248 		.matches = {
249 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
250 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
251 		},
252 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
253 	},
254 	{
255 		.matches = {
256 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
257 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
258 		},
259 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
260 	},
261 	{
262 		.matches = {
263 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
264 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
265 		},
266 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
267 	},
268 	/*
269 	 * Some Wistron based laptops need us to explicitly enable the 'Dritek
270 	 * keyboard extension' to make their extra keys start generating scancodes.
271 	 * Originally, this was just confined to older laptops, but a few Acer laptops
272 	 * have turned up in 2007 that also need this again.
273 	 */
274 	{
275 		/* Acer Aspire 5100 */
276 		.matches = {
277 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
278 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
279 		},
280 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
281 	},
282 	{
283 		/* Acer Aspire 5610 */
284 		.matches = {
285 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
286 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
287 		},
288 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
289 	},
290 	{
291 		/* Acer Aspire 5630 */
292 		.matches = {
293 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
294 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
295 		},
296 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
297 	},
298 	{
299 		/* Acer Aspire 5650 */
300 		.matches = {
301 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
302 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
303 		},
304 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
305 	},
306 	{
307 		/* Acer Aspire 5680 */
308 		.matches = {
309 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
310 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
311 		},
312 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
313 	},
314 	{
315 		/* Acer Aspire 5720 */
316 		.matches = {
317 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
318 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
319 		},
320 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
321 	},
322 	{
323 		/* Acer Aspire 9110 */
324 		.matches = {
325 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
326 			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
327 		},
328 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
329 	},
330 	{
331 		/* Acer TravelMate 660 */
332 		.matches = {
333 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
334 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
335 		},
336 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
337 	},
338 	{
339 		/* Acer TravelMate 2490 */
340 		.matches = {
341 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
342 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
343 		},
344 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
345 	},
346 	{
347 		/* Acer TravelMate 4280 */
348 		.matches = {
349 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
350 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
351 		},
352 		.driver_data = (void *)(SERIO_QUIRK_DRITEK)
353 	},
354 	{
355 		/* Acer TravelMate P459-G2-M */
356 		.matches = {
357 			DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
358 			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
359 		},
360 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
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 		/* Fujitsu Lifebook A574/H */
614 		.matches = {
615 			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
616 			DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
617 		},
618 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
619 	},
620 	{
621 		/* Fujitsu Lifebook E5411 */
622 		.matches = {
623 			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
624 			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
625 		},
626 		.driver_data = (void *)(SERIO_QUIRK_NOAUX)
627 	},
628 	{
629 		/* Fujitsu Lifebook U728 */
630 		.matches = {
631 			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
632 			DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U728"),
633 		},
634 		.driver_data = (void *)(SERIO_QUIRK_NOAUX)
635 	},
636 	{
637 		/* Gigabyte M912 */
638 		.matches = {
639 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
640 			DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
641 			DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
642 		},
643 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
644 	},
645 	{
646 		/* Gigabyte Spring Peak - defines wrong chassis type */
647 		.matches = {
648 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
649 			DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
650 		},
651 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
652 	},
653 	{
654 		/* Gigabyte T1005 - defines wrong chassis type ("Other") */
655 		.matches = {
656 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
657 			DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
658 		},
659 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
660 	},
661 	{
662 		/* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
663 		.matches = {
664 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
665 			DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
666 		},
667 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
668 	},
669 	/*
670 	 * Some laptops need keyboard reset before probing for the trackpad to get
671 	 * it detected, initialised & finally work.
672 	 */
673 	{
674 		/* Gigabyte P35 v2 - Elantech touchpad */
675 		.matches = {
676 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
677 			DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
678 		},
679 		.driver_data = (void *)(SERIO_QUIRK_KBDRESET)
680 	},
681 		{
682 		/* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
683 		.matches = {
684 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
685 			DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
686 		},
687 		.driver_data = (void *)(SERIO_QUIRK_KBDRESET)
688 	},
689 	{
690 		/* Gigabyte P34 - Elantech touchpad */
691 		.matches = {
692 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
693 			DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
694 		},
695 		.driver_data = (void *)(SERIO_QUIRK_KBDRESET)
696 	},
697 	{
698 		/* Gigabyte P57 - Elantech touchpad */
699 		.matches = {
700 			DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
701 			DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
702 		},
703 		.driver_data = (void *)(SERIO_QUIRK_KBDRESET)
704 	},
705 	{
706 		/* Gericom Bellagio */
707 		.matches = {
708 			DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
709 			DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
710 		},
711 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
712 	},
713 	{
714 		/* Gigabyte M1022M netbook */
715 		.matches = {
716 			DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
717 			DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
718 			DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
719 		},
720 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
721 	},
722 	{
723 		.matches = {
724 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
725 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
726 			DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
727 		},
728 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
729 	},
730 	{
731 		/*
732 		 * HP Pavilion DV4017EA -
733 		 * errors on MUX ports are reported without raising AUXDATA
734 		 * causing "spurious NAK" messages.
735 		 */
736 		.matches = {
737 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
738 			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
739 		},
740 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
741 	},
742 	{
743 		/*
744 		 * HP Pavilion ZT1000 -
745 		 * like DV4017EA does not raise AUXERR for errors on MUX ports.
746 		 */
747 		.matches = {
748 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
749 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
750 			DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
751 		},
752 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
753 	},
754 	{
755 		/*
756 		 * HP Pavilion DV4270ca -
757 		 * like DV4017EA does not raise AUXERR for errors on MUX ports.
758 		 */
759 		.matches = {
760 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
761 			DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
762 		},
763 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
764 	},
765 	{
766 		/* Newer HP Pavilion dv4 models */
767 		.matches = {
768 			DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
769 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
770 		},
771 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
772 	},
773 	{
774 		/* IBM 2656 */
775 		.matches = {
776 			DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
777 			DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
778 		},
779 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
780 	},
781 	{
782 		/* Avatar AVIU-145A6 */
783 		.matches = {
784 			DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
785 			DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
786 		},
787 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
788 	},
789 	{
790 		/* Intel MBO Desktop D845PESV */
791 		.matches = {
792 			DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
793 			DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
794 		},
795 		.driver_data = (void *)(SERIO_QUIRK_NOPNP)
796 	},
797 	{
798 		/*
799 		 * Intel NUC D54250WYK - does not have i8042 controller but
800 		 * declares PS/2 devices in DSDT.
801 		 */
802 		.matches = {
803 			DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
804 			DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
805 		},
806 		.driver_data = (void *)(SERIO_QUIRK_NOPNP)
807 	},
808 	{
809 		/* Lenovo 3000 n100 */
810 		.matches = {
811 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
812 			DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
813 		},
814 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
815 	},
816 	{
817 		/* Lenovo XiaoXin Air 12 */
818 		.matches = {
819 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
820 			DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
821 		},
822 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
823 	},
824 	{
825 		/* Lenovo LaVie Z */
826 		.matches = {
827 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
828 			DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
829 		},
830 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
831 	},
832 	{
833 		/* Lenovo Ideapad U455 */
834 		.matches = {
835 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
836 			DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
837 		},
838 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
839 	},
840 	{
841 		/* Lenovo ThinkPad L460 */
842 		.matches = {
843 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
844 			DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
845 		},
846 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
847 	},
848 	{
849 		/* Lenovo ThinkPad Twist S230u */
850 		.matches = {
851 			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
852 			DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
853 		},
854 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
855 	},
856 	{
857 		/* LG Electronics X110 */
858 		.matches = {
859 			DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
860 			DMI_MATCH(DMI_BOARD_NAME, "X110"),
861 		},
862 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
863 	},
864 	{
865 		/* Medion Akoya Mini E1210 */
866 		.matches = {
867 			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
868 			DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
869 		},
870 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
871 	},
872 	{
873 		/* Medion Akoya E1222 */
874 		.matches = {
875 			DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
876 			DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
877 		},
878 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
879 	},
880 	{
881 		/* MSI Wind U-100 */
882 		.matches = {
883 			DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
884 			DMI_MATCH(DMI_BOARD_NAME, "U-100"),
885 		},
886 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
887 	},
888 	{
889 		/*
890 		 * No data is coming from the touchscreen unless KBC
891 		 * is in legacy mode.
892 		 */
893 		/* Panasonic CF-29 */
894 		.matches = {
895 			DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
896 			DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
897 		},
898 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
899 	},
900 	{
901 		/* Medion Akoya E7225 */
902 		.matches = {
903 			DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
904 			DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
905 			DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
906 		},
907 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
908 	},
909 	{
910 		/* Microsoft Virtual Machine */
911 		.matches = {
912 			DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
913 			DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
914 			DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
915 		},
916 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
917 	},
918 	{
919 		/* Medion MAM 2070 */
920 		.matches = {
921 			DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
922 			DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
923 			DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
924 		},
925 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
926 	},
927 	{
928 		/* TUXEDO BU1406 */
929 		.matches = {
930 			DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
931 			DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
932 		},
933 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
934 	},
935 	{
936 		/* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
937 		.matches = {
938 			DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
939 			DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
940 		},
941 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
942 	},
943 	{
944 		/* OQO Model 01 */
945 		.matches = {
946 			DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
947 			DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
948 			DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
949 		},
950 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
951 	},
952 	{
953 		.matches = {
954 			DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
955 			DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
956 		},
957 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
958 	},
959 	{
960 		/* Acer Aspire 5 A515 */
961 		.matches = {
962 			DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
963 			DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
964 		},
965 		.driver_data = (void *)(SERIO_QUIRK_NOPNP)
966 	},
967 	{
968 		/* ULI EV4873 - AUX LOOP does not work properly */
969 		.matches = {
970 			DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
971 			DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
972 			DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
973 		},
974 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
975 	},
976 	{
977 		/*
978 		 * Arima-Rioworks HDAMB -
979 		 * AUX LOOP command does not raise AUX IRQ
980 		 */
981 		.matches = {
982 			DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
983 			DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
984 			DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
985 		},
986 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
987 	},
988 	{
989 		/* Sharp Actius MM20 */
990 		.matches = {
991 			DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
992 			DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
993 		},
994 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
995 	},
996 	{
997 		/*
998 		 * Sony Vaio FZ-240E -
999 		 * reset and GET ID commands issued via KBD port are
1000 		 * sometimes being delivered to AUX3.
1001 		 */
1002 		.matches = {
1003 			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1004 			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
1005 		},
1006 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1007 	},
1008 	{
1009 		/*
1010 		 * Most (all?) VAIOs do not have external PS/2 ports nor
1011 		 * they implement active multiplexing properly, and
1012 		 * MUX discovery usually messes up keyboard/touchpad.
1013 		 */
1014 		.matches = {
1015 			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1016 			DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
1017 		},
1018 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1019 	},
1020 	{
1021 		/* Sony Vaio FS-115b */
1022 		.matches = {
1023 			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1024 			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
1025 		},
1026 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1027 	},
1028 	{
1029 		/*
1030 		 * Sony Vaio VGN-CS series require MUX or the touch sensor
1031 		 * buttons will disturb touchpad operation
1032 		 */
1033 		.matches = {
1034 			DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
1035 			DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
1036 		},
1037 		.driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
1038 	},
1039 	{
1040 		.matches = {
1041 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1042 			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
1043 		},
1044 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1045 	},
1046 	{
1047 		.matches = {
1048 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1049 			DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
1050 		},
1051 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1052 	},
1053 	{
1054 		.matches = {
1055 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
1056 			DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
1057 		},
1058 		.driver_data = (void *)(SERIO_QUIRK_NOMUX)
1059 	},
1060 	/*
1061 	 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1062 	 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1063 	 * none of them have an external PS/2 port so this can safely be set for
1064 	 * all of them. These two are based on a Clevo design, but have the
1065 	 * board_name changed.
1066 	 */
1067 	{
1068 		.matches = {
1069 			DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1070 			DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
1071 		},
1072 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1073 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1074 	},
1075 	{
1076 		.matches = {
1077 			DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
1078 			DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
1079 		},
1080 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1081 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1082 	},
1083 	{
1084 		/* Mivvy M310 */
1085 		.matches = {
1086 			DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
1087 			DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
1088 		},
1089 		.driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
1090 	},
1091 	/*
1092 	 * Some laptops need keyboard reset before probing for the trackpad to get
1093 	 * it detected, initialised & finally work.
1094 	 */
1095 	{
1096 		/* Schenker XMG C504 - Elantech touchpad */
1097 		.matches = {
1098 			DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
1099 			DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
1100 		},
1101 		.driver_data = (void *)(SERIO_QUIRK_KBDRESET)
1102 	},
1103 	{
1104 		/* Blue FB5601 */
1105 		.matches = {
1106 			DMI_MATCH(DMI_SYS_VENDOR, "blue"),
1107 			DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
1108 			DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
1109 		},
1110 		.driver_data = (void *)(SERIO_QUIRK_NOLOOP)
1111 	},
1112 	/*
1113 	 * A lot of modern Clevo barebones have touchpad and/or keyboard issues
1114 	 * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
1115 	 * none of them have an external PS/2 port so this can safely be set for
1116 	 * all of them.
1117 	 * Clevo barebones come with board_vendor and/or system_vendor set to
1118 	 * either the very generic string "Notebook" and/or a different value
1119 	 * for each individual reseller. The only somewhat universal way to
1120 	 * identify them is by board_name.
1121 	 */
1122 	{
1123 		.matches = {
1124 			DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
1125 		},
1126 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1127 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1128 	},
1129 	{
1130 		.matches = {
1131 			DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
1132 		},
1133 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1134 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1135 	},
1136 	{
1137 		.matches = {
1138 			DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
1139 		},
1140 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1141 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1142 	},
1143 	{
1144 		.matches = {
1145 			DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
1146 		},
1147 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1148 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1149 	},
1150 	{
1151 		.matches = {
1152 			DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
1153 		},
1154 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1155 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1156 	},
1157 	{
1158 		.matches = {
1159 			DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
1160 		},
1161 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1162 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1163 	},
1164 	/*
1165 	 * At least one modern Clevo barebone has the touchpad connected both
1166 	 * via PS/2 and i2c interface. This causes a race condition between the
1167 	 * psmouse and i2c-hid driver. Since the full capability of the touchpad
1168 	 * is available via the i2c interface and the device has no external
1169 	 * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
1170 	 * this issue. The known affected device is the
1171 	 * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
1172 	 * the two different dmi strings below. NS50MU is not a typo!
1173 	 */
1174 	{
1175 		.matches = {
1176 			DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
1177 		},
1178 		.driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1179 					SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1180 					SERIO_QUIRK_NOPNP)
1181 	},
1182 	{
1183 		.matches = {
1184 			DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
1185 		},
1186 		.driver_data = (void *)(SERIO_QUIRK_NOAUX | SERIO_QUIRK_NOMUX |
1187 					SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
1188 					SERIO_QUIRK_NOPNP)
1189 	},
1190 	{
1191 		.matches = {
1192 			DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
1193 		},
1194 		.driver_data = (void *)(SERIO_QUIRK_NOAUX)
1195 	},
1196 	{
1197 		.matches = {
1198 			DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
1199 		},
1200 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1201 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1202 	},
1203 	{
1204 		.matches = {
1205 			DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
1206 		},
1207 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1208 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1209 	},
1210 	{
1211 		.matches = {
1212 			DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
1213 		},
1214 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1215 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1216 	},
1217 	/* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
1218 	{
1219 		.matches = {
1220 			DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"),
1221 		},
1222 		.driver_data = (void *)(SERIO_QUIRK_NOAUX)
1223 	},
1224 	{
1225 		.matches = {
1226 			DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
1227 		},
1228 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1229 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1230 	},
1231 	{
1232 		.matches = {
1233 			DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
1234 		},
1235 		.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1236 					SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1237 	},
1238 	{ }
1239 };
1240 
1241 #ifdef CONFIG_PNP
1242 static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
1243 	{
1244 		.matches = {
1245 			DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
1246 		},
1247 	},
1248 	{
1249 		.matches = {
1250 			DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
1251 		},
1252 	},
1253 	{
1254 		.matches = {
1255 			DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
1256 		},
1257 	},
1258 	{
1259 		.matches = {
1260 			DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
1261 		},
1262 	},
1263 	{ }
1264 };
1265 #endif
1266 
1267 #endif /* CONFIG_X86 */
1268 
1269 #ifdef CONFIG_PNP
1270 #include <linux/pnp.h>
1271 
1272 static bool i8042_pnp_kbd_registered;
1273 static unsigned int i8042_pnp_kbd_devices;
1274 static bool i8042_pnp_aux_registered;
1275 static unsigned int i8042_pnp_aux_devices;
1276 
1277 static int i8042_pnp_command_reg;
1278 static int i8042_pnp_data_reg;
1279 static int i8042_pnp_kbd_irq;
1280 static int i8042_pnp_aux_irq;
1281 
1282 static char i8042_pnp_kbd_name[32];
1283 static char i8042_pnp_aux_name[32];
1284 
i8042_pnp_id_to_string(struct pnp_id * id,char * dst,int dst_size)1285 static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
1286 {
1287 	strlcpy(dst, "PNP:", dst_size);
1288 
1289 	while (id) {
1290 		strlcat(dst, " ", dst_size);
1291 		strlcat(dst, id->id, dst_size);
1292 		id = id->next;
1293 	}
1294 }
1295 
i8042_pnp_kbd_probe(struct pnp_dev * dev,const struct pnp_device_id * did)1296 static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1297 {
1298 	if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1299 		i8042_pnp_data_reg = pnp_port_start(dev,0);
1300 
1301 	if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1302 		i8042_pnp_command_reg = pnp_port_start(dev, 1);
1303 
1304 	if (pnp_irq_valid(dev,0))
1305 		i8042_pnp_kbd_irq = pnp_irq(dev, 0);
1306 
1307 	strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
1308 	if (strlen(pnp_dev_name(dev))) {
1309 		strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
1310 		strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
1311 	}
1312 	i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
1313 			       sizeof(i8042_kbd_firmware_id));
1314 	i8042_kbd_fwnode = dev_fwnode(&dev->dev);
1315 
1316 	/* Keyboard ports are always supposed to be wakeup-enabled */
1317 	device_set_wakeup_enable(&dev->dev, true);
1318 
1319 	i8042_pnp_kbd_devices++;
1320 	return 0;
1321 }
1322 
i8042_pnp_aux_probe(struct pnp_dev * dev,const struct pnp_device_id * did)1323 static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
1324 {
1325 	if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
1326 		i8042_pnp_data_reg = pnp_port_start(dev,0);
1327 
1328 	if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
1329 		i8042_pnp_command_reg = pnp_port_start(dev, 1);
1330 
1331 	if (pnp_irq_valid(dev, 0))
1332 		i8042_pnp_aux_irq = pnp_irq(dev, 0);
1333 
1334 	strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
1335 	if (strlen(pnp_dev_name(dev))) {
1336 		strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
1337 		strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
1338 	}
1339 	i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
1340 			       sizeof(i8042_aux_firmware_id));
1341 
1342 	i8042_pnp_aux_devices++;
1343 	return 0;
1344 }
1345 
1346 static const struct pnp_device_id pnp_kbd_devids[] = {
1347 	{ .id = "PNP0300", .driver_data = 0 },
1348 	{ .id = "PNP0301", .driver_data = 0 },
1349 	{ .id = "PNP0302", .driver_data = 0 },
1350 	{ .id = "PNP0303", .driver_data = 0 },
1351 	{ .id = "PNP0304", .driver_data = 0 },
1352 	{ .id = "PNP0305", .driver_data = 0 },
1353 	{ .id = "PNP0306", .driver_data = 0 },
1354 	{ .id = "PNP0309", .driver_data = 0 },
1355 	{ .id = "PNP030a", .driver_data = 0 },
1356 	{ .id = "PNP030b", .driver_data = 0 },
1357 	{ .id = "PNP0320", .driver_data = 0 },
1358 	{ .id = "PNP0343", .driver_data = 0 },
1359 	{ .id = "PNP0344", .driver_data = 0 },
1360 	{ .id = "PNP0345", .driver_data = 0 },
1361 	{ .id = "CPQA0D7", .driver_data = 0 },
1362 	{ .id = "", },
1363 };
1364 MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
1365 
1366 static struct pnp_driver i8042_pnp_kbd_driver = {
1367 	.name           = "i8042 kbd",
1368 	.id_table       = pnp_kbd_devids,
1369 	.probe          = i8042_pnp_kbd_probe,
1370 	.driver         = {
1371 		.probe_type = PROBE_FORCE_SYNCHRONOUS,
1372 		.suppress_bind_attrs = true,
1373 	},
1374 };
1375 
1376 static const struct pnp_device_id pnp_aux_devids[] = {
1377 	{ .id = "AUI0200", .driver_data = 0 },
1378 	{ .id = "FJC6000", .driver_data = 0 },
1379 	{ .id = "FJC6001", .driver_data = 0 },
1380 	{ .id = "PNP0f03", .driver_data = 0 },
1381 	{ .id = "PNP0f0b", .driver_data = 0 },
1382 	{ .id = "PNP0f0e", .driver_data = 0 },
1383 	{ .id = "PNP0f12", .driver_data = 0 },
1384 	{ .id = "PNP0f13", .driver_data = 0 },
1385 	{ .id = "PNP0f19", .driver_data = 0 },
1386 	{ .id = "PNP0f1c", .driver_data = 0 },
1387 	{ .id = "SYN0801", .driver_data = 0 },
1388 	{ .id = "", },
1389 };
1390 MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
1391 
1392 static struct pnp_driver i8042_pnp_aux_driver = {
1393 	.name           = "i8042 aux",
1394 	.id_table       = pnp_aux_devids,
1395 	.probe          = i8042_pnp_aux_probe,
1396 	.driver         = {
1397 		.probe_type = PROBE_FORCE_SYNCHRONOUS,
1398 		.suppress_bind_attrs = true,
1399 	},
1400 };
1401 
i8042_pnp_exit(void)1402 static void i8042_pnp_exit(void)
1403 {
1404 	if (i8042_pnp_kbd_registered) {
1405 		i8042_pnp_kbd_registered = false;
1406 		pnp_unregister_driver(&i8042_pnp_kbd_driver);
1407 	}
1408 
1409 	if (i8042_pnp_aux_registered) {
1410 		i8042_pnp_aux_registered = false;
1411 		pnp_unregister_driver(&i8042_pnp_aux_driver);
1412 	}
1413 }
1414 
i8042_pnp_init(void)1415 static int __init i8042_pnp_init(void)
1416 {
1417 	char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
1418 	bool pnp_data_busted = false;
1419 	int err;
1420 
1421 	if (i8042_nopnp) {
1422 		pr_info("PNP detection disabled\n");
1423 		return 0;
1424 	}
1425 
1426 	err = pnp_register_driver(&i8042_pnp_kbd_driver);
1427 	if (!err)
1428 		i8042_pnp_kbd_registered = true;
1429 
1430 	err = pnp_register_driver(&i8042_pnp_aux_driver);
1431 	if (!err)
1432 		i8042_pnp_aux_registered = true;
1433 
1434 	if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
1435 		i8042_pnp_exit();
1436 #if defined(__ia64__)
1437 		return -ENODEV;
1438 #else
1439 		pr_info("PNP: No PS/2 controller found.\n");
1440 		if (x86_platform.legacy.i8042 !=
1441 				X86_LEGACY_I8042_EXPECTED_PRESENT)
1442 			return -ENODEV;
1443 		pr_info("Probing ports directly.\n");
1444 		return 0;
1445 #endif
1446 	}
1447 
1448 	if (i8042_pnp_kbd_devices)
1449 		snprintf(kbd_irq_str, sizeof(kbd_irq_str),
1450 			"%d", i8042_pnp_kbd_irq);
1451 	if (i8042_pnp_aux_devices)
1452 		snprintf(aux_irq_str, sizeof(aux_irq_str),
1453 			"%d", i8042_pnp_aux_irq);
1454 
1455 	pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
1456 		i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1457 		i8042_pnp_aux_name,
1458 		i8042_pnp_data_reg, i8042_pnp_command_reg,
1459 		kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
1460 		aux_irq_str);
1461 
1462 #if defined(__ia64__)
1463 	if (!i8042_pnp_kbd_devices)
1464 		i8042_nokbd = true;
1465 	if (!i8042_pnp_aux_devices)
1466 		i8042_noaux = true;
1467 #endif
1468 
1469 	if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
1470 	      i8042_pnp_data_reg != i8042_data_reg) ||
1471 	    !i8042_pnp_data_reg) {
1472 		pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
1473 			i8042_pnp_data_reg, i8042_data_reg);
1474 		i8042_pnp_data_reg = i8042_data_reg;
1475 		pnp_data_busted = true;
1476 	}
1477 
1478 	if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
1479 	      i8042_pnp_command_reg != i8042_command_reg) ||
1480 	    !i8042_pnp_command_reg) {
1481 		pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
1482 			i8042_pnp_command_reg, i8042_command_reg);
1483 		i8042_pnp_command_reg = i8042_command_reg;
1484 		pnp_data_busted = true;
1485 	}
1486 
1487 	if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
1488 		pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
1489 			i8042_kbd_irq);
1490 		i8042_pnp_kbd_irq = i8042_kbd_irq;
1491 		pnp_data_busted = true;
1492 	}
1493 
1494 	if (!i8042_noaux && !i8042_pnp_aux_irq) {
1495 		if (!pnp_data_busted && i8042_pnp_kbd_irq) {
1496 			pr_warn("PNP: PS/2 appears to have AUX port disabled, "
1497 				"if this is incorrect please boot with i8042.nopnp\n");
1498 			i8042_noaux = true;
1499 		} else {
1500 			pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
1501 				i8042_aux_irq);
1502 			i8042_pnp_aux_irq = i8042_aux_irq;
1503 		}
1504 	}
1505 
1506 	i8042_data_reg = i8042_pnp_data_reg;
1507 	i8042_command_reg = i8042_pnp_command_reg;
1508 	i8042_kbd_irq = i8042_pnp_kbd_irq;
1509 	i8042_aux_irq = i8042_pnp_aux_irq;
1510 
1511 #ifdef CONFIG_X86
1512 	i8042_bypass_aux_irq_test = !pnp_data_busted &&
1513 				    dmi_check_system(i8042_dmi_laptop_table);
1514 #endif
1515 
1516 	return 0;
1517 }
1518 
1519 #else  /* !CONFIG_PNP */
i8042_pnp_init(void)1520 static inline int i8042_pnp_init(void) { return 0; }
i8042_pnp_exit(void)1521 static inline void i8042_pnp_exit(void) { }
1522 #endif /* CONFIG_PNP */
1523 
1524 
1525 #ifdef CONFIG_X86
i8042_check_quirks(void)1526 static void __init i8042_check_quirks(void)
1527 {
1528 	const struct dmi_system_id *device_quirk_info;
1529 	uintptr_t quirks;
1530 
1531 	device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
1532 	if (!device_quirk_info)
1533 		return;
1534 
1535 	quirks = (uintptr_t)device_quirk_info->driver_data;
1536 
1537 	if (quirks & SERIO_QUIRK_NOKBD)
1538 		i8042_nokbd = true;
1539 	if (quirks & SERIO_QUIRK_NOAUX)
1540 		i8042_noaux = true;
1541 	if (quirks & SERIO_QUIRK_NOMUX)
1542 		i8042_nomux = true;
1543 	if (quirks & SERIO_QUIRK_FORCEMUX)
1544 		i8042_nomux = false;
1545 	if (quirks & SERIO_QUIRK_UNLOCK)
1546 		i8042_unlock = true;
1547 	if (quirks & SERIO_QUIRK_PROBE_DEFER)
1548 		i8042_probe_defer = true;
1549 	/* Honor module parameter when value is not default */
1550 	if (i8042_reset == I8042_RESET_DEFAULT) {
1551 		if (quirks & SERIO_QUIRK_RESET_ALWAYS)
1552 			i8042_reset = I8042_RESET_ALWAYS;
1553 		if (quirks & SERIO_QUIRK_RESET_NEVER)
1554 			i8042_reset = I8042_RESET_NEVER;
1555 	}
1556 	if (quirks & SERIO_QUIRK_DIECT)
1557 		i8042_direct = true;
1558 	if (quirks & SERIO_QUIRK_DUMBKBD)
1559 		i8042_dumbkbd = true;
1560 	if (quirks & SERIO_QUIRK_NOLOOP)
1561 		i8042_noloop = true;
1562 	if (quirks & SERIO_QUIRK_NOTIMEOUT)
1563 		i8042_notimeout = true;
1564 	if (quirks & SERIO_QUIRK_KBDRESET)
1565 		i8042_kbdreset = true;
1566 	if (quirks & SERIO_QUIRK_DRITEK)
1567 		i8042_dritek = true;
1568 #ifdef CONFIG_PNP
1569 	if (quirks & SERIO_QUIRK_NOPNP)
1570 		i8042_nopnp = true;
1571 #endif
1572 }
1573 #else
i8042_check_quirks(void)1574 static inline void i8042_check_quirks(void) {}
1575 #endif
1576 
i8042_platform_init(void)1577 static int __init i8042_platform_init(void)
1578 {
1579 	int retval;
1580 
1581 #ifdef CONFIG_X86
1582 	u8 a20_on = 0xdf;
1583 	/* Just return if platform does not have i8042 controller */
1584 	if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
1585 		return -ENODEV;
1586 #endif
1587 
1588 /*
1589  * On ix86 platforms touching the i8042 data register region can do really
1590  * bad things. Because of this the region is always reserved on ix86 boxes.
1591  *
1592  *	if (!request_region(I8042_DATA_REG, 16, "i8042"))
1593  *		return -EBUSY;
1594  */
1595 
1596 	i8042_kbd_irq = I8042_MAP_IRQ(1);
1597 	i8042_aux_irq = I8042_MAP_IRQ(12);
1598 
1599 #if defined(__ia64__)
1600 	i8042_reset = I8042_RESET_ALWAYS;
1601 #endif
1602 
1603 	i8042_check_quirks();
1604 
1605 	retval = i8042_pnp_init();
1606 	if (retval)
1607 		return retval;
1608 
1609 #ifdef CONFIG_X86
1610 	/*
1611 	 * A20 was already enabled during early kernel init. But some buggy
1612 	 * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
1613 	 * resume from S3. So we do it here and hope that nothing breaks.
1614 	 */
1615 	i8042_command(&a20_on, 0x10d1);
1616 	i8042_command(NULL, 0x00ff);	/* Null command for SMM firmware */
1617 #endif /* CONFIG_X86 */
1618 
1619 	return retval;
1620 }
1621 
i8042_platform_exit(void)1622 static inline void i8042_platform_exit(void)
1623 {
1624 	i8042_pnp_exit();
1625 }
1626 
1627 #endif /* _I8042_ACPIPNPIO_H */
1628