i8042-x86ia64io.h 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144
  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. #ifdef CONFIG_X86
  9. #include <asm/x86_init.h>
  10. #endif
  11. /*
  12. * Names.
  13. */
  14. #define I8042_KBD_PHYS_DESC "isa0060/serio0"
  15. #define I8042_AUX_PHYS_DESC "isa0060/serio1"
  16. #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
  17. /*
  18. * IRQs.
  19. */
  20. #if defined(__ia64__)
  21. # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
  22. #else
  23. # define I8042_MAP_IRQ(x) (x)
  24. #endif
  25. #define I8042_KBD_IRQ i8042_kbd_irq
  26. #define I8042_AUX_IRQ i8042_aux_irq
  27. static int i8042_kbd_irq;
  28. static int i8042_aux_irq;
  29. /*
  30. * Register numbers.
  31. */
  32. #define I8042_COMMAND_REG i8042_command_reg
  33. #define I8042_STATUS_REG i8042_command_reg
  34. #define I8042_DATA_REG i8042_data_reg
  35. static int i8042_command_reg = 0x64;
  36. static int i8042_data_reg = 0x60;
  37. static inline int i8042_read_data(void)
  38. {
  39. return inb(I8042_DATA_REG);
  40. }
  41. static inline int i8042_read_status(void)
  42. {
  43. return inb(I8042_STATUS_REG);
  44. }
  45. static inline void i8042_write_data(int val)
  46. {
  47. outb(val, I8042_DATA_REG);
  48. }
  49. static inline void i8042_write_command(int val)
  50. {
  51. outb(val, I8042_COMMAND_REG);
  52. }
  53. #ifdef CONFIG_X86
  54. #include <linux/dmi.h>
  55. static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = {
  56. {
  57. /*
  58. * Arima-Rioworks HDAMB -
  59. * AUX LOOP command does not raise AUX IRQ
  60. */
  61. .matches = {
  62. DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
  63. DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
  64. DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
  65. },
  66. },
  67. {
  68. /* ASUS G1S */
  69. .matches = {
  70. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
  71. DMI_MATCH(DMI_BOARD_NAME, "G1S"),
  72. DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
  73. },
  74. },
  75. {
  76. /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
  77. .matches = {
  78. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  79. DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
  80. DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
  81. },
  82. },
  83. {
  84. .matches = {
  85. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  86. DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
  87. },
  88. },
  89. {
  90. .matches = {
  91. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  92. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  93. DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
  94. },
  95. },
  96. {
  97. .matches = {
  98. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  99. DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"),
  100. DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
  101. },
  102. },
  103. {
  104. /* OQO Model 01 */
  105. .matches = {
  106. DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
  107. DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
  108. DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
  109. },
  110. },
  111. {
  112. /* ULI EV4873 - AUX LOOP does not work properly */
  113. .matches = {
  114. DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
  115. DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
  116. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  117. },
  118. },
  119. {
  120. /* Microsoft Virtual Machine */
  121. .matches = {
  122. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  123. DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
  124. DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
  125. },
  126. },
  127. {
  128. /* Medion MAM 2070 */
  129. .matches = {
  130. DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
  131. DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
  132. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  133. },
  134. },
  135. {
  136. /* Medion Akoya E7225 */
  137. .matches = {
  138. DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
  139. DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
  140. DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
  141. },
  142. },
  143. {
  144. /* Blue FB5601 */
  145. .matches = {
  146. DMI_MATCH(DMI_SYS_VENDOR, "blue"),
  147. DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
  148. DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
  149. },
  150. },
  151. {
  152. /* Gigabyte M912 */
  153. .matches = {
  154. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  155. DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
  156. DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
  157. },
  158. },
  159. {
  160. /* Gigabyte M1022M netbook */
  161. .matches = {
  162. DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
  163. DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
  164. DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
  165. },
  166. },
  167. {
  168. /* Gigabyte Spring Peak - defines wrong chassis type */
  169. .matches = {
  170. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  171. DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
  172. },
  173. },
  174. {
  175. /* Gigabyte T1005 - defines wrong chassis type ("Other") */
  176. .matches = {
  177. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  178. DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
  179. },
  180. },
  181. {
  182. /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
  183. .matches = {
  184. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  185. DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
  186. },
  187. },
  188. {
  189. .matches = {
  190. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  191. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
  192. DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
  193. },
  194. },
  195. { }
  196. };
  197. /*
  198. * Some Fujitsu notebooks are having trouble with touchpads if
  199. * active multiplexing mode is activated. Luckily they don't have
  200. * external PS/2 ports so we can safely disable it.
  201. * ... apparently some Toshibas don't like MUX mode either and
  202. * die horrible death on reboot.
  203. */
  204. static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = {
  205. {
  206. /* Fujitsu Lifebook P7010/P7010D */
  207. .matches = {
  208. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  209. DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
  210. },
  211. },
  212. {
  213. /* Fujitsu Lifebook P7010 */
  214. .matches = {
  215. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  216. DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
  217. },
  218. },
  219. {
  220. /* Fujitsu Lifebook P5020D */
  221. .matches = {
  222. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  223. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
  224. },
  225. },
  226. {
  227. /* Fujitsu Lifebook S2000 */
  228. .matches = {
  229. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  230. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
  231. },
  232. },
  233. {
  234. /* Fujitsu Lifebook S6230 */
  235. .matches = {
  236. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  237. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
  238. },
  239. },
  240. {
  241. /* Fujitsu Lifebook U745 */
  242. .matches = {
  243. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  244. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
  245. },
  246. },
  247. {
  248. /* Fujitsu T70H */
  249. .matches = {
  250. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  251. DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
  252. },
  253. },
  254. {
  255. /* Fujitsu-Siemens Lifebook T3010 */
  256. .matches = {
  257. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  258. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
  259. },
  260. },
  261. {
  262. /* Fujitsu-Siemens Lifebook E4010 */
  263. .matches = {
  264. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  265. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
  266. },
  267. },
  268. {
  269. /* Fujitsu-Siemens Amilo Pro 2010 */
  270. .matches = {
  271. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  272. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
  273. },
  274. },
  275. {
  276. /* Fujitsu-Siemens Amilo Pro 2030 */
  277. .matches = {
  278. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  279. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
  280. },
  281. },
  282. {
  283. /*
  284. * No data is coming from the touchscreen unless KBC
  285. * is in legacy mode.
  286. */
  287. /* Panasonic CF-29 */
  288. .matches = {
  289. DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
  290. DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
  291. },
  292. },
  293. {
  294. /*
  295. * HP Pavilion DV4017EA -
  296. * errors on MUX ports are reported without raising AUXDATA
  297. * causing "spurious NAK" messages.
  298. */
  299. .matches = {
  300. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  301. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
  302. },
  303. },
  304. {
  305. /*
  306. * HP Pavilion ZT1000 -
  307. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  308. */
  309. .matches = {
  310. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  311. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
  312. DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
  313. },
  314. },
  315. {
  316. /*
  317. * HP Pavilion DV4270ca -
  318. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  319. */
  320. .matches = {
  321. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  322. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
  323. },
  324. },
  325. {
  326. .matches = {
  327. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  328. DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
  329. },
  330. },
  331. {
  332. .matches = {
  333. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  334. DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
  335. },
  336. },
  337. {
  338. .matches = {
  339. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  340. DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
  341. },
  342. },
  343. {
  344. .matches = {
  345. DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
  346. DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
  347. },
  348. },
  349. {
  350. /* Sharp Actius MM20 */
  351. .matches = {
  352. DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
  353. DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
  354. },
  355. },
  356. {
  357. /* Sony Vaio FS-115b */
  358. .matches = {
  359. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  360. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
  361. },
  362. },
  363. {
  364. /*
  365. * Sony Vaio FZ-240E -
  366. * reset and GET ID commands issued via KBD port are
  367. * sometimes being delivered to AUX3.
  368. */
  369. .matches = {
  370. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  371. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
  372. },
  373. },
  374. {
  375. /*
  376. * Most (all?) VAIOs do not have external PS/2 ports nor
  377. * they implement active multiplexing properly, and
  378. * MUX discovery usually messes up keyboard/touchpad.
  379. */
  380. .matches = {
  381. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  382. DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
  383. },
  384. },
  385. {
  386. /* Amoi M636/A737 */
  387. .matches = {
  388. DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
  389. DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
  390. },
  391. },
  392. {
  393. /* Lenovo 3000 n100 */
  394. .matches = {
  395. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  396. DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
  397. },
  398. },
  399. {
  400. .matches = {
  401. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  402. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
  403. },
  404. },
  405. {
  406. /* Acer Aspire 5710 */
  407. .matches = {
  408. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  409. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
  410. },
  411. },
  412. {
  413. /* Acer Aspire 7738 */
  414. .matches = {
  415. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  416. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
  417. },
  418. },
  419. {
  420. /* Gericom Bellagio */
  421. .matches = {
  422. DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
  423. DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
  424. },
  425. },
  426. {
  427. /* IBM 2656 */
  428. .matches = {
  429. DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
  430. DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
  431. },
  432. },
  433. {
  434. /* Dell XPS M1530 */
  435. .matches = {
  436. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  437. DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
  438. },
  439. },
  440. {
  441. /* Compal HEL80I */
  442. .matches = {
  443. DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
  444. DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
  445. },
  446. },
  447. {
  448. /* Dell Vostro 1510 */
  449. .matches = {
  450. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  451. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
  452. },
  453. },
  454. {
  455. /* Acer Aspire 5536 */
  456. .matches = {
  457. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  458. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
  459. DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
  460. },
  461. },
  462. {
  463. /* Dell Vostro V13 */
  464. .matches = {
  465. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  466. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
  467. },
  468. },
  469. {
  470. /* Newer HP Pavilion dv4 models */
  471. .matches = {
  472. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  473. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
  474. },
  475. },
  476. {
  477. /* Asus X450LCP */
  478. .matches = {
  479. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  480. DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
  481. },
  482. },
  483. {
  484. /* Avatar AVIU-145A6 */
  485. .matches = {
  486. DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
  487. DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
  488. },
  489. },
  490. { }
  491. };
  492. /*
  493. * On some Asus laptops, just running self tests cause problems.
  494. */
  495. static const struct dmi_system_id i8042_dmi_noselftest_table[] = {
  496. {
  497. .matches = {
  498. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  499. DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
  500. },
  501. },
  502. { }
  503. };
  504. static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
  505. {
  506. /* MSI Wind U-100 */
  507. .matches = {
  508. DMI_MATCH(DMI_BOARD_NAME, "U-100"),
  509. DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
  510. },
  511. },
  512. {
  513. /* LG Electronics X110 */
  514. .matches = {
  515. DMI_MATCH(DMI_BOARD_NAME, "X110"),
  516. DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
  517. },
  518. },
  519. {
  520. /* Acer Aspire One 150 */
  521. .matches = {
  522. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  523. DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
  524. },
  525. },
  526. {
  527. /* Advent 4211 */
  528. .matches = {
  529. DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
  530. DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
  531. },
  532. },
  533. {
  534. /* Medion Akoya Mini E1210 */
  535. .matches = {
  536. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  537. DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
  538. },
  539. },
  540. {
  541. /* Medion Akoya E1222 */
  542. .matches = {
  543. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  544. DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
  545. },
  546. },
  547. {
  548. /* Mivvy M310 */
  549. .matches = {
  550. DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
  551. DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
  552. },
  553. },
  554. {
  555. /* Dell Vostro 1320 */
  556. .matches = {
  557. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  558. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
  559. },
  560. },
  561. {
  562. /* Dell Vostro 1520 */
  563. .matches = {
  564. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  565. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
  566. },
  567. },
  568. {
  569. /* Dell Vostro 1720 */
  570. .matches = {
  571. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  572. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
  573. },
  574. },
  575. {
  576. /* Lenovo Ideapad U455 */
  577. .matches = {
  578. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  579. DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
  580. },
  581. },
  582. { }
  583. };
  584. #ifdef CONFIG_PNP
  585. static const struct dmi_system_id __initconst i8042_dmi_nopnp_table[] = {
  586. {
  587. /* Intel MBO Desktop D845PESV */
  588. .matches = {
  589. DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
  590. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  591. },
  592. },
  593. {
  594. /*
  595. * Intel NUC D54250WYK - does not have i8042 controller but
  596. * declares PS/2 devices in DSDT.
  597. */
  598. .matches = {
  599. DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
  600. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  601. },
  602. },
  603. {
  604. /* MSI Wind U-100 */
  605. .matches = {
  606. DMI_MATCH(DMI_BOARD_NAME, "U-100"),
  607. DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
  608. },
  609. },
  610. { }
  611. };
  612. static const struct dmi_system_id __initconst i8042_dmi_laptop_table[] = {
  613. {
  614. .matches = {
  615. DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
  616. },
  617. },
  618. {
  619. .matches = {
  620. DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
  621. },
  622. },
  623. {
  624. .matches = {
  625. DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
  626. },
  627. },
  628. {
  629. .matches = {
  630. DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
  631. },
  632. },
  633. { }
  634. };
  635. #endif
  636. static const struct dmi_system_id __initconst i8042_dmi_notimeout_table[] = {
  637. {
  638. /* Dell Vostro V13 */
  639. .matches = {
  640. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  641. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
  642. },
  643. },
  644. {
  645. /* Newer HP Pavilion dv4 models */
  646. .matches = {
  647. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  648. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
  649. },
  650. },
  651. {
  652. /* Fujitsu A544 laptop */
  653. /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
  654. .matches = {
  655. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  656. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
  657. },
  658. },
  659. {
  660. /* Fujitsu AH544 laptop */
  661. /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
  662. .matches = {
  663. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  664. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
  665. },
  666. },
  667. {
  668. /* Fujitsu U574 laptop */
  669. /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
  670. .matches = {
  671. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  672. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
  673. },
  674. },
  675. { }
  676. };
  677. /*
  678. * Some Wistron based laptops need us to explicitly enable the 'Dritek
  679. * keyboard extension' to make their extra keys start generating scancodes.
  680. * Originally, this was just confined to older laptops, but a few Acer laptops
  681. * have turned up in 2007 that also need this again.
  682. */
  683. static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = {
  684. {
  685. /* Acer Aspire 5100 */
  686. .matches = {
  687. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  688. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
  689. },
  690. },
  691. {
  692. /* Acer Aspire 5610 */
  693. .matches = {
  694. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  695. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
  696. },
  697. },
  698. {
  699. /* Acer Aspire 5630 */
  700. .matches = {
  701. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  702. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
  703. },
  704. },
  705. {
  706. /* Acer Aspire 5650 */
  707. .matches = {
  708. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  709. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
  710. },
  711. },
  712. {
  713. /* Acer Aspire 5680 */
  714. .matches = {
  715. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  716. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
  717. },
  718. },
  719. {
  720. /* Acer Aspire 5720 */
  721. .matches = {
  722. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  723. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
  724. },
  725. },
  726. {
  727. /* Acer Aspire 9110 */
  728. .matches = {
  729. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  730. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
  731. },
  732. },
  733. {
  734. /* Acer TravelMate 660 */
  735. .matches = {
  736. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  737. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
  738. },
  739. },
  740. {
  741. /* Acer TravelMate 2490 */
  742. .matches = {
  743. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  744. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
  745. },
  746. },
  747. {
  748. /* Acer TravelMate 4280 */
  749. .matches = {
  750. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  751. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
  752. },
  753. },
  754. { }
  755. };
  756. /*
  757. * Some laptops need keyboard reset before probing for the trackpad to get
  758. * it detected, initialised & finally work.
  759. */
  760. static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = {
  761. {
  762. /* Gigabyte P35 v2 - Elantech touchpad */
  763. .matches = {
  764. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  765. DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
  766. },
  767. },
  768. {
  769. /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
  770. .matches = {
  771. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  772. DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
  773. },
  774. },
  775. {
  776. /* Gigabyte P34 - Elantech touchpad */
  777. .matches = {
  778. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  779. DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
  780. },
  781. },
  782. {
  783. /* Schenker XMG C504 - Elantech touchpad */
  784. .matches = {
  785. DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
  786. DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
  787. },
  788. },
  789. { }
  790. };
  791. #endif /* CONFIG_X86 */
  792. #ifdef CONFIG_PNP
  793. #include <linux/pnp.h>
  794. static bool i8042_pnp_kbd_registered;
  795. static unsigned int i8042_pnp_kbd_devices;
  796. static bool i8042_pnp_aux_registered;
  797. static unsigned int i8042_pnp_aux_devices;
  798. static int i8042_pnp_command_reg;
  799. static int i8042_pnp_data_reg;
  800. static int i8042_pnp_kbd_irq;
  801. static int i8042_pnp_aux_irq;
  802. static char i8042_pnp_kbd_name[32];
  803. static char i8042_pnp_aux_name[32];
  804. static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
  805. {
  806. strlcpy(dst, "PNP:", dst_size);
  807. while (id) {
  808. strlcat(dst, " ", dst_size);
  809. strlcat(dst, id->id, dst_size);
  810. id = id->next;
  811. }
  812. }
  813. static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  814. {
  815. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  816. i8042_pnp_data_reg = pnp_port_start(dev,0);
  817. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  818. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  819. if (pnp_irq_valid(dev,0))
  820. i8042_pnp_kbd_irq = pnp_irq(dev, 0);
  821. strlcpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
  822. if (strlen(pnp_dev_name(dev))) {
  823. strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
  824. strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
  825. }
  826. i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
  827. sizeof(i8042_kbd_firmware_id));
  828. /* Keyboard ports are always supposed to be wakeup-enabled */
  829. device_set_wakeup_enable(&dev->dev, true);
  830. i8042_pnp_kbd_devices++;
  831. return 0;
  832. }
  833. static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  834. {
  835. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  836. i8042_pnp_data_reg = pnp_port_start(dev,0);
  837. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  838. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  839. if (pnp_irq_valid(dev, 0))
  840. i8042_pnp_aux_irq = pnp_irq(dev, 0);
  841. strlcpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
  842. if (strlen(pnp_dev_name(dev))) {
  843. strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
  844. strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
  845. }
  846. i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
  847. sizeof(i8042_aux_firmware_id));
  848. i8042_pnp_aux_devices++;
  849. return 0;
  850. }
  851. static struct pnp_device_id pnp_kbd_devids[] = {
  852. { .id = "PNP0300", .driver_data = 0 },
  853. { .id = "PNP0301", .driver_data = 0 },
  854. { .id = "PNP0302", .driver_data = 0 },
  855. { .id = "PNP0303", .driver_data = 0 },
  856. { .id = "PNP0304", .driver_data = 0 },
  857. { .id = "PNP0305", .driver_data = 0 },
  858. { .id = "PNP0306", .driver_data = 0 },
  859. { .id = "PNP0309", .driver_data = 0 },
  860. { .id = "PNP030a", .driver_data = 0 },
  861. { .id = "PNP030b", .driver_data = 0 },
  862. { .id = "PNP0320", .driver_data = 0 },
  863. { .id = "PNP0343", .driver_data = 0 },
  864. { .id = "PNP0344", .driver_data = 0 },
  865. { .id = "PNP0345", .driver_data = 0 },
  866. { .id = "CPQA0D7", .driver_data = 0 },
  867. { .id = "", },
  868. };
  869. MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
  870. static struct pnp_driver i8042_pnp_kbd_driver = {
  871. .name = "i8042 kbd",
  872. .id_table = pnp_kbd_devids,
  873. .probe = i8042_pnp_kbd_probe,
  874. };
  875. static struct pnp_device_id pnp_aux_devids[] = {
  876. { .id = "AUI0200", .driver_data = 0 },
  877. { .id = "FJC6000", .driver_data = 0 },
  878. { .id = "FJC6001", .driver_data = 0 },
  879. { .id = "PNP0f03", .driver_data = 0 },
  880. { .id = "PNP0f0b", .driver_data = 0 },
  881. { .id = "PNP0f0e", .driver_data = 0 },
  882. { .id = "PNP0f12", .driver_data = 0 },
  883. { .id = "PNP0f13", .driver_data = 0 },
  884. { .id = "PNP0f19", .driver_data = 0 },
  885. { .id = "PNP0f1c", .driver_data = 0 },
  886. { .id = "SYN0801", .driver_data = 0 },
  887. { .id = "", },
  888. };
  889. MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
  890. static struct pnp_driver i8042_pnp_aux_driver = {
  891. .name = "i8042 aux",
  892. .id_table = pnp_aux_devids,
  893. .probe = i8042_pnp_aux_probe,
  894. };
  895. static void i8042_pnp_exit(void)
  896. {
  897. if (i8042_pnp_kbd_registered) {
  898. i8042_pnp_kbd_registered = false;
  899. pnp_unregister_driver(&i8042_pnp_kbd_driver);
  900. }
  901. if (i8042_pnp_aux_registered) {
  902. i8042_pnp_aux_registered = false;
  903. pnp_unregister_driver(&i8042_pnp_aux_driver);
  904. }
  905. }
  906. static int __init i8042_pnp_init(void)
  907. {
  908. char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
  909. bool pnp_data_busted = false;
  910. int err;
  911. #ifdef CONFIG_X86
  912. if (dmi_check_system(i8042_dmi_nopnp_table))
  913. i8042_nopnp = true;
  914. #endif
  915. if (i8042_nopnp) {
  916. pr_info("PNP detection disabled\n");
  917. return 0;
  918. }
  919. err = pnp_register_driver(&i8042_pnp_kbd_driver);
  920. if (!err)
  921. i8042_pnp_kbd_registered = true;
  922. err = pnp_register_driver(&i8042_pnp_aux_driver);
  923. if (!err)
  924. i8042_pnp_aux_registered = true;
  925. if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
  926. i8042_pnp_exit();
  927. #if defined(__ia64__)
  928. return -ENODEV;
  929. #else
  930. pr_info("PNP: No PS/2 controller found.\n");
  931. if (x86_platform.legacy.i8042 !=
  932. X86_LEGACY_I8042_EXPECTED_PRESENT)
  933. return -ENODEV;
  934. pr_info("Probing ports directly.\n");
  935. return 0;
  936. #endif
  937. }
  938. if (i8042_pnp_kbd_devices)
  939. snprintf(kbd_irq_str, sizeof(kbd_irq_str),
  940. "%d", i8042_pnp_kbd_irq);
  941. if (i8042_pnp_aux_devices)
  942. snprintf(aux_irq_str, sizeof(aux_irq_str),
  943. "%d", i8042_pnp_aux_irq);
  944. pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
  945. i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  946. i8042_pnp_aux_name,
  947. i8042_pnp_data_reg, i8042_pnp_command_reg,
  948. kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  949. aux_irq_str);
  950. #if defined(__ia64__)
  951. if (!i8042_pnp_kbd_devices)
  952. i8042_nokbd = true;
  953. if (!i8042_pnp_aux_devices)
  954. i8042_noaux = true;
  955. #endif
  956. if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
  957. i8042_pnp_data_reg != i8042_data_reg) ||
  958. !i8042_pnp_data_reg) {
  959. pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
  960. i8042_pnp_data_reg, i8042_data_reg);
  961. i8042_pnp_data_reg = i8042_data_reg;
  962. pnp_data_busted = true;
  963. }
  964. if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
  965. i8042_pnp_command_reg != i8042_command_reg) ||
  966. !i8042_pnp_command_reg) {
  967. pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
  968. i8042_pnp_command_reg, i8042_command_reg);
  969. i8042_pnp_command_reg = i8042_command_reg;
  970. pnp_data_busted = true;
  971. }
  972. if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
  973. pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
  974. i8042_kbd_irq);
  975. i8042_pnp_kbd_irq = i8042_kbd_irq;
  976. pnp_data_busted = true;
  977. }
  978. if (!i8042_noaux && !i8042_pnp_aux_irq) {
  979. if (!pnp_data_busted && i8042_pnp_kbd_irq) {
  980. pr_warn("PNP: PS/2 appears to have AUX port disabled, "
  981. "if this is incorrect please boot with i8042.nopnp\n");
  982. i8042_noaux = true;
  983. } else {
  984. pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
  985. i8042_aux_irq);
  986. i8042_pnp_aux_irq = i8042_aux_irq;
  987. }
  988. }
  989. i8042_data_reg = i8042_pnp_data_reg;
  990. i8042_command_reg = i8042_pnp_command_reg;
  991. i8042_kbd_irq = i8042_pnp_kbd_irq;
  992. i8042_aux_irq = i8042_pnp_aux_irq;
  993. #ifdef CONFIG_X86
  994. i8042_bypass_aux_irq_test = !pnp_data_busted &&
  995. dmi_check_system(i8042_dmi_laptop_table);
  996. #endif
  997. return 0;
  998. }
  999. #else /* !CONFIG_PNP */
  1000. static inline int i8042_pnp_init(void) { return 0; }
  1001. static inline void i8042_pnp_exit(void) { }
  1002. #endif /* CONFIG_PNP */
  1003. static int __init i8042_platform_init(void)
  1004. {
  1005. int retval;
  1006. #ifdef CONFIG_X86
  1007. u8 a20_on = 0xdf;
  1008. /* Just return if platform does not have i8042 controller */
  1009. if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
  1010. return -ENODEV;
  1011. #endif
  1012. /*
  1013. * On ix86 platforms touching the i8042 data register region can do really
  1014. * bad things. Because of this the region is always reserved on ix86 boxes.
  1015. *
  1016. * if (!request_region(I8042_DATA_REG, 16, "i8042"))
  1017. * return -EBUSY;
  1018. */
  1019. i8042_kbd_irq = I8042_MAP_IRQ(1);
  1020. i8042_aux_irq = I8042_MAP_IRQ(12);
  1021. retval = i8042_pnp_init();
  1022. if (retval)
  1023. return retval;
  1024. #if defined(__ia64__)
  1025. i8042_reset = I8042_RESET_ALWAYS;
  1026. #endif
  1027. #ifdef CONFIG_X86
  1028. /* Honor module parameter when value is not default */
  1029. if (i8042_reset == I8042_RESET_DEFAULT) {
  1030. if (dmi_check_system(i8042_dmi_reset_table))
  1031. i8042_reset = I8042_RESET_ALWAYS;
  1032. if (dmi_check_system(i8042_dmi_noselftest_table))
  1033. i8042_reset = I8042_RESET_NEVER;
  1034. }
  1035. if (dmi_check_system(i8042_dmi_noloop_table))
  1036. i8042_noloop = true;
  1037. if (dmi_check_system(i8042_dmi_nomux_table))
  1038. i8042_nomux = true;
  1039. if (dmi_check_system(i8042_dmi_notimeout_table))
  1040. i8042_notimeout = true;
  1041. if (dmi_check_system(i8042_dmi_dritek_table))
  1042. i8042_dritek = true;
  1043. if (dmi_check_system(i8042_dmi_kbdreset_table))
  1044. i8042_kbdreset = true;
  1045. /*
  1046. * A20 was already enabled during early kernel init. But some buggy
  1047. * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
  1048. * resume from S3. So we do it here and hope that nothing breaks.
  1049. */
  1050. i8042_command(&a20_on, 0x10d1);
  1051. i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
  1052. #endif /* CONFIG_X86 */
  1053. return retval;
  1054. }
  1055. static inline void i8042_platform_exit(void)
  1056. {
  1057. i8042_pnp_exit();
  1058. }
  1059. #endif /* _I8042_X86IA64IO_H */