1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
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"
23 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
25 # define I8042_MAP_IRQ(x) (x)
28 #define I8042_KBD_IRQ i8042_kbd_irq
29 #define I8042_AUX_IRQ i8042_aux_irq
31 static int i8042_kbd_irq
;
32 static int i8042_aux_irq
;
38 #define I8042_COMMAND_REG i8042_command_reg
39 #define I8042_STATUS_REG i8042_command_reg
40 #define I8042_DATA_REG i8042_data_reg
42 static int i8042_command_reg
= 0x64;
43 static int i8042_data_reg
= 0x60;
46 static inline int i8042_read_data(void)
48 return inb(I8042_DATA_REG
);
51 static inline int i8042_read_status(void)
53 return inb(I8042_STATUS_REG
);
56 static inline void i8042_write_data(int val
)
58 outb(val
, I8042_DATA_REG
);
61 static inline void i8042_write_command(int val
)
63 outb(val
, I8042_COMMAND_REG
);
68 #include <linux/dmi.h>
70 static struct dmi_system_id __initdata i8042_dmi_noloop_table
[] = {
72 /* AUX LOOP command does not raise AUX IRQ */
73 .ident
= "ASUS P65UP5",
75 DMI_MATCH(DMI_BOARD_VENDOR
, "ASUSTeK Computer INC."),
76 DMI_MATCH(DMI_BOARD_NAME
, "P/I-P65UP5"),
77 DMI_MATCH(DMI_BOARD_VERSION
, "REV 2.X"),
81 .ident
= "Compaq Proliant 8500",
83 DMI_MATCH(DMI_SYS_VENDOR
, "Compaq"),
84 DMI_MATCH(DMI_PRODUCT_NAME
, "ProLiant"),
85 DMI_MATCH(DMI_PRODUCT_VERSION
, "8500"),
89 .ident
= "Compaq Proliant DL760",
91 DMI_MATCH(DMI_SYS_VENDOR
, "Compaq"),
92 DMI_MATCH(DMI_PRODUCT_NAME
, "ProLiant"),
93 DMI_MATCH(DMI_PRODUCT_VERSION
, "DL760"),
97 .ident
= "OQO Model 01",
99 DMI_MATCH(DMI_SYS_VENDOR
, "OQO"),
100 DMI_MATCH(DMI_PRODUCT_NAME
, "ZEPTO"),
101 DMI_MATCH(DMI_PRODUCT_VERSION
, "00"),
105 /* AUX LOOP does not work properly */
106 .ident
= "ULI EV4873",
108 DMI_MATCH(DMI_SYS_VENDOR
, "ULI"),
109 DMI_MATCH(DMI_PRODUCT_NAME
, "EV4873"),
110 DMI_MATCH(DMI_PRODUCT_VERSION
, "5a"),
117 * Some Fujitsu notebooks are having trouble with touchpads if
118 * active multiplexing mode is activated. Luckily they don't have
119 * external PS/2 ports so we can safely disable it.
120 * ... apparently some Toshibas don't like MUX mode either and
121 * die horrible death on reboot.
123 static struct dmi_system_id __initdata i8042_dmi_nomux_table
[] = {
125 .ident
= "Fujitsu Lifebook P7010/P7010D",
127 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
128 DMI_MATCH(DMI_PRODUCT_NAME
, "P7010"),
132 .ident
= "Fujitsu Lifebook P7010",
134 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
135 DMI_MATCH(DMI_PRODUCT_NAME
, "0000000000"),
139 .ident
= "Fujitsu Lifebook P5020D",
141 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
142 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook P Series"),
146 .ident
= "Fujitsu Lifebook S2000",
148 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
149 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S Series"),
153 .ident
= "Fujitsu Lifebook S6230",
155 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
156 DMI_MATCH(DMI_PRODUCT_NAME
, "LifeBook S6230"),
160 .ident
= "Fujitsu T70H",
162 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU"),
163 DMI_MATCH(DMI_PRODUCT_NAME
, "FMVLT70H"),
167 .ident
= "Fujitsu-Siemens Lifebook T3010",
169 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
170 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK T3010"),
174 .ident
= "Fujitsu-Siemens Lifebook E4010",
176 DMI_MATCH(DMI_SYS_VENDOR
, "FUJITSU SIEMENS"),
177 DMI_MATCH(DMI_PRODUCT_NAME
, "LIFEBOOK E4010"),
182 * No data is coming from the touchscreen unless KBC
185 .ident
= "Panasonic CF-29",
187 DMI_MATCH(DMI_SYS_VENDOR
, "Matsushita"),
188 DMI_MATCH(DMI_PRODUCT_NAME
, "CF-29"),
193 * Errors on MUX ports are reported without raising AUXDATA
194 * causing "spurious NAK" messages.
196 .ident
= "HP Pavilion DV4017EA",
198 DMI_MATCH(DMI_SYS_VENDOR
, "Hewlett-Packard"),
199 DMI_MATCH(DMI_PRODUCT_NAME
, "Pavilion dv4000 (EA032EA#ABF)"),
203 .ident
= "Toshiba P10",
205 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
206 DMI_MATCH(DMI_PRODUCT_NAME
, "Satellite P10"),
210 .ident
= "Toshiba Equium A110",
212 DMI_MATCH(DMI_SYS_VENDOR
, "TOSHIBA"),
213 DMI_MATCH(DMI_PRODUCT_NAME
, "EQUIUM A110"),
217 .ident
= "Alienware Sentia",
219 DMI_MATCH(DMI_SYS_VENDOR
, "ALIENWARE"),
220 DMI_MATCH(DMI_PRODUCT_NAME
, "Sentia"),
224 .ident
= "Sharp Actius MM20",
226 DMI_MATCH(DMI_SYS_VENDOR
, "SHARP"),
227 DMI_MATCH(DMI_PRODUCT_NAME
, "PC-MM20 Series"),
231 .ident
= "Sony Vaio FS-115b",
233 DMI_MATCH(DMI_SYS_VENDOR
, "Sony Corporation"),
234 DMI_MATCH(DMI_PRODUCT_NAME
, "VGN-FS115B"),
238 .ident
= "Amoi M636/A737",
240 DMI_MATCH(DMI_SYS_VENDOR
, "Amoi Electronics CO.,LTD."),
241 DMI_MATCH(DMI_PRODUCT_NAME
, "M636/A737 platform"),
253 #include <linux/pnp.h>
255 static int i8042_pnp_kbd_registered
;
256 static unsigned int i8042_pnp_kbd_devices
;
257 static int i8042_pnp_aux_registered
;
258 static unsigned int i8042_pnp_aux_devices
;
260 static int i8042_pnp_command_reg
;
261 static int i8042_pnp_data_reg
;
262 static int i8042_pnp_kbd_irq
;
263 static int i8042_pnp_aux_irq
;
265 static char i8042_pnp_kbd_name
[32];
266 static char i8042_pnp_aux_name
[32];
268 static int i8042_pnp_kbd_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
270 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
271 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
273 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
274 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
276 if (pnp_irq_valid(dev
,0))
277 i8042_pnp_kbd_irq
= pnp_irq(dev
, 0);
279 strncpy(i8042_pnp_kbd_name
, did
->id
, sizeof(i8042_pnp_kbd_name
));
280 if (strlen(pnp_dev_name(dev
))) {
281 strncat(i8042_pnp_kbd_name
, ":", sizeof(i8042_pnp_kbd_name
));
282 strncat(i8042_pnp_kbd_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_kbd_name
));
285 i8042_pnp_kbd_devices
++;
289 static int i8042_pnp_aux_probe(struct pnp_dev
*dev
, const struct pnp_device_id
*did
)
291 if (pnp_port_valid(dev
, 0) && pnp_port_len(dev
, 0) == 1)
292 i8042_pnp_data_reg
= pnp_port_start(dev
,0);
294 if (pnp_port_valid(dev
, 1) && pnp_port_len(dev
, 1) == 1)
295 i8042_pnp_command_reg
= pnp_port_start(dev
, 1);
297 if (pnp_irq_valid(dev
, 0))
298 i8042_pnp_aux_irq
= pnp_irq(dev
, 0);
300 strncpy(i8042_pnp_aux_name
, did
->id
, sizeof(i8042_pnp_aux_name
));
301 if (strlen(pnp_dev_name(dev
))) {
302 strncat(i8042_pnp_aux_name
, ":", sizeof(i8042_pnp_aux_name
));
303 strncat(i8042_pnp_aux_name
, pnp_dev_name(dev
), sizeof(i8042_pnp_aux_name
));
306 i8042_pnp_aux_devices
++;
310 static struct pnp_device_id pnp_kbd_devids
[] = {
311 { .id
= "PNP0303", .driver_data
= 0 },
312 { .id
= "PNP030b", .driver_data
= 0 },
316 static struct pnp_driver i8042_pnp_kbd_driver
= {
318 .id_table
= pnp_kbd_devids
,
319 .probe
= i8042_pnp_kbd_probe
,
322 static struct pnp_device_id pnp_aux_devids
[] = {
323 { .id
= "FJC6000", .driver_data
= 0 },
324 { .id
= "FJC6001", .driver_data
= 0 },
325 { .id
= "PNP0f03", .driver_data
= 0 },
326 { .id
= "PNP0f0b", .driver_data
= 0 },
327 { .id
= "PNP0f0e", .driver_data
= 0 },
328 { .id
= "PNP0f12", .driver_data
= 0 },
329 { .id
= "PNP0f13", .driver_data
= 0 },
330 { .id
= "PNP0f19", .driver_data
= 0 },
331 { .id
= "PNP0f1c", .driver_data
= 0 },
332 { .id
= "SYN0801", .driver_data
= 0 },
336 static struct pnp_driver i8042_pnp_aux_driver
= {
338 .id_table
= pnp_aux_devids
,
339 .probe
= i8042_pnp_aux_probe
,
342 static void i8042_pnp_exit(void)
344 if (i8042_pnp_kbd_registered
) {
345 i8042_pnp_kbd_registered
= 0;
346 pnp_unregister_driver(&i8042_pnp_kbd_driver
);
349 if (i8042_pnp_aux_registered
) {
350 i8042_pnp_aux_registered
= 0;
351 pnp_unregister_driver(&i8042_pnp_aux_driver
);
355 static int __init
i8042_pnp_init(void)
357 char kbd_irq_str
[4] = { 0 }, aux_irq_str
[4] = { 0 };
361 printk(KERN_INFO
"i8042: PNP detection disabled\n");
365 err
= pnp_register_driver(&i8042_pnp_kbd_driver
);
367 i8042_pnp_kbd_registered
= 1;
369 err
= pnp_register_driver(&i8042_pnp_aux_driver
);
371 i8042_pnp_aux_registered
= 1;
373 if (!i8042_pnp_kbd_devices
&& !i8042_pnp_aux_devices
) {
375 #if defined(__ia64__)
378 printk(KERN_INFO
"PNP: No PS/2 controller found. Probing ports directly.\n");
383 if (i8042_pnp_kbd_devices
)
384 snprintf(kbd_irq_str
, sizeof(kbd_irq_str
),
385 "%d", i8042_pnp_kbd_irq
);
386 if (i8042_pnp_aux_devices
)
387 snprintf(aux_irq_str
, sizeof(aux_irq_str
),
388 "%d", i8042_pnp_aux_irq
);
390 printk(KERN_INFO
"PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
391 i8042_pnp_kbd_name
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
393 i8042_pnp_data_reg
, i8042_pnp_command_reg
,
394 kbd_irq_str
, (i8042_pnp_kbd_devices
&& i8042_pnp_aux_devices
) ? "," : "",
397 #if defined(__ia64__)
398 if (!i8042_pnp_kbd_devices
)
400 if (!i8042_pnp_aux_devices
)
404 if (((i8042_pnp_data_reg
& ~0xf) == (i8042_data_reg
& ~0xf) &&
405 i8042_pnp_data_reg
!= i8042_data_reg
) || !i8042_pnp_data_reg
) {
406 printk(KERN_WARNING
"PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
407 i8042_pnp_data_reg
, i8042_data_reg
);
408 i8042_pnp_data_reg
= i8042_data_reg
;
411 if (((i8042_pnp_command_reg
& ~0xf) == (i8042_command_reg
& ~0xf) &&
412 i8042_pnp_command_reg
!= i8042_command_reg
) || !i8042_pnp_command_reg
) {
413 printk(KERN_WARNING
"PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
414 i8042_pnp_command_reg
, i8042_command_reg
);
415 i8042_pnp_command_reg
= i8042_command_reg
;
418 if (!i8042_nokbd
&& !i8042_pnp_kbd_irq
) {
419 printk(KERN_WARNING
"PNP: PS/2 controller doesn't have KBD irq; using default %d\n", i8042_kbd_irq
);
420 i8042_pnp_kbd_irq
= i8042_kbd_irq
;
423 if (!i8042_noaux
&& !i8042_pnp_aux_irq
) {
424 printk(KERN_WARNING
"PNP: PS/2 controller doesn't have AUX irq; using default %d\n", i8042_aux_irq
);
425 i8042_pnp_aux_irq
= i8042_aux_irq
;
428 i8042_data_reg
= i8042_pnp_data_reg
;
429 i8042_command_reg
= i8042_pnp_command_reg
;
430 i8042_kbd_irq
= i8042_pnp_kbd_irq
;
431 i8042_aux_irq
= i8042_pnp_aux_irq
;
437 static inline int i8042_pnp_init(void) { return 0; }
438 static inline void i8042_pnp_exit(void) { }
441 static int __init
i8042_platform_init(void)
446 * On ix86 platforms touching the i8042 data register region can do really
447 * bad things. Because of this the region is always reserved on ix86 boxes.
449 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
453 i8042_kbd_irq
= I8042_MAP_IRQ(1);
454 i8042_aux_irq
= I8042_MAP_IRQ(12);
456 retval
= i8042_pnp_init();
460 #if defined(__ia64__)
464 #if defined(__i386__)
465 if (dmi_check_system(i8042_dmi_noloop_table
))
468 if (dmi_check_system(i8042_dmi_nomux_table
))
475 static inline void i8042_platform_exit(void)
480 #endif /* _I8042_X86IA64IO_H */