blob: ead0494721d0a7ae7578ec753c6aa4faa09e74d3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _I8042_X86IA64IO_H
2#define _I8042_X86IA64IO_H
3
4/*
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 */
9
10/*
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
31static int i8042_kbd_irq;
32static 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
42static int i8042_command_reg = 0x64;
43static int i8042_data_reg = 0x60;
44
45
46static inline int i8042_read_data(void)
47{
48 return inb(I8042_DATA_REG);
49}
50
51static inline int i8042_read_status(void)
52{
53 return inb(I8042_STATUS_REG);
54}
55
56static inline void i8042_write_data(int val)
57{
58 outb(val, I8042_DATA_REG);
59}
60
61static inline void i8042_write_command(int val)
62{
63 outb(val, I8042_COMMAND_REG);
64}
65
Jiri Kosinac3a34f42008-05-28 01:10:52 -040066#ifdef CONFIG_X86
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68#include <linux/dmi.h>
69
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -080070static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -080072 /*
73 * Arima-Rioworks HDAMB -
74 * AUX LOOP command does not raise AUX IRQ
75 */
Dmitry Torokhov87d91732008-07-19 00:35:43 -040076 .matches = {
77 DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
78 DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
79 DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
80 },
81 },
82 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -080083 /* ASUS G1S */
Jory A. Pratt685aaca2009-08-03 09:32:34 -070084 .matches = {
85 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
86 DMI_MATCH(DMI_BOARD_NAME, "G1S"),
87 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
88 },
89 },
90 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -080091 /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
Dmitry Torokhov90245c12007-06-12 00:33:27 -040092 .matches = {
93 DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
94 DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
95 DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
96 },
97 },
98 {
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 .matches = {
100 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
101 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
102 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
103 },
104 },
105 {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 .matches = {
107 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
108 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
109 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
110 },
111 },
Ben Collins6020baf2006-01-05 23:00:38 -0500112 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800113 /* OQO Model 01 */
Ben Collins6020baf2006-01-05 23:00:38 -0500114 .matches = {
115 DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
116 DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
117 DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
118 },
119 },
Dmitry Torokhov8c4df742007-06-12 00:33:32 -0400120 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800121 /* ULI EV4873 - AUX LOOP does not work properly */
Dmitry Torokhov8c4df742007-06-12 00:33:32 -0400122 .matches = {
123 DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
124 DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
125 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
126 },
127 },
Jiri Kosina8bf42152007-11-21 14:17:38 -0500128 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800129 /* Microsoft Virtual Machine */
Jiri Kosina8bf42152007-11-21 14:17:38 -0500130 .matches = {
131 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
132 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
133 DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
134 },
135 },
Dmitry Torokhov89cdb8c2008-07-03 11:00:28 -0400136 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800137 /* Medion MAM 2070 */
Dmitry Torokhov89cdb8c2008-07-03 11:00:28 -0400138 .matches = {
139 DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
140 DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
141 DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
142 },
143 },
Stefan Bader2c6f2cb2008-10-16 22:00:56 -0400144 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800145 /* Blue FB5601 */
Stefan Bader2c6f2cb2008-10-16 22:00:56 -0400146 .matches = {
147 DMI_MATCH(DMI_SYS_VENDOR, "blue"),
148 DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
149 DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
150 },
151 },
Ozan Çağlayana6f66dd2008-12-20 04:04:51 -0500152 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800153 /* Gigabyte M912 */
Ozan Çağlayana6f66dd2008-12-20 04:04:51 -0500154 .matches = {
155 DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
156 DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
157 DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
158 },
159 },
Dmitry Torokhov59cc1dd2009-04-07 23:53:26 -0700160 {
Dmitry Torokhova61cd032009-12-13 00:34:06 -0800161 /* Gigabyte M1022M netbook */
162 .matches = {
163 DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
164 DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
165 DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
166 },
167 },
168 {
Dmitry Torokhov59cc1dd2009-04-07 23:53:26 -0700169 .matches = {
170 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
171 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
172 DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
173 },
174 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 { }
176};
177
178/*
Dmitry Torokhov59311de2005-05-28 02:12:05 -0500179 * Some Fujitsu notebooks are having trouble with touchpads if
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 * active multiplexing mode is activated. Luckily they don't have
181 * external PS/2 ports so we can safely disable it.
Dmitry Torokhov59311de2005-05-28 02:12:05 -0500182 * ... apparently some Toshibas don't like MUX mode either and
183 * die horrible death on reboot.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184 */
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800185static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800187 /* Fujitsu Lifebook P7010/P7010D */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 .matches = {
189 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
190 DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
191 },
192 },
193 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800194 /* Fujitsu Lifebook P7010 */
Dmitry Torokhovbb06ec3c2006-12-08 01:36:32 -0500195 .matches = {
196 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
197 DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
198 },
199 },
200 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800201 /* Fujitsu Lifebook P5020D */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 .matches = {
203 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
204 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
205 },
206 },
207 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800208 /* Fujitsu Lifebook S2000 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 .matches = {
210 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
211 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
212 },
213 },
214 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800215 /* Fujitsu Lifebook S6230 */
Dmitry Torokhovb4ff99b2005-05-28 02:12:10 -0500216 .matches = {
217 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
218 DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
219 },
220 },
221 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800222 /* Fujitsu T70H */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700223 .matches = {
224 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
225 DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
226 },
227 },
Dmitry Torokhov59311de2005-05-28 02:12:05 -0500228 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800229 /* Fujitsu-Siemens Lifebook T3010 */
Vojtech Pavlik20f07942005-07-11 01:06:28 -0500230 .matches = {
231 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
232 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
233 },
234 },
235 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800236 /* Fujitsu-Siemens Lifebook E4010 */
Dmitry Torokhov7545c242005-09-04 01:42:10 -0500237 .matches = {
238 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
239 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
240 },
241 },
242 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800243 /* Fujitsu-Siemens Amilo Pro 2010 */
Jiri Kosina3f79b1e2008-01-30 16:34:52 -0500244 .matches = {
245 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
246 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
247 },
248 },
249 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800250 /* Fujitsu-Siemens Amilo Pro 2030 */
Jiri Kosinaefd51842008-06-06 00:56:43 -0400251 .matches = {
252 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
253 DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
254 },
255 },
256 {
Dmitry Torokhov6e782582007-03-16 00:59:42 -0400257 /*
Dmitry Torokhovcc8310e2007-04-25 00:40:32 -0400258 * No data is coming from the touchscreen unless KBC
259 * is in legacy mode.
260 */
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800261 /* Panasonic CF-29 */
Dmitry Torokhovcc8310e2007-04-25 00:40:32 -0400262 .matches = {
263 DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
264 DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
265 },
266 },
267 {
268 /*
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800269 * HP Pavilion DV4017EA -
270 * errors on MUX ports are reported without raising AUXDATA
Dmitry Torokhov6e782582007-03-16 00:59:42 -0400271 * causing "spurious NAK" messages.
272 */
Dmitry Torokhov6e782582007-03-16 00:59:42 -0400273 .matches = {
274 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
275 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
276 },
277 },
278 {
Dmitry Torokhov9d9d50b2007-06-28 00:44:27 -0400279 /*
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800280 * HP Pavilion ZT1000 -
281 * like DV4017EA does not raise AUXERR for errors on MUX ports.
Dmitry Torokhov9d9d50b2007-06-28 00:44:27 -0400282 */
Dmitry Torokhov9d9d50b2007-06-28 00:44:27 -0400283 .matches = {
284 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
285 DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
286 DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
287 },
288 },
289 {
Elvis Pranskevichus749aea72007-09-04 23:18:21 -0400290 /*
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800291 * HP Pavilion DV4270ca -
292 * like DV4017EA does not raise AUXERR for errors on MUX ports.
Elvis Pranskevichus749aea72007-09-04 23:18:21 -0400293 */
Elvis Pranskevichus749aea72007-09-04 23:18:21 -0400294 .matches = {
295 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
296 DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
297 },
298 },
299 {
Dmitry Torokhov59311de2005-05-28 02:12:05 -0500300 .matches = {
301 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
302 DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
303 },
304 },
Dmitry Torokhov865190c2005-07-11 01:06:06 -0500305 {
Dmitry Torokhova91eaa12006-09-14 01:31:06 -0400306 .matches = {
307 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
308 DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
309 },
310 },
311 {
Dmitry Torokhov865190c2005-07-11 01:06:06 -0500312 .matches = {
313 DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
314 DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
315 },
316 },
Dmitry Torokhov4eb38ac2005-12-21 00:51:51 -0500317 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800318 /* Sharp Actius MM20 */
Dmitry Torokhov4eb38ac2005-12-21 00:51:51 -0500319 .matches = {
320 DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
321 DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
322 },
323 },
Vojtech Pavlik3dd01a82006-01-14 00:24:06 -0500324 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800325 /* Sony Vaio FS-115b */
Vojtech Pavlik3dd01a82006-01-14 00:24:06 -0500326 .matches = {
327 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
328 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
329 },
330 },
Cjacker Huange2df4522006-08-08 23:38:22 -0400331 {
Dmitry Torokhovb0225e82009-10-15 09:46:48 -0700332 /*
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800333 * Sony Vaio FZ-240E -
334 * reset and GET ID commands issued via KBD port are
Dmitry Torokhovb0225e82009-10-15 09:46:48 -0700335 * sometimes being delivered to AUX3.
336 */
Dmitry Torokhovb0225e82009-10-15 09:46:48 -0700337 .matches = {
338 DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
339 DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
340 },
341 },
342 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800343 /* Amoi M636/A737 */
Cjacker Huange2df4522006-08-08 23:38:22 -0400344 .matches = {
345 DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
346 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
347 },
348 },
Jiri Kosina2a2dcd62008-03-10 03:08:54 -0700349 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800350 /* Lenovo 3000 n100 */
Jiri Kosina2a2dcd62008-03-10 03:08:54 -0700351 .matches = {
352 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Jiri Kosina9ce1ca22008-09-04 22:28:48 -0400353 DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
Jiri Kosina2a2dcd62008-03-10 03:08:54 -0700354 },
355 },
Jiri Kosina0376bce2008-07-03 10:45:38 -0400356 {
Jiri Kosina0376bce2008-07-03 10:45:38 -0400357 .matches = {
358 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
359 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
360 },
361 },
Jiri Kosina5b5b43d2008-07-03 11:00:28 -0400362 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800363 /* Gericom Bellagio */
Jiri Kosina5b5b43d2008-07-03 11:00:28 -0400364 .matches = {
365 DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
366 DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
367 },
368 },
Colin B Macdonald5bd8a052008-10-11 18:16:38 -0400369 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800370 /* IBM 2656 */
Colin B Macdonald5bd8a052008-10-11 18:16:38 -0400371 .matches = {
372 DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
373 DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
374 },
375 },
Herton Ronaldo Krzesinski786b11c2008-11-11 09:37:14 -0500376 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800377 /* Dell XPS M1530 */
Herton Ronaldo Krzesinski786b11c2008-11-11 09:37:14 -0500378 .matches = {
379 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
380 DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
381 },
382 },
Dmitry Torokhov5f4ba042008-11-14 13:32:42 -0500383 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800384 /* Compal HEL80I */
Dmitry Torokhov5f4ba042008-11-14 13:32:42 -0500385 .matches = {
386 DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
387 DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
388 },
389 },
Jiri Kosina9334e902009-01-06 01:35:45 -0800390 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800391 /* Dell Vostro 1510 */
Jiri Kosina9334e902009-01-06 01:35:45 -0800392 .matches = {
393 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
394 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
395 },
396 },
Dmitry Torokhovced909f2009-08-25 19:24:10 -0700397 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800398 /* Acer Aspire 5536 */
Dmitry Torokhovced909f2009-08-25 19:24:10 -0700399 .matches = {
400 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
401 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
402 DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
403 },
404 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700405 { }
406};
407
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800408static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700409 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800410 /* MSI Wind U-100 */
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700411 .matches = {
412 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
413 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
414 },
415 },
416 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800417 /* LG Electronics X110 */
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700418 .matches = {
419 DMI_MATCH(DMI_BOARD_NAME, "X110"),
420 DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
421 },
422 },
Yan Li9230ccb2009-06-28 22:30:56 -0700423 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800424 /* Acer Aspire One 150 */
Yan Li9230ccb2009-06-28 22:30:56 -0700425 .matches = {
426 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
427 DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
428 },
429 },
430 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800431 /* Advent 4211 */
Yan Li9230ccb2009-06-28 22:30:56 -0700432 .matches = {
433 DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
434 DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
435 },
436 },
437 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800438 /* Medion Akoya Mini E1210 */
Yan Li9230ccb2009-06-28 22:30:56 -0700439 .matches = {
440 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
441 DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
442 },
443 },
444 {
Christoph Fritz31968ec2010-03-13 22:26:23 -0800445 /* Medion Akoya E1222 */
446 .matches = {
447 DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
448 DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
449 },
450 },
451 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800452 /* Mivvy M310 */
Yan Li9230ccb2009-06-28 22:30:56 -0700453 .matches = {
454 DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
455 DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
456 },
457 },
Anisse Astier049e2d12009-12-01 01:14:25 -0800458 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800459 /* Dell Vostro 1320 */
Anisse Astier049e2d12009-12-01 01:14:25 -0800460 .matches = {
461 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
462 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
463 },
464 },
465 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800466 /* Dell Vostro 1520 */
Anisse Astier049e2d12009-12-01 01:14:25 -0800467 .matches = {
468 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
469 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
470 },
471 },
472 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800473 /* Dell Vostro 1720 */
Anisse Astier049e2d12009-12-01 01:14:25 -0800474 .matches = {
475 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
476 DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
477 },
478 },
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700479 { }
480};
481
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400482#ifdef CONFIG_PNP
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800483static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400484 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800485 /* Intel MBO Desktop D845PESV */
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400486 .matches = {
487 DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
488 DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
489 },
490 },
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700491 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800492 /* MSI Wind U-100 */
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700493 .matches = {
494 DMI_MATCH(DMI_BOARD_NAME, "U-100"),
495 DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
496 },
497 },
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400498 { }
499};
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700500
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800501static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700502 {
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700503 .matches = {
504 DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
505 },
506 },
507 {
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700508 .matches = {
509 DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
510 },
511 },
512 {
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700513 .matches = {
514 DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
515 },
516 },
517 {
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700518 .matches = {
519 DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
520 },
521 },
522 { }
523};
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524#endif
525
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500526/*
527 * Some Wistron based laptops need us to explicitly enable the 'Dritek
528 * keyboard extension' to make their extra keys start generating scancodes.
529 * Originally, this was just confined to older laptops, but a few Acer laptops
530 * have turned up in 2007 that also need this again.
531 */
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800532static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500533 {
Elliott Sales de Andradee6edbdc2010-01-10 23:59:05 -0800534 /* Acer Aspire 5610 */
535 .matches = {
536 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
537 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
538 },
539 },
540 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800541 /* Acer Aspire 5630 */
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500542 .matches = {
543 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
544 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
545 },
546 },
547 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800548 /* Acer Aspire 5650 */
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500549 .matches = {
550 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
551 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
552 },
553 },
554 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800555 /* Acer Aspire 5680 */
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500556 .matches = {
557 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
558 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
559 },
560 },
561 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800562 /* Acer Aspire 5720 */
Carlos Corbacho0e7e92f2008-07-07 08:55:31 -0400563 .matches = {
564 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
565 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
566 },
567 },
568 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800569 /* Acer Aspire 9110 */
Carlos Corbacho5799ddb2008-01-30 16:34:12 -0500570 .matches = {
571 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
572 DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
573 },
574 },
575 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800576 /* Acer TravelMate 660 */
Bruno Prémont65e660a2008-05-20 13:47:28 -0400577 .matches = {
578 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
579 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
580 },
581 },
582 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800583 /* Acer TravelMate 2490 */
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500584 .matches = {
585 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
586 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
587 },
588 },
Carlos Corbacho8e4ae102008-08-06 14:28:43 -0400589 {
Dmitry Torokhovf909b1d2009-12-04 10:24:19 -0800590 /* Acer TravelMate 4280 */
Carlos Corbacho8e4ae102008-08-06 14:28:43 -0400591 .matches = {
592 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
593 DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
594 },
595 },
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500596 { }
597};
598
599#endif /* CONFIG_X86 */
600
Linus Torvalds1da177e2005-04-16 15:20:36 -0700601#ifdef CONFIG_PNP
602#include <linux/pnp.h>
603
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700604static bool i8042_pnp_kbd_registered;
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500605static unsigned int i8042_pnp_kbd_devices;
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700606static bool i8042_pnp_aux_registered;
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500607static unsigned int i8042_pnp_aux_devices;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700608
609static int i8042_pnp_command_reg;
610static int i8042_pnp_data_reg;
611static int i8042_pnp_kbd_irq;
612static int i8042_pnp_aux_irq;
613
614static char i8042_pnp_kbd_name[32];
615static char i8042_pnp_aux_name[32];
616
617static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
618{
619 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
620 i8042_pnp_data_reg = pnp_port_start(dev,0);
621
622 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
623 i8042_pnp_command_reg = pnp_port_start(dev, 1);
624
625 if (pnp_irq_valid(dev,0))
626 i8042_pnp_kbd_irq = pnp_irq(dev, 0);
627
Roel Kluin8c6deb92008-04-18 00:25:18 -0400628 strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 if (strlen(pnp_dev_name(dev))) {
Roel Kluin8c6deb92008-04-18 00:25:18 -0400630 strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
631 strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700632 }
633
Alan Stern3e6e15a2010-03-08 23:42:46 -0800634 /* Keyboard ports are always supposed to be wakeup-enabled */
635 device_set_wakeup_enable(&dev->dev, true);
636
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500637 i8042_pnp_kbd_devices++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 return 0;
639}
640
641static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
642{
643 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
644 i8042_pnp_data_reg = pnp_port_start(dev,0);
645
646 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
647 i8042_pnp_command_reg = pnp_port_start(dev, 1);
648
649 if (pnp_irq_valid(dev, 0))
650 i8042_pnp_aux_irq = pnp_irq(dev, 0);
651
Roel Kluin8c6deb92008-04-18 00:25:18 -0400652 strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700653 if (strlen(pnp_dev_name(dev))) {
Roel Kluin8c6deb92008-04-18 00:25:18 -0400654 strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
655 strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 }
657
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500658 i8042_pnp_aux_devices++;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659 return 0;
660}
661
662static struct pnp_device_id pnp_kbd_devids[] = {
663 { .id = "PNP0303", .driver_data = 0 },
664 { .id = "PNP030b", .driver_data = 0 },
665 { .id = "", },
666};
667
668static struct pnp_driver i8042_pnp_kbd_driver = {
669 .name = "i8042 kbd",
670 .id_table = pnp_kbd_devids,
671 .probe = i8042_pnp_kbd_probe,
672};
673
674static struct pnp_device_id pnp_aux_devids[] = {
Dmitry Torokhovb9973952007-04-25 00:40:53 -0400675 { .id = "FJC6000", .driver_data = 0 },
676 { .id = "FJC6001", .driver_data = 0 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677 { .id = "PNP0f03", .driver_data = 0 },
678 { .id = "PNP0f0b", .driver_data = 0 },
679 { .id = "PNP0f0e", .driver_data = 0 },
680 { .id = "PNP0f12", .driver_data = 0 },
681 { .id = "PNP0f13", .driver_data = 0 },
682 { .id = "PNP0f19", .driver_data = 0 },
683 { .id = "PNP0f1c", .driver_data = 0 },
684 { .id = "SYN0801", .driver_data = 0 },
685 { .id = "", },
686};
687
688static struct pnp_driver i8042_pnp_aux_driver = {
689 .name = "i8042 aux",
690 .id_table = pnp_aux_devids,
691 .probe = i8042_pnp_aux_probe,
692};
693
694static void i8042_pnp_exit(void)
695{
Kurt Garloff74af42b2005-05-28 02:11:38 -0500696 if (i8042_pnp_kbd_registered) {
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700697 i8042_pnp_kbd_registered = false;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698 pnp_unregister_driver(&i8042_pnp_kbd_driver);
Kurt Garloff74af42b2005-05-28 02:11:38 -0500699 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700
Kurt Garloff74af42b2005-05-28 02:11:38 -0500701 if (i8042_pnp_aux_registered) {
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700702 i8042_pnp_aux_registered = false;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700703 pnp_unregister_driver(&i8042_pnp_aux_driver);
Kurt Garloff74af42b2005-05-28 02:11:38 -0500704 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700705}
706
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500707static int __init i8042_pnp_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700708{
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500709 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
Dmitry Torokhov7dcc9c22009-10-12 21:34:25 -0700710 bool pnp_data_busted = false;
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500711 int err;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400713#ifdef CONFIG_X86
714 if (dmi_check_system(i8042_dmi_nopnp_table))
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700715 i8042_nopnp = true;
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400716#endif
717
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718 if (i8042_nopnp) {
Vojtech Pavlik39fa5802005-05-28 02:11:16 -0500719 printk(KERN_INFO "i8042: PNP detection disabled\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 return 0;
721 }
722
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500723 err = pnp_register_driver(&i8042_pnp_kbd_driver);
724 if (!err)
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700725 i8042_pnp_kbd_registered = true;
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500726
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500727 err = pnp_register_driver(&i8042_pnp_aux_driver);
728 if (!err)
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700729 i8042_pnp_aux_registered = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500731 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700732 i8042_pnp_exit();
733#if defined(__ia64__)
734 return -ENODEV;
735#else
Dmitry Torokhov5a72afc2005-05-28 02:11:32 -0500736 printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737 return 0;
738#endif
739 }
740
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500741 if (i8042_pnp_kbd_devices)
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500742 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
743 "%d", i8042_pnp_kbd_irq);
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500744 if (i8042_pnp_aux_devices)
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500745 snprintf(aux_irq_str, sizeof(aux_irq_str),
746 "%d", i8042_pnp_aux_irq);
747
748 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500749 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500750 i8042_pnp_aux_name,
751 i8042_pnp_data_reg, i8042_pnp_command_reg,
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500752 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500753 aux_irq_str);
754
755#if defined(__ia64__)
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500756 if (!i8042_pnp_kbd_devices)
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700757 i8042_nokbd = true;
Bjorn Helgaas2bfc3c62006-03-14 00:12:24 -0500758 if (!i8042_pnp_aux_devices)
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700759 i8042_noaux = true;
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500760#endif
761
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
Dmitry Torokhov080c6522007-07-18 00:38:01 -0400763 i8042_pnp_data_reg != i8042_data_reg) ||
764 !i8042_pnp_data_reg) {
765 printk(KERN_WARNING
766 "PNP: PS/2 controller has invalid data port %#x; "
767 "using default %#x\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768 i8042_pnp_data_reg, i8042_data_reg);
769 i8042_pnp_data_reg = i8042_data_reg;
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700770 pnp_data_busted = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 }
772
773 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
Dmitry Torokhov080c6522007-07-18 00:38:01 -0400774 i8042_pnp_command_reg != i8042_command_reg) ||
775 !i8042_pnp_command_reg) {
776 printk(KERN_WARNING
777 "PNP: PS/2 controller has invalid command port %#x; "
778 "using default %#x\n",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779 i8042_pnp_command_reg, i8042_command_reg);
780 i8042_pnp_command_reg = i8042_command_reg;
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700781 pnp_data_busted = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700782 }
783
Dmitry Torokhov945ef0d2005-09-04 01:42:00 -0500784 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
Dmitry Torokhov080c6522007-07-18 00:38:01 -0400785 printk(KERN_WARNING
786 "PNP: PS/2 controller doesn't have KBD irq; "
787 "using default %d\n", i8042_kbd_irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 i8042_pnp_kbd_irq = i8042_kbd_irq;
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700789 pnp_data_busted = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700790 }
791
Dmitry Torokhovc3d31e72005-09-04 01:41:51 -0500792 if (!i8042_noaux && !i8042_pnp_aux_irq) {
Dmitry Torokhov080c6522007-07-18 00:38:01 -0400793 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
794 printk(KERN_WARNING
795 "PNP: PS/2 appears to have AUX port disabled, "
796 "if this is incorrect please boot with "
797 "i8042.nopnp\n");
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700798 i8042_noaux = true;
Dmitry Torokhov080c6522007-07-18 00:38:01 -0400799 } else {
800 printk(KERN_WARNING
801 "PNP: PS/2 controller doesn't have AUX irq; "
802 "using default %d\n", i8042_aux_irq);
803 i8042_pnp_aux_irq = i8042_aux_irq;
804 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 }
806
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 i8042_data_reg = i8042_pnp_data_reg;
808 i8042_command_reg = i8042_pnp_command_reg;
809 i8042_kbd_irq = i8042_pnp_kbd_irq;
810 i8042_aux_irq = i8042_pnp_aux_irq;
811
Dmitry Torokhov1c7827a2009-09-03 21:45:34 -0700812#ifdef CONFIG_X86
813 i8042_bypass_aux_irq_test = !pnp_data_busted &&
814 dmi_check_system(i8042_dmi_laptop_table);
815#endif
816
Linus Torvalds1da177e2005-04-16 15:20:36 -0700817 return 0;
818}
819
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500820#else
821static inline int i8042_pnp_init(void) { return 0; }
822static inline void i8042_pnp_exit(void) { }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823#endif
824
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500825static int __init i8042_platform_init(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826{
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500827 int retval;
828
Linus Torvalds1da177e2005-04-16 15:20:36 -0700829/*
830 * On ix86 platforms touching the i8042 data register region can do really
831 * bad things. Because of this the region is always reserved on ix86 boxes.
832 *
833 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500834 * return -EBUSY;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835 */
836
837 i8042_kbd_irq = I8042_MAP_IRQ(1);
838 i8042_aux_irq = I8042_MAP_IRQ(12);
839
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500840 retval = i8042_pnp_init();
841 if (retval)
842 return retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843
844#if defined(__ia64__)
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700845 i8042_reset = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700846#endif
847
Jiri Kosinac3a34f42008-05-28 01:10:52 -0400848#ifdef CONFIG_X86
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700849 if (dmi_check_system(i8042_dmi_reset_table))
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700850 i8042_reset = true;
Arjan van de Ven7c46e232009-04-11 16:50:13 -0700851
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852 if (dmi_check_system(i8042_dmi_noloop_table))
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700853 i8042_noloop = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854
855 if (dmi_check_system(i8042_dmi_nomux_table))
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700856 i8042_nomux = true;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500858 if (dmi_check_system(i8042_dmi_dritek_table))
Dmitry Torokhov386b3842009-09-09 19:08:16 -0700859 i8042_dritek = true;
Carlos Corbacho8987fec2008-01-21 01:04:40 -0500860#endif /* CONFIG_X86 */
861
Dmitry Torokhov8d5987a2005-09-04 01:41:38 -0500862 return retval;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700863}
864
865static inline void i8042_platform_exit(void)
866{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700867 i8042_pnp_exit();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868}
869
870#endif /* _I8042_X86IA64IO_H */