i8042-x86ia64io.h 31 KB

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