i8042-x86ia64io.h 17 KB

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