i8042-x86ia64io.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. #ifndef _I8042_X86IA64IO_H
  2. #define _I8042_X86IA64IO_H
  3. /*
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License version 2 as published by
  6. * the Free Software Foundation.
  7. */
  8. /*
  9. * Names.
  10. */
  11. #define I8042_KBD_PHYS_DESC "isa0060/serio0"
  12. #define I8042_AUX_PHYS_DESC "isa0060/serio1"
  13. #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
  14. /*
  15. * IRQs.
  16. */
  17. #if defined(__ia64__)
  18. # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
  19. #else
  20. # define I8042_MAP_IRQ(x) (x)
  21. #endif
  22. #define I8042_KBD_IRQ i8042_kbd_irq
  23. #define I8042_AUX_IRQ i8042_aux_irq
  24. static int i8042_kbd_irq;
  25. static int i8042_aux_irq;
  26. /*
  27. * Register numbers.
  28. */
  29. #define I8042_COMMAND_REG i8042_command_reg
  30. #define I8042_STATUS_REG i8042_command_reg
  31. #define I8042_DATA_REG i8042_data_reg
  32. static int i8042_command_reg = 0x64;
  33. static int i8042_data_reg = 0x60;
  34. static inline int i8042_read_data(void)
  35. {
  36. return inb(I8042_DATA_REG);
  37. }
  38. static inline int i8042_read_status(void)
  39. {
  40. return inb(I8042_STATUS_REG);
  41. }
  42. static inline void i8042_write_data(int val)
  43. {
  44. outb(val, I8042_DATA_REG);
  45. }
  46. static inline void i8042_write_command(int val)
  47. {
  48. outb(val, I8042_COMMAND_REG);
  49. }
  50. #ifdef CONFIG_X86
  51. #include <linux/dmi.h>
  52. static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = {
  53. {
  54. /* AUX LOOP command does not raise AUX IRQ */
  55. .ident = "ASUS P65UP5",
  56. .matches = {
  57. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  58. DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
  59. DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
  60. },
  61. },
  62. {
  63. .ident = "Compaq Proliant 8500",
  64. .matches = {
  65. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  66. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  67. DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
  68. },
  69. },
  70. {
  71. .ident = "Compaq Proliant DL760",
  72. .matches = {
  73. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  74. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  75. DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
  76. },
  77. },
  78. {
  79. .ident = "OQO Model 01",
  80. .matches = {
  81. DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
  82. DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
  83. DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
  84. },
  85. },
  86. {
  87. /* AUX LOOP does not work properly */
  88. .ident = "ULI EV4873",
  89. .matches = {
  90. DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
  91. DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
  92. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  93. },
  94. },
  95. {
  96. .ident = "Microsoft Virtual Machine",
  97. .matches = {
  98. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  99. DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
  100. DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
  101. },
  102. },
  103. {
  104. .ident = "Medion MAM 2070",
  105. .matches = {
  106. DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
  107. DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
  108. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  109. },
  110. },
  111. { }
  112. };
  113. /*
  114. * Some Fujitsu notebooks are having trouble with touchpads if
  115. * active multiplexing mode is activated. Luckily they don't have
  116. * external PS/2 ports so we can safely disable it.
  117. * ... apparently some Toshibas don't like MUX mode either and
  118. * die horrible death on reboot.
  119. */
  120. static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
  121. {
  122. .ident = "Fujitsu Lifebook P7010/P7010D",
  123. .matches = {
  124. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  125. DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
  126. },
  127. },
  128. {
  129. .ident = "Fujitsu Lifebook P7010",
  130. .matches = {
  131. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  132. DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
  133. },
  134. },
  135. {
  136. .ident = "Fujitsu Lifebook P5020D",
  137. .matches = {
  138. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  139. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
  140. },
  141. },
  142. {
  143. .ident = "Fujitsu Lifebook S2000",
  144. .matches = {
  145. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  146. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
  147. },
  148. },
  149. {
  150. .ident = "Fujitsu Lifebook S6230",
  151. .matches = {
  152. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  153. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
  154. },
  155. },
  156. {
  157. .ident = "Fujitsu T70H",
  158. .matches = {
  159. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  160. DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
  161. },
  162. },
  163. {
  164. .ident = "Fujitsu-Siemens Lifebook T3010",
  165. .matches = {
  166. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  167. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
  168. },
  169. },
  170. {
  171. .ident = "Fujitsu-Siemens Lifebook E4010",
  172. .matches = {
  173. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  174. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
  175. },
  176. },
  177. {
  178. .ident = "Fujitsu-Siemens Amilo Pro 2010",
  179. .matches = {
  180. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  181. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
  182. },
  183. },
  184. {
  185. .ident = "Fujitsu-Siemens Amilo Pro 2030",
  186. .matches = {
  187. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  188. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
  189. },
  190. },
  191. {
  192. /*
  193. * No data is coming from the touchscreen unless KBC
  194. * is in legacy mode.
  195. */
  196. .ident = "Panasonic CF-29",
  197. .matches = {
  198. DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
  199. DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
  200. },
  201. },
  202. {
  203. /*
  204. * Errors on MUX ports are reported without raising AUXDATA
  205. * causing "spurious NAK" messages.
  206. */
  207. .ident = "HP Pavilion DV4017EA",
  208. .matches = {
  209. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  210. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
  211. },
  212. },
  213. {
  214. /*
  215. * Like DV4017EA does not raise AUXERR for errors on MUX ports.
  216. */
  217. .ident = "HP Pavilion ZT1000",
  218. .matches = {
  219. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  220. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
  221. DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
  222. },
  223. },
  224. {
  225. /*
  226. * Like DV4017EA does not raise AUXERR for errors on MUX ports.
  227. */
  228. .ident = "HP Pavilion DV4270ca",
  229. .matches = {
  230. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  231. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
  232. },
  233. },
  234. {
  235. .ident = "Toshiba P10",
  236. .matches = {
  237. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  238. DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
  239. },
  240. },
  241. {
  242. .ident = "Toshiba Equium A110",
  243. .matches = {
  244. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  245. DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
  246. },
  247. },
  248. {
  249. .ident = "Alienware Sentia",
  250. .matches = {
  251. DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
  252. DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
  253. },
  254. },
  255. {
  256. .ident = "Sharp Actius MM20",
  257. .matches = {
  258. DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
  259. DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
  260. },
  261. },
  262. {
  263. .ident = "Sony Vaio FS-115b",
  264. .matches = {
  265. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  266. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
  267. },
  268. },
  269. {
  270. .ident = "Amoi M636/A737",
  271. .matches = {
  272. DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
  273. DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
  274. },
  275. },
  276. {
  277. .ident = "Lenovo 3000 n100",
  278. .matches = {
  279. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  280. DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
  281. },
  282. },
  283. {
  284. .ident = "Acer Aspire 1360",
  285. .matches = {
  286. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  287. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
  288. },
  289. },
  290. {
  291. .ident = "Gericom Bellagio",
  292. .matches = {
  293. DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
  294. DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
  295. },
  296. },
  297. { }
  298. };
  299. #ifdef CONFIG_PNP
  300. static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = {
  301. {
  302. .ident = "Intel MBO Desktop D845PESV",
  303. .matches = {
  304. DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
  305. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  306. },
  307. },
  308. { }
  309. };
  310. #endif
  311. /*
  312. * Some Wistron based laptops need us to explicitly enable the 'Dritek
  313. * keyboard extension' to make their extra keys start generating scancodes.
  314. * Originally, this was just confined to older laptops, but a few Acer laptops
  315. * have turned up in 2007 that also need this again.
  316. */
  317. static struct dmi_system_id __initdata i8042_dmi_dritek_table[] = {
  318. {
  319. .ident = "Acer Aspire 5630",
  320. .matches = {
  321. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  322. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
  323. },
  324. },
  325. {
  326. .ident = "Acer Aspire 5650",
  327. .matches = {
  328. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  329. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
  330. },
  331. },
  332. {
  333. .ident = "Acer Aspire 5680",
  334. .matches = {
  335. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  336. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
  337. },
  338. },
  339. {
  340. .ident = "Acer Aspire 5720",
  341. .matches = {
  342. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  343. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
  344. },
  345. },
  346. {
  347. .ident = "Acer Aspire 9110",
  348. .matches = {
  349. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  350. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
  351. },
  352. },
  353. {
  354. .ident = "Acer TravelMate 660",
  355. .matches = {
  356. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  357. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
  358. },
  359. },
  360. {
  361. .ident = "Acer TravelMate 2490",
  362. .matches = {
  363. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  364. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
  365. },
  366. },
  367. { }
  368. };
  369. #endif /* CONFIG_X86 */
  370. #ifdef CONFIG_PNP
  371. #include <linux/pnp.h>
  372. static int i8042_pnp_kbd_registered;
  373. static unsigned int i8042_pnp_kbd_devices;
  374. static int i8042_pnp_aux_registered;
  375. static unsigned int i8042_pnp_aux_devices;
  376. static int i8042_pnp_command_reg;
  377. static int i8042_pnp_data_reg;
  378. static int i8042_pnp_kbd_irq;
  379. static int i8042_pnp_aux_irq;
  380. static char i8042_pnp_kbd_name[32];
  381. static char i8042_pnp_aux_name[32];
  382. static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  383. {
  384. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  385. i8042_pnp_data_reg = pnp_port_start(dev,0);
  386. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  387. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  388. if (pnp_irq_valid(dev,0))
  389. i8042_pnp_kbd_irq = pnp_irq(dev, 0);
  390. strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
  391. if (strlen(pnp_dev_name(dev))) {
  392. strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
  393. strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
  394. }
  395. i8042_pnp_kbd_devices++;
  396. return 0;
  397. }
  398. static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  399. {
  400. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  401. i8042_pnp_data_reg = pnp_port_start(dev,0);
  402. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  403. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  404. if (pnp_irq_valid(dev, 0))
  405. i8042_pnp_aux_irq = pnp_irq(dev, 0);
  406. strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
  407. if (strlen(pnp_dev_name(dev))) {
  408. strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
  409. strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
  410. }
  411. i8042_pnp_aux_devices++;
  412. return 0;
  413. }
  414. static struct pnp_device_id pnp_kbd_devids[] = {
  415. { .id = "PNP0303", .driver_data = 0 },
  416. { .id = "PNP030b", .driver_data = 0 },
  417. { .id = "", },
  418. };
  419. static struct pnp_driver i8042_pnp_kbd_driver = {
  420. .name = "i8042 kbd",
  421. .id_table = pnp_kbd_devids,
  422. .probe = i8042_pnp_kbd_probe,
  423. };
  424. static struct pnp_device_id pnp_aux_devids[] = {
  425. { .id = "FJC6000", .driver_data = 0 },
  426. { .id = "FJC6001", .driver_data = 0 },
  427. { .id = "PNP0f03", .driver_data = 0 },
  428. { .id = "PNP0f0b", .driver_data = 0 },
  429. { .id = "PNP0f0e", .driver_data = 0 },
  430. { .id = "PNP0f12", .driver_data = 0 },
  431. { .id = "PNP0f13", .driver_data = 0 },
  432. { .id = "PNP0f19", .driver_data = 0 },
  433. { .id = "PNP0f1c", .driver_data = 0 },
  434. { .id = "SYN0801", .driver_data = 0 },
  435. { .id = "", },
  436. };
  437. static struct pnp_driver i8042_pnp_aux_driver = {
  438. .name = "i8042 aux",
  439. .id_table = pnp_aux_devids,
  440. .probe = i8042_pnp_aux_probe,
  441. };
  442. static void i8042_pnp_exit(void)
  443. {
  444. if (i8042_pnp_kbd_registered) {
  445. i8042_pnp_kbd_registered = 0;
  446. pnp_unregister_driver(&i8042_pnp_kbd_driver);
  447. }
  448. if (i8042_pnp_aux_registered) {
  449. i8042_pnp_aux_registered = 0;
  450. pnp_unregister_driver(&i8042_pnp_aux_driver);
  451. }
  452. }
  453. static int __init i8042_pnp_init(void)
  454. {
  455. char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
  456. int pnp_data_busted = 0;
  457. int err;
  458. #ifdef CONFIG_X86
  459. if (dmi_check_system(i8042_dmi_nopnp_table))
  460. i8042_nopnp = 1;
  461. #endif
  462. if (i8042_nopnp) {
  463. printk(KERN_INFO "i8042: PNP detection disabled\n");
  464. return 0;
  465. }
  466. err = pnp_register_driver(&i8042_pnp_kbd_driver);
  467. if (!err)
  468. i8042_pnp_kbd_registered = 1;
  469. err = pnp_register_driver(&i8042_pnp_aux_driver);
  470. if (!err)
  471. i8042_pnp_aux_registered = 1;
  472. if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
  473. i8042_pnp_exit();
  474. #if defined(__ia64__)
  475. return -ENODEV;
  476. #else
  477. printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
  478. return 0;
  479. #endif
  480. }
  481. if (i8042_pnp_kbd_devices)
  482. snprintf(kbd_irq_str, sizeof(kbd_irq_str),
  483. "%d", i8042_pnp_kbd_irq);
  484. if (i8042_pnp_aux_devices)
  485. snprintf(aux_irq_str, sizeof(aux_irq_str),
  486. "%d", i8042_pnp_aux_irq);
  487. printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
  488. i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  489. i8042_pnp_aux_name,
  490. i8042_pnp_data_reg, i8042_pnp_command_reg,
  491. kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  492. aux_irq_str);
  493. #if defined(__ia64__)
  494. if (!i8042_pnp_kbd_devices)
  495. i8042_nokbd = 1;
  496. if (!i8042_pnp_aux_devices)
  497. i8042_noaux = 1;
  498. #endif
  499. if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
  500. i8042_pnp_data_reg != i8042_data_reg) ||
  501. !i8042_pnp_data_reg) {
  502. printk(KERN_WARNING
  503. "PNP: PS/2 controller has invalid data port %#x; "
  504. "using default %#x\n",
  505. i8042_pnp_data_reg, i8042_data_reg);
  506. i8042_pnp_data_reg = i8042_data_reg;
  507. pnp_data_busted = 1;
  508. }
  509. if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
  510. i8042_pnp_command_reg != i8042_command_reg) ||
  511. !i8042_pnp_command_reg) {
  512. printk(KERN_WARNING
  513. "PNP: PS/2 controller has invalid command port %#x; "
  514. "using default %#x\n",
  515. i8042_pnp_command_reg, i8042_command_reg);
  516. i8042_pnp_command_reg = i8042_command_reg;
  517. pnp_data_busted = 1;
  518. }
  519. if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
  520. printk(KERN_WARNING
  521. "PNP: PS/2 controller doesn't have KBD irq; "
  522. "using default %d\n", i8042_kbd_irq);
  523. i8042_pnp_kbd_irq = i8042_kbd_irq;
  524. pnp_data_busted = 1;
  525. }
  526. if (!i8042_noaux && !i8042_pnp_aux_irq) {
  527. if (!pnp_data_busted && i8042_pnp_kbd_irq) {
  528. printk(KERN_WARNING
  529. "PNP: PS/2 appears to have AUX port disabled, "
  530. "if this is incorrect please boot with "
  531. "i8042.nopnp\n");
  532. i8042_noaux = 1;
  533. } else {
  534. printk(KERN_WARNING
  535. "PNP: PS/2 controller doesn't have AUX irq; "
  536. "using default %d\n", i8042_aux_irq);
  537. i8042_pnp_aux_irq = i8042_aux_irq;
  538. }
  539. }
  540. i8042_data_reg = i8042_pnp_data_reg;
  541. i8042_command_reg = i8042_pnp_command_reg;
  542. i8042_kbd_irq = i8042_pnp_kbd_irq;
  543. i8042_aux_irq = i8042_pnp_aux_irq;
  544. return 0;
  545. }
  546. #else
  547. static inline int i8042_pnp_init(void) { return 0; }
  548. static inline void i8042_pnp_exit(void) { }
  549. #endif
  550. static int __init i8042_platform_init(void)
  551. {
  552. int retval;
  553. /*
  554. * On ix86 platforms touching the i8042 data register region can do really
  555. * bad things. Because of this the region is always reserved on ix86 boxes.
  556. *
  557. * if (!request_region(I8042_DATA_REG, 16, "i8042"))
  558. * return -EBUSY;
  559. */
  560. i8042_kbd_irq = I8042_MAP_IRQ(1);
  561. i8042_aux_irq = I8042_MAP_IRQ(12);
  562. retval = i8042_pnp_init();
  563. if (retval)
  564. return retval;
  565. #if defined(__ia64__)
  566. i8042_reset = 1;
  567. #endif
  568. #ifdef CONFIG_X86
  569. if (dmi_check_system(i8042_dmi_noloop_table))
  570. i8042_noloop = 1;
  571. if (dmi_check_system(i8042_dmi_nomux_table))
  572. i8042_nomux = 1;
  573. if (dmi_check_system(i8042_dmi_dritek_table))
  574. i8042_dritek = 1;
  575. #endif /* CONFIG_X86 */
  576. return retval;
  577. }
  578. static inline void i8042_platform_exit(void)
  579. {
  580. i8042_pnp_exit();
  581. }
  582. #endif /* _I8042_X86IA64IO_H */