aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2005-09-04 02:41:51 -0400
committerDmitry Torokhov <dtor_core@ameritech.net>2005-09-04 02:41:51 -0400
commitc3d31e7f9a94800ba895a081e143e79954f6c62f (patch)
tree18ceb7462191a1131f1615654292e244b8d7bc42
parent8d5987a6e17fa36776a0c9964db0f24c3d070862 (diff)
Input: i8042 - fix IRQ printing when either KBD or AUX port
is absent from ACPI/PNP tables. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h39
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 02bc23142ce0..84a73bc6afdc 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -258,7 +258,8 @@ static void i8042_pnp_exit(void)
258 258
259static int __init i8042_pnp_init(void) 259static int __init i8042_pnp_init(void)
260{ 260{
261 int result_kbd, result_aux; 261 int result_kbd = 0, result_aux = 0;
262 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
262 263
263 if (i8042_nopnp) { 264 if (i8042_nopnp) {
264 printk(KERN_INFO "i8042: PNP detection disabled\n"); 265 printk(KERN_INFO "i8042: PNP detection disabled\n");
@@ -267,6 +268,7 @@ static int __init i8042_pnp_init(void)
267 268
268 if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0) 269 if ((result_kbd = pnp_register_driver(&i8042_pnp_kbd_driver)) >= 0)
269 i8042_pnp_kbd_registered = 1; 270 i8042_pnp_kbd_registered = 1;
271
270 if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0) 272 if ((result_aux = pnp_register_driver(&i8042_pnp_aux_driver)) >= 0)
271 i8042_pnp_aux_registered = 1; 273 i8042_pnp_aux_registered = 1;
272 274
@@ -280,6 +282,25 @@ static int __init i8042_pnp_init(void)
280#endif 282#endif
281 } 283 }
282 284
285 if (result_kbd > 0)
286 snprintf(kbd_irq_str, sizeof(kbd_irq_str),
287 "%d", i8042_pnp_kbd_irq);
288 if (result_aux > 0)
289 snprintf(aux_irq_str, sizeof(aux_irq_str),
290 "%d", i8042_pnp_aux_irq);
291
292 printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
293 i8042_pnp_kbd_name, (result_kbd > 0 && result_aux > 0) ? "," : "",
294 i8042_pnp_aux_name,
295 i8042_pnp_data_reg, i8042_pnp_command_reg,
296 kbd_irq_str, (result_kbd > 0 && result_aux > 0) ? "," : "",
297 aux_irq_str);
298
299#if defined(__ia64__)
300 if (result_aux <= 0)
301 i8042_noaux = 1;
302#endif
303
283 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) && 304 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
284 i8042_pnp_data_reg != i8042_data_reg) || !i8042_pnp_data_reg) { 305 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", 306 printk(KERN_WARNING "PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
@@ -295,30 +316,20 @@ static int __init i8042_pnp_init(void)
295 } 316 }
296 317
297 if (!i8042_pnp_kbd_irq) { 318 if (!i8042_pnp_kbd_irq) {
298 printk(KERN_WARNING "PNP: PS/2 controller doesn't have KBD irq; using default %#x\n", i8042_kbd_irq); 319 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; 320 i8042_pnp_kbd_irq = i8042_kbd_irq;
300 } 321 }
301 322
302 if (!i8042_pnp_aux_irq) { 323 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); 324 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; 325 i8042_pnp_aux_irq = i8042_aux_irq;
305 } 326 }
306 327
307#if defined(__ia64__)
308 if (result_aux <= 0)
309 i8042_noaux = 1;
310#endif
311
312 i8042_data_reg = i8042_pnp_data_reg; 328 i8042_data_reg = i8042_pnp_data_reg;
313 i8042_command_reg = i8042_pnp_command_reg; 329 i8042_command_reg = i8042_pnp_command_reg;
314 i8042_kbd_irq = i8042_pnp_kbd_irq; 330 i8042_kbd_irq = i8042_pnp_kbd_irq;
315 i8042_aux_irq = i8042_pnp_aux_irq; 331 i8042_aux_irq = i8042_pnp_aux_irq;
316 332
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; 333 return 0;
323} 334}
324 335