aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/serio/i8042-x86ia64io.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 18:54:41 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 18:54:41 -0400
commit7f93220b624de1b7d9fcff8a2cebd6fce7ed4665 (patch)
tree5070ec25635008082b47a646d64b4359896c0faa /drivers/input/serio/i8042-x86ia64io.h
parent2b8dfec8c8fa4ba5bc946a602e94e99861462cad (diff)
parentd39969deee4b541be4ee5789a2e4c14511c886e2 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
Diffstat (limited to 'drivers/input/serio/i8042-x86ia64io.h')
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h72
1 files changed, 47 insertions, 25 deletions
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 03877c84e6ff..273bb3b08cfa 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -138,6 +138,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
138 }, 138 },
139 }, 139 },
140 { 140 {
141 .ident = "Fujitsu-Siemens Lifebook E4010",
142 .matches = {
143 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
144 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
145 },
146 },
147 {
141 .ident = "Toshiba P10", 148 .ident = "Toshiba P10",
142 .matches = { 149 .matches = {
143 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 150 DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
@@ -256,9 +263,10 @@ static void i8042_pnp_exit(void)
256 } 263 }
257} 264}
258 265
259static int i8042_pnp_init(void) 266static int __init i8042_pnp_init(void)
260{ 267{
261 int result_kbd, result_aux; 268 int result_kbd = 0, result_aux = 0;
269 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
262 270
263 if (i8042_nopnp) { 271 if (i8042_nopnp) {
264 printk(KERN_INFO "i8042: PNP detection disabled\n"); 272 printk(KERN_INFO "i8042: PNP detection disabled\n");
@@ -267,6 +275,7 @@ static int i8042_pnp_init(void)
267 275
268 if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0) 276 if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0)
269 i8042_pnp_kbd_registered = 1; 277 i8042_pnp_kbd_registered = 1;
278
270 if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0) 279 if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0)
271 i8042_pnp_aux_registered = 1; 280 i8042_pnp_aux_registered = 1;
272 281
@@ -280,6 +289,27 @@ static int i8042_pnp_init(void)
280#endif 289#endif
281 } 290 }
282 291
292 if (result_kbd > 0)
293 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
294 "%d", i8042_pnp_kbd_irq);
295 if (result_aux > 0)
296 snprintf(aux_irq_str, sizeof(aux_irq_str),
297 "%d", i8042_pnp_aux_irq);
298
299 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
300 i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "",
301 i8042_pnp_aux_name,
302 i8042_pnp_data_reg, i8042_pnp_command_reg,
303 kbd_irq_str, (result_kbd > 0 && result_aux > 0) ? "," : "",
304 aux_irq_str);
305
306#if defined(__ia64__)
307 if (result_kbd <= 0)
308 i8042_nokbd = 1;
309 if (result_aux <= 0)
310 i8042_noaux = 1;
311#endif
312
283 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) && 313 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
284 i8042_pnp_data_reg != i8042_data_reg) || !i8042_pnp_data_reg) { 314 i8042_pnp_data_reg != i8042_data_reg) || !i8042_pnp_data_reg) {
285 printk(KERN_WARNING "PNP: PS/2 controller has invalid data port %#x; using default %#x\n", 315 printk(KERN_WARNING "PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
@@ -294,53 +324,47 @@ static int i8042_pnp_init(void)
294 i8042_pnp_command_reg = i8042_command_reg; 324 i8042_pnp_command_reg = i8042_command_reg;
295 } 325 }
296 326
297 if (!i8042_pnp_kbd_irq) { 327 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
298 printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %#x\n", i8042_kbd_irq); 328 printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %d\n", i8042_kbd_irq);
299 i8042_pnp_kbd_irq = i8042_kbd_irq; 329 i8042_pnp_kbd_irq = i8042_kbd_irq;
300 } 330 }
301 331
302 if (!i8042_pnp_aux_irq) { 332 if (!i8042_noaux && !i8042_pnp_aux_irq) {
303 printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %#x\n", i8042_aux_irq); 333 printk(KERN_WARNING "PNP: PS/2 controller doesn't have AUX irq; using default %d\n", i8042_aux_irq);
304 i8042_pnp_aux_irq = i8042_aux_irq; 334 i8042_pnp_aux_irq = i8042_aux_irq;
305 } 335 }
306 336
307#if defined(__ia64__)
308 if (result_aux <= 0)
309 i8042_noaux = 1;
310#endif
311
312 i8042_data_reg = i8042_pnp_data_reg; 337 i8042_data_reg = i8042_pnp_data_reg;
313 i8042_command_reg = i8042_pnp_command_reg; 338 i8042_command_reg = i8042_pnp_command_reg;
314 i8042_kbd_irq = i8042_pnp_kbd_irq; 339 i8042_kbd_irq = i8042_pnp_kbd_irq;
315 i8042_aux_irq = i8042_pnp_aux_irq; 340 i8042_aux_irq = i8042_pnp_aux_irq;
316 341
317 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %d%s%d\n",
318 i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "", i8042_pnp_aux_name,
319 i8042_data_reg, i8042_command_reg, i8042_kbd_irq,
320 (result_aux > 0) ? "," : "", i8042_aux_irq);
321
322 return 0; 342 return 0;
323} 343}
324 344
345#else
346static inline int i8042_pnp_init(void) { return 0; }
347static inline void i8042_pnp_exit(void) { }
325#endif 348#endif
326 349
327static inline int i8042_platform_init(void) 350static int __init i8042_platform_init(void)
328{ 351{
352 int retval;
353
329/* 354/*
330 * On ix86 platforms touching the i8042 data register region can do really 355 * On ix86 platforms touching the i8042 data register region can do really
331 * bad things. Because of this the region is always reserved on ix86 boxes. 356 * bad things. Because of this the region is always reserved on ix86 boxes.
332 * 357 *
333 * if (!request_region(I8042_DATA_REG, 16, "i8042")) 358 * if (!request_region(I8042_DATA_REG, 16, "i8042"))
334 * return -1; 359 * return -EBUSY;
335 */ 360 */
336 361
337 i8042_kbd_irq = I8042_MAP_IRQ(1); 362 i8042_kbd_irq = I8042_MAP_IRQ(1);
338 i8042_aux_irq = I8042_MAP_IRQ(12); 363 i8042_aux_irq = I8042_MAP_IRQ(12);
339 364
340#ifdef CONFIG_PNP 365 retval = i8042_pnp_init();
341 if (i8042_pnp_init()) 366 if (retval)
342 return -1; 367 return retval;
343#endif
344 368
345#if defined(__ia64__) 369#if defined(__ia64__)
346 i8042_reset = 1; 370 i8042_reset = 1;
@@ -354,14 +378,12 @@ static inline int i8042_platform_init(void)
354 i8042_nomux = 1; 378 i8042_nomux = 1;
355#endif 379#endif
356 380
357 return 0; 381 return retval;
358} 382}
359 383
360static inline void i8042_platform_exit(void) 384static inline void i8042_platform_exit(void)
361{ 385{
362#ifdef CONFIG_PNP
363 i8042_pnp_exit(); 386 i8042_pnp_exit();
364#endif
365} 387}
366 388
367#endif /* _I8042_X86IA64IO_H */ 389#endif /* _I8042_X86IA64IO_H */