i8042-x86ia64io.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  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 const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
  53. {
  54. /*
  55. * Arima-Rioworks HDAMB -
  56. * AUX LOOP command does not raise AUX IRQ
  57. */
  58. .matches = {
  59. DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
  60. DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
  61. DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
  62. },
  63. },
  64. {
  65. /* ASUS G1S */
  66. .matches = {
  67. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
  68. DMI_MATCH(DMI_BOARD_NAME, "G1S"),
  69. DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
  70. },
  71. },
  72. {
  73. /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
  74. .matches = {
  75. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  76. DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
  77. DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
  78. },
  79. },
  80. {
  81. .matches = {
  82. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  83. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  84. DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
  85. },
  86. },
  87. {
  88. .matches = {
  89. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  90. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  91. DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
  92. },
  93. },
  94. {
  95. /* OQO Model 01 */
  96. .matches = {
  97. DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
  98. DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
  99. DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
  100. },
  101. },
  102. {
  103. /* ULI EV4873 - AUX LOOP does not work properly */
  104. .matches = {
  105. DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
  106. DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
  107. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  108. },
  109. },
  110. {
  111. /* Microsoft Virtual Machine */
  112. .matches = {
  113. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  114. DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
  115. DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
  116. },
  117. },
  118. {
  119. /* Medion MAM 2070 */
  120. .matches = {
  121. DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
  122. DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
  123. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  124. },
  125. },
  126. {
  127. /* Blue FB5601 */
  128. .matches = {
  129. DMI_MATCH(DMI_SYS_VENDOR, "blue"),
  130. DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
  131. DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
  132. },
  133. },
  134. {
  135. /* Gigabyte M912 */
  136. .matches = {
  137. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  138. DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
  139. DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
  140. },
  141. },
  142. {
  143. /* Gigabyte M1022M netbook */
  144. .matches = {
  145. DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
  146. DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
  147. DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
  148. },
  149. },
  150. {
  151. /* Gigabyte Spring Peak - defines wrong chassis type */
  152. .matches = {
  153. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  154. DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
  155. },
  156. },
  157. {
  158. .matches = {
  159. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  160. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
  161. DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
  162. },
  163. },
  164. { }
  165. };
  166. /*
  167. * Some Fujitsu notebooks are having trouble with touchpads if
  168. * active multiplexing mode is activated. Luckily they don't have
  169. * external PS/2 ports so we can safely disable it.
  170. * ... apparently some Toshibas don't like MUX mode either and
  171. * die horrible death on reboot.
  172. */
  173. static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
  174. {
  175. /* Fujitsu Lifebook P7010/P7010D */
  176. .matches = {
  177. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  178. DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
  179. },
  180. },
  181. {
  182. /* Fujitsu Lifebook P7010 */
  183. .matches = {
  184. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  185. DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
  186. },
  187. },
  188. {
  189. /* Fujitsu Lifebook P5020D */
  190. .matches = {
  191. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  192. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
  193. },
  194. },
  195. {
  196. /* Fujitsu Lifebook S2000 */
  197. .matches = {
  198. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  199. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
  200. },
  201. },
  202. {
  203. /* Fujitsu Lifebook S6230 */
  204. .matches = {
  205. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  206. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
  207. },
  208. },
  209. {
  210. /* Fujitsu T70H */
  211. .matches = {
  212. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  213. DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
  214. },
  215. },
  216. {
  217. /* Fujitsu-Siemens Lifebook T3010 */
  218. .matches = {
  219. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  220. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
  221. },
  222. },
  223. {
  224. /* Fujitsu-Siemens Lifebook E4010 */
  225. .matches = {
  226. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  227. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
  228. },
  229. },
  230. {
  231. /* Fujitsu-Siemens Amilo Pro 2010 */
  232. .matches = {
  233. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  234. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
  235. },
  236. },
  237. {
  238. /* Fujitsu-Siemens Amilo Pro 2030 */
  239. .matches = {
  240. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  241. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
  242. },
  243. },
  244. {
  245. /*
  246. * No data is coming from the touchscreen unless KBC
  247. * is in legacy mode.
  248. */
  249. /* Panasonic CF-29 */
  250. .matches = {
  251. DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
  252. DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
  253. },
  254. },
  255. {
  256. /*
  257. * HP Pavilion DV4017EA -
  258. * errors on MUX ports are reported without raising AUXDATA
  259. * causing "spurious NAK" messages.
  260. */
  261. .matches = {
  262. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  263. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
  264. },
  265. },
  266. {
  267. /*
  268. * HP Pavilion ZT1000 -
  269. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  270. */
  271. .matches = {
  272. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  273. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
  274. DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
  275. },
  276. },
  277. {
  278. /*
  279. * HP Pavilion DV4270ca -
  280. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  281. */
  282. .matches = {
  283. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  284. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
  285. },
  286. },
  287. {
  288. .matches = {
  289. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  290. DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
  291. },
  292. },
  293. {
  294. .matches = {
  295. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  296. DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
  297. },
  298. },
  299. {
  300. .matches = {
  301. DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
  302. DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
  303. },
  304. },
  305. {
  306. /* Sharp Actius MM20 */
  307. .matches = {
  308. DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
  309. DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
  310. },
  311. },
  312. {
  313. /* Sony Vaio FS-115b */
  314. .matches = {
  315. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  316. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
  317. },
  318. },
  319. {
  320. /*
  321. * Sony Vaio FZ-240E -
  322. * reset and GET ID commands issued via KBD port are
  323. * sometimes being delivered to AUX3.
  324. */
  325. .matches = {
  326. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  327. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
  328. },
  329. },
  330. {
  331. /* Amoi M636/A737 */
  332. .matches = {
  333. DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
  334. DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
  335. },
  336. },
  337. {
  338. /* Lenovo 3000 n100 */
  339. .matches = {
  340. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  341. DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
  342. },
  343. },
  344. {
  345. .matches = {
  346. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  347. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
  348. },
  349. },
  350. {
  351. /* Gericom Bellagio */
  352. .matches = {
  353. DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
  354. DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
  355. },
  356. },
  357. {
  358. /* IBM 2656 */
  359. .matches = {
  360. DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
  361. DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
  362. },
  363. },
  364. {
  365. /* Dell XPS M1530 */
  366. .matches = {
  367. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  368. DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
  369. },
  370. },
  371. {
  372. /* Compal HEL80I */
  373. .matches = {
  374. DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
  375. DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
  376. },
  377. },
  378. {
  379. /* Dell Vostro 1510 */
  380. .matches = {
  381. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  382. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
  383. },
  384. },
  385. {
  386. /* Acer Aspire 5536 */
  387. .matches = {
  388. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  389. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
  390. DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
  391. },
  392. },
  393. { }
  394. };
  395. static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
  396. {
  397. /* MSI Wind U-100 */
  398. .matches = {
  399. DMI_MATCH(DMI_BOARD_NAME, "U-100"),
  400. DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
  401. },
  402. },
  403. {
  404. /* LG Electronics X110 */
  405. .matches = {
  406. DMI_MATCH(DMI_BOARD_NAME, "X110"),
  407. DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
  408. },
  409. },
  410. {
  411. /* Acer Aspire One 150 */
  412. .matches = {
  413. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  414. DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
  415. },
  416. },
  417. {
  418. /* Advent 4211 */
  419. .matches = {
  420. DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
  421. DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
  422. },
  423. },
  424. {
  425. /* Medion Akoya Mini E1210 */
  426. .matches = {
  427. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  428. DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
  429. },
  430. },
  431. {
  432. /* Medion Akoya E1222 */
  433. .matches = {
  434. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  435. DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
  436. },
  437. },
  438. {
  439. /* Mivvy M310 */
  440. .matches = {
  441. DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
  442. DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
  443. },
  444. },
  445. {
  446. /* Dell Vostro 1320 */
  447. .matches = {
  448. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  449. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
  450. },
  451. },
  452. {
  453. /* Dell Vostro 1520 */
  454. .matches = {
  455. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  456. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
  457. },
  458. },
  459. {
  460. /* Dell Vostro 1720 */
  461. .matches = {
  462. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  463. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
  464. },
  465. },
  466. { }
  467. };
  468. #ifdef CONFIG_PNP
  469. static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
  470. {
  471. /* Intel MBO Desktop D845PESV */
  472. .matches = {
  473. DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
  474. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  475. },
  476. },
  477. {
  478. /* MSI Wind U-100 */
  479. .matches = {
  480. DMI_MATCH(DMI_BOARD_NAME, "U-100"),
  481. DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
  482. },
  483. },
  484. { }
  485. };
  486. static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
  487. {
  488. .matches = {
  489. DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
  490. },
  491. },
  492. {
  493. .matches = {
  494. DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
  495. },
  496. },
  497. {
  498. .matches = {
  499. DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
  500. },
  501. },
  502. {
  503. .matches = {
  504. DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
  505. },
  506. },
  507. { }
  508. };
  509. #endif
  510. /*
  511. * Some Wistron based laptops need us to explicitly enable the 'Dritek
  512. * keyboard extension' to make their extra keys start generating scancodes.
  513. * Originally, this was just confined to older laptops, but a few Acer laptops
  514. * have turned up in 2007 that also need this again.
  515. */
  516. static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
  517. {
  518. /* Acer Aspire 5610 */
  519. .matches = {
  520. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  521. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
  522. },
  523. },
  524. {
  525. /* Acer Aspire 5630 */
  526. .matches = {
  527. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  528. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
  529. },
  530. },
  531. {
  532. /* Acer Aspire 5650 */
  533. .matches = {
  534. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  535. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
  536. },
  537. },
  538. {
  539. /* Acer Aspire 5680 */
  540. .matches = {
  541. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  542. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
  543. },
  544. },
  545. {
  546. /* Acer Aspire 5720 */
  547. .matches = {
  548. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  549. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
  550. },
  551. },
  552. {
  553. /* Acer Aspire 9110 */
  554. .matches = {
  555. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  556. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
  557. },
  558. },
  559. {
  560. /* Acer TravelMate 660 */
  561. .matches = {
  562. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  563. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
  564. },
  565. },
  566. {
  567. /* Acer TravelMate 2490 */
  568. .matches = {
  569. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  570. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
  571. },
  572. },
  573. {
  574. /* Acer TravelMate 4280 */
  575. .matches = {
  576. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  577. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
  578. },
  579. },
  580. { }
  581. };
  582. #endif /* CONFIG_X86 */
  583. #ifdef CONFIG_PNP
  584. #include <linux/pnp.h>
  585. static bool i8042_pnp_kbd_registered;
  586. static unsigned int i8042_pnp_kbd_devices;
  587. static bool i8042_pnp_aux_registered;
  588. static unsigned int i8042_pnp_aux_devices;
  589. static int i8042_pnp_command_reg;
  590. static int i8042_pnp_data_reg;
  591. static int i8042_pnp_kbd_irq;
  592. static int i8042_pnp_aux_irq;
  593. static char i8042_pnp_kbd_name[32];
  594. static char i8042_pnp_aux_name[32];
  595. static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  596. {
  597. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  598. i8042_pnp_data_reg = pnp_port_start(dev,0);
  599. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  600. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  601. if (pnp_irq_valid(dev,0))
  602. i8042_pnp_kbd_irq = pnp_irq(dev, 0);
  603. strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
  604. if (strlen(pnp_dev_name(dev))) {
  605. strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
  606. strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
  607. }
  608. /* Keyboard ports are always supposed to be wakeup-enabled */
  609. device_set_wakeup_enable(&dev->dev, true);
  610. i8042_pnp_kbd_devices++;
  611. return 0;
  612. }
  613. static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  614. {
  615. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  616. i8042_pnp_data_reg = pnp_port_start(dev,0);
  617. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  618. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  619. if (pnp_irq_valid(dev, 0))
  620. i8042_pnp_aux_irq = pnp_irq(dev, 0);
  621. strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
  622. if (strlen(pnp_dev_name(dev))) {
  623. strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
  624. strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
  625. }
  626. i8042_pnp_aux_devices++;
  627. return 0;
  628. }
  629. static struct pnp_device_id pnp_kbd_devids[] = {
  630. { .id = "PNP0300", .driver_data = 0 },
  631. { .id = "PNP0301", .driver_data = 0 },
  632. { .id = "PNP0302", .driver_data = 0 },
  633. { .id = "PNP0303", .driver_data = 0 },
  634. { .id = "PNP0304", .driver_data = 0 },
  635. { .id = "PNP0305", .driver_data = 0 },
  636. { .id = "PNP0306", .driver_data = 0 },
  637. { .id = "PNP0309", .driver_data = 0 },
  638. { .id = "PNP030a", .driver_data = 0 },
  639. { .id = "PNP030b", .driver_data = 0 },
  640. { .id = "PNP0320", .driver_data = 0 },
  641. { .id = "PNP0343", .driver_data = 0 },
  642. { .id = "PNP0344", .driver_data = 0 },
  643. { .id = "PNP0345", .driver_data = 0 },
  644. { .id = "CPQA0D7", .driver_data = 0 },
  645. { .id = "", },
  646. };
  647. static struct pnp_driver i8042_pnp_kbd_driver = {
  648. .name = "i8042 kbd",
  649. .id_table = pnp_kbd_devids,
  650. .probe = i8042_pnp_kbd_probe,
  651. };
  652. static struct pnp_device_id pnp_aux_devids[] = {
  653. { .id = "AUI0200", .driver_data = 0 },
  654. { .id = "FJC6000", .driver_data = 0 },
  655. { .id = "FJC6001", .driver_data = 0 },
  656. { .id = "PNP0f03", .driver_data = 0 },
  657. { .id = "PNP0f0b", .driver_data = 0 },
  658. { .id = "PNP0f0e", .driver_data = 0 },
  659. { .id = "PNP0f12", .driver_data = 0 },
  660. { .id = "PNP0f13", .driver_data = 0 },
  661. { .id = "PNP0f19", .driver_data = 0 },
  662. { .id = "PNP0f1c", .driver_data = 0 },
  663. { .id = "SYN0801", .driver_data = 0 },
  664. { .id = "", },
  665. };
  666. static struct pnp_driver i8042_pnp_aux_driver = {
  667. .name = "i8042 aux",
  668. .id_table = pnp_aux_devids,
  669. .probe = i8042_pnp_aux_probe,
  670. };
  671. static void i8042_pnp_exit(void)
  672. {
  673. if (i8042_pnp_kbd_registered) {
  674. i8042_pnp_kbd_registered = false;
  675. pnp_unregister_driver(&i8042_pnp_kbd_driver);
  676. }
  677. if (i8042_pnp_aux_registered) {
  678. i8042_pnp_aux_registered = false;
  679. pnp_unregister_driver(&i8042_pnp_aux_driver);
  680. }
  681. }
  682. static int __init i8042_pnp_init(void)
  683. {
  684. char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
  685. bool pnp_data_busted = false;
  686. int err;
  687. #ifdef CONFIG_X86
  688. if (dmi_check_system(i8042_dmi_nopnp_table))
  689. i8042_nopnp = true;
  690. #endif
  691. if (i8042_nopnp) {
  692. printk(KERN_INFO "i8042: PNP detection disabled\n");
  693. return 0;
  694. }
  695. err = pnp_register_driver(&i8042_pnp_kbd_driver);
  696. if (!err)
  697. i8042_pnp_kbd_registered = true;
  698. err = pnp_register_driver(&i8042_pnp_aux_driver);
  699. if (!err)
  700. i8042_pnp_aux_registered = true;
  701. if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
  702. i8042_pnp_exit();
  703. #if defined(__ia64__)
  704. return -ENODEV;
  705. #else
  706. printk(KERN_INFO "PNP: No PS/2 controller found. Probing ports directly.\n");
  707. return 0;
  708. #endif
  709. }
  710. if (i8042_pnp_kbd_devices)
  711. snprintf(kbd_irq_str, sizeof(kbd_irq_str),
  712. "%d", i8042_pnp_kbd_irq);
  713. if (i8042_pnp_aux_devices)
  714. snprintf(aux_irq_str, sizeof(aux_irq_str),
  715. "%d", i8042_pnp_aux_irq);
  716. printk(KERN_INFO "PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
  717. i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  718. i8042_pnp_aux_name,
  719. i8042_pnp_data_reg, i8042_pnp_command_reg,
  720. kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  721. aux_irq_str);
  722. #if defined(__ia64__)
  723. if (!i8042_pnp_kbd_devices)
  724. i8042_nokbd = true;
  725. if (!i8042_pnp_aux_devices)
  726. i8042_noaux = true;
  727. #endif
  728. if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
  729. i8042_pnp_data_reg != i8042_data_reg) ||
  730. !i8042_pnp_data_reg) {
  731. printk(KERN_WARNING
  732. "PNP: PS/2 controller has invalid data port %#x; "
  733. "using default %#x\n",
  734. i8042_pnp_data_reg, i8042_data_reg);
  735. i8042_pnp_data_reg = i8042_data_reg;
  736. pnp_data_busted = true;
  737. }
  738. if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
  739. i8042_pnp_command_reg != i8042_command_reg) ||
  740. !i8042_pnp_command_reg) {
  741. printk(KERN_WARNING
  742. "PNP: PS/2 controller has invalid command port %#x; "
  743. "using default %#x\n",
  744. i8042_pnp_command_reg, i8042_command_reg);
  745. i8042_pnp_command_reg = i8042_command_reg;
  746. pnp_data_busted = true;
  747. }
  748. if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
  749. printk(KERN_WARNING
  750. "PNP: PS/2 controller doesn't have KBD irq; "
  751. "using default %d\n", i8042_kbd_irq);
  752. i8042_pnp_kbd_irq = i8042_kbd_irq;
  753. pnp_data_busted = true;
  754. }
  755. if (!i8042_noaux && !i8042_pnp_aux_irq) {
  756. if (!pnp_data_busted && i8042_pnp_kbd_irq) {
  757. printk(KERN_WARNING
  758. "PNP: PS/2 appears to have AUX port disabled, "
  759. "if this is incorrect please boot with "
  760. "i8042.nopnp\n");
  761. i8042_noaux = true;
  762. } else {
  763. printk(KERN_WARNING
  764. "PNP: PS/2 controller doesn't have AUX irq; "
  765. "using default %d\n", i8042_aux_irq);
  766. i8042_pnp_aux_irq = i8042_aux_irq;
  767. }
  768. }
  769. i8042_data_reg = i8042_pnp_data_reg;
  770. i8042_command_reg = i8042_pnp_command_reg;
  771. i8042_kbd_irq = i8042_pnp_kbd_irq;
  772. i8042_aux_irq = i8042_pnp_aux_irq;
  773. #ifdef CONFIG_X86
  774. i8042_bypass_aux_irq_test = !pnp_data_busted &&
  775. dmi_check_system(i8042_dmi_laptop_table);
  776. #endif
  777. return 0;
  778. }
  779. #else
  780. static inline int i8042_pnp_init(void) { return 0; }
  781. static inline void i8042_pnp_exit(void) { }
  782. #endif
  783. static int __init i8042_platform_init(void)
  784. {
  785. int retval;
  786. /*
  787. * On ix86 platforms touching the i8042 data register region can do really
  788. * bad things. Because of this the region is always reserved on ix86 boxes.
  789. *
  790. * if (!request_region(I8042_DATA_REG, 16, "i8042"))
  791. * return -EBUSY;
  792. */
  793. i8042_kbd_irq = I8042_MAP_IRQ(1);
  794. i8042_aux_irq = I8042_MAP_IRQ(12);
  795. retval = i8042_pnp_init();
  796. if (retval)
  797. return retval;
  798. #if defined(__ia64__)
  799. i8042_reset = true;
  800. #endif
  801. #ifdef CONFIG_X86
  802. if (dmi_check_system(i8042_dmi_reset_table))
  803. i8042_reset = true;
  804. if (dmi_check_system(i8042_dmi_noloop_table))
  805. i8042_noloop = true;
  806. if (dmi_check_system(i8042_dmi_nomux_table))
  807. i8042_nomux = true;
  808. if (dmi_check_system(i8042_dmi_dritek_table))
  809. i8042_dritek = true;
  810. #endif /* CONFIG_X86 */
  811. return retval;
  812. }
  813. static inline void i8042_platform_exit(void)
  814. {
  815. i8042_pnp_exit();
  816. }
  817. #endif /* _I8042_X86IA64IO_H */