i8042-x86ia64io.h 16 KB

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