i8042-acpipnpio.h 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef _I8042_ACPIPNPIO_H
  3. #define _I8042_ACPIPNPIO_H
  4. #include <linux/acpi.h>
  5. #ifdef CONFIG_X86
  6. #include <asm/x86_init.h>
  7. #endif
  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. #define SERIO_QUIRK_NOKBD BIT(0)
  53. #define SERIO_QUIRK_NOAUX BIT(1)
  54. #define SERIO_QUIRK_NOMUX BIT(2)
  55. #define SERIO_QUIRK_FORCEMUX BIT(3)
  56. #define SERIO_QUIRK_UNLOCK BIT(4)
  57. #define SERIO_QUIRK_PROBE_DEFER BIT(5)
  58. #define SERIO_QUIRK_RESET_ALWAYS BIT(6)
  59. #define SERIO_QUIRK_RESET_NEVER BIT(7)
  60. #define SERIO_QUIRK_DIRECT BIT(8)
  61. #define SERIO_QUIRK_DUMBKBD BIT(9)
  62. #define SERIO_QUIRK_NOLOOP BIT(10)
  63. #define SERIO_QUIRK_NOTIMEOUT BIT(11)
  64. #define SERIO_QUIRK_KBDRESET BIT(12)
  65. #define SERIO_QUIRK_DRITEK BIT(13)
  66. #define SERIO_QUIRK_NOPNP BIT(14)
  67. #define SERIO_QUIRK_FORCENORESTORE BIT(15)
  68. /* Quirk table for different mainboards. Options similar or identical to i8042
  69. * module parameters.
  70. * ORDERING IS IMPORTANT! The first match will be apllied and the rest ignored.
  71. * This allows entries to overwrite vendor wide quirks on a per device basis.
  72. * Where this is irrelevant, entries are sorted case sensitive by DMI_SYS_VENDOR
  73. * and/or DMI_BOARD_VENDOR to make it easier to avoid duplicate entries.
  74. */
  75. static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
  76. {
  77. .matches = {
  78. DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"),
  79. DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"),
  80. },
  81. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  82. },
  83. {
  84. .matches = {
  85. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  86. DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"),
  87. },
  88. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  89. },
  90. {
  91. /* Asus X450LCP */
  92. .matches = {
  93. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  94. DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"),
  95. },
  96. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_NEVER)
  97. },
  98. {
  99. /*
  100. * ASUS Zenbook UX425QA_UM425QA
  101. * Some Zenbooks report "Zenbook" with a lowercase b.
  102. */
  103. .matches = {
  104. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  105. DMI_MATCH(DMI_PRODUCT_NAME, "Zenbook UX425QA_UM425QA"),
  106. },
  107. .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
  108. },
  109. {
  110. /* ASUS ZenBook UX425UA/QA */
  111. .matches = {
  112. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  113. DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX425"),
  114. },
  115. .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
  116. },
  117. {
  118. /* ASUS ZenBook UM325UA/QA */
  119. .matches = {
  120. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  121. DMI_MATCH(DMI_PRODUCT_NAME, "ZenBook UX325"),
  122. },
  123. .driver_data = (void *)(SERIO_QUIRK_PROBE_DEFER | SERIO_QUIRK_RESET_NEVER)
  124. },
  125. /*
  126. * On some Asus laptops, just running self tests cause problems.
  127. */
  128. {
  129. .matches = {
  130. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  131. DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
  132. },
  133. .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
  134. },
  135. {
  136. .matches = {
  137. DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
  138. DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
  139. },
  140. .driver_data = (void *)(SERIO_QUIRK_RESET_NEVER)
  141. },
  142. {
  143. /* ASUS P65UP5 - AUX LOOP command does not raise AUX IRQ */
  144. .matches = {
  145. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
  146. DMI_MATCH(DMI_BOARD_NAME, "P/I-P65UP5"),
  147. DMI_MATCH(DMI_BOARD_VERSION, "REV 2.X"),
  148. },
  149. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  150. },
  151. {
  152. /* ASUS G1S */
  153. .matches = {
  154. DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."),
  155. DMI_MATCH(DMI_BOARD_NAME, "G1S"),
  156. DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
  157. },
  158. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  159. },
  160. {
  161. .matches = {
  162. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  163. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"),
  164. },
  165. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  166. },
  167. {
  168. /* Acer Aspire 5710 */
  169. .matches = {
  170. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  171. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"),
  172. },
  173. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  174. },
  175. {
  176. /* Acer Aspire 7738 */
  177. .matches = {
  178. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  179. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"),
  180. },
  181. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  182. },
  183. {
  184. /* Acer Aspire 5536 */
  185. .matches = {
  186. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  187. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"),
  188. DMI_MATCH(DMI_PRODUCT_VERSION, "0100"),
  189. },
  190. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  191. },
  192. {
  193. /*
  194. * Acer Aspire 5738z
  195. * Touchpad stops working in mux mode when dis- + re-enabled
  196. * with the touchpad enable/disable toggle hotkey
  197. */
  198. .matches = {
  199. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  200. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"),
  201. },
  202. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  203. },
  204. {
  205. /* Acer Aspire One 150 */
  206. .matches = {
  207. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  208. DMI_MATCH(DMI_PRODUCT_NAME, "AOA150"),
  209. },
  210. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  211. },
  212. {
  213. /* Acer Aspire One 532h */
  214. .matches = {
  215. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  216. DMI_MATCH(DMI_PRODUCT_NAME, "AO532h"),
  217. },
  218. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  219. },
  220. {
  221. .matches = {
  222. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  223. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A114-31"),
  224. },
  225. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  226. },
  227. {
  228. .matches = {
  229. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  230. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A314-31"),
  231. },
  232. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  233. },
  234. {
  235. .matches = {
  236. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  237. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire A315-31"),
  238. },
  239. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  240. },
  241. {
  242. .matches = {
  243. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  244. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-132"),
  245. },
  246. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  247. },
  248. {
  249. .matches = {
  250. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  251. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-332"),
  252. },
  253. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  254. },
  255. {
  256. .matches = {
  257. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  258. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire ES1-432"),
  259. },
  260. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  261. },
  262. {
  263. .matches = {
  264. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  265. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate Spin B118-RN"),
  266. },
  267. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  268. },
  269. /*
  270. * Some Wistron based laptops need us to explicitly enable the 'Dritek
  271. * keyboard extension' to make their extra keys start generating scancodes.
  272. * Originally, this was just confined to older laptops, but a few Acer laptops
  273. * have turned up in 2007 that also need this again.
  274. */
  275. {
  276. /* Acer Aspire 5100 */
  277. .matches = {
  278. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  279. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5100"),
  280. },
  281. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  282. },
  283. {
  284. /* Acer Aspire 5610 */
  285. .matches = {
  286. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  287. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5610"),
  288. },
  289. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  290. },
  291. {
  292. /* Acer Aspire 5630 */
  293. .matches = {
  294. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  295. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5630"),
  296. },
  297. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  298. },
  299. {
  300. /* Acer Aspire 5650 */
  301. .matches = {
  302. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  303. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5650"),
  304. },
  305. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  306. },
  307. {
  308. /* Acer Aspire 5680 */
  309. .matches = {
  310. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  311. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5680"),
  312. },
  313. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  314. },
  315. {
  316. /* Acer Aspire 5720 */
  317. .matches = {
  318. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  319. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
  320. },
  321. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  322. },
  323. {
  324. /* Acer Aspire 9110 */
  325. .matches = {
  326. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  327. DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 9110"),
  328. },
  329. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  330. },
  331. {
  332. /* Acer TravelMate 660 */
  333. .matches = {
  334. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  335. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 660"),
  336. },
  337. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  338. },
  339. {
  340. /* Acer TravelMate 2490 */
  341. .matches = {
  342. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  343. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 2490"),
  344. },
  345. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  346. },
  347. {
  348. /* Acer TravelMate 4280 */
  349. .matches = {
  350. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  351. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4280"),
  352. },
  353. .driver_data = (void *)(SERIO_QUIRK_DRITEK)
  354. },
  355. {
  356. /* Acer TravelMate P459-G2-M */
  357. .matches = {
  358. DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
  359. DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate P459-G2-M"),
  360. },
  361. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  362. },
  363. {
  364. /* Amoi M636/A737 */
  365. .matches = {
  366. DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."),
  367. DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
  368. },
  369. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  370. },
  371. {
  372. .matches = {
  373. DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"),
  374. DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"),
  375. },
  376. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  377. },
  378. {
  379. /* Compal HEL80I */
  380. .matches = {
  381. DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"),
  382. DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"),
  383. },
  384. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  385. },
  386. {
  387. .matches = {
  388. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  389. DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
  390. DMI_MATCH(DMI_PRODUCT_VERSION, "8500"),
  391. },
  392. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  393. },
  394. {
  395. .matches = {
  396. DMI_MATCH(DMI_SYS_VENDOR, "Compaq"),
  397. DMI_MATCH(DMI_PRODUCT_NAME, "ProLiant"),
  398. DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
  399. },
  400. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  401. },
  402. {
  403. /* Advent 4211 */
  404. .matches = {
  405. DMI_MATCH(DMI_SYS_VENDOR, "DIXONSXP"),
  406. DMI_MATCH(DMI_PRODUCT_NAME, "Advent 4211"),
  407. },
  408. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  409. },
  410. {
  411. /* Dell Embedded Box PC 3000 */
  412. .matches = {
  413. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  414. DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
  415. },
  416. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  417. },
  418. {
  419. /* Dell XPS M1530 */
  420. .matches = {
  421. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  422. DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"),
  423. },
  424. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  425. },
  426. {
  427. /* Dell Vostro 1510 */
  428. .matches = {
  429. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  430. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"),
  431. },
  432. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  433. },
  434. {
  435. /* Dell Vostro V13 */
  436. .matches = {
  437. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  438. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"),
  439. },
  440. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
  441. },
  442. {
  443. /* Dell Vostro 1320 */
  444. .matches = {
  445. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  446. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1320"),
  447. },
  448. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  449. },
  450. {
  451. /* Dell Vostro 1520 */
  452. .matches = {
  453. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  454. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1520"),
  455. },
  456. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  457. },
  458. {
  459. /* Dell Vostro 1720 */
  460. .matches = {
  461. DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
  462. DMI_MATCH(DMI_PRODUCT_NAME, "Vostro 1720"),
  463. },
  464. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  465. },
  466. {
  467. /* Entroware Proteus */
  468. .matches = {
  469. DMI_MATCH(DMI_SYS_VENDOR, "Entroware"),
  470. DMI_MATCH(DMI_PRODUCT_NAME, "Proteus"),
  471. DMI_MATCH(DMI_PRODUCT_VERSION, "EL07R4"),
  472. },
  473. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS)
  474. },
  475. /*
  476. * Some Fujitsu notebooks are having trouble with touchpads if
  477. * active multiplexing mode is activated. Luckily they don't have
  478. * external PS/2 ports so we can safely disable it.
  479. * ... apparently some Toshibas don't like MUX mode either and
  480. * die horrible death on reboot.
  481. */
  482. {
  483. /* Fujitsu Lifebook P7010/P7010D */
  484. .matches = {
  485. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  486. DMI_MATCH(DMI_PRODUCT_NAME, "P7010"),
  487. },
  488. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  489. },
  490. {
  491. /* Fujitsu Lifebook P5020D */
  492. .matches = {
  493. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  494. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"),
  495. },
  496. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  497. },
  498. {
  499. /* Fujitsu Lifebook S2000 */
  500. .matches = {
  501. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  502. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"),
  503. },
  504. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  505. },
  506. {
  507. /* Fujitsu Lifebook S6230 */
  508. .matches = {
  509. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  510. DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"),
  511. },
  512. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  513. },
  514. {
  515. /* Fujitsu Lifebook T725 laptop */
  516. .matches = {
  517. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  518. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T725"),
  519. },
  520. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
  521. },
  522. {
  523. /* Fujitsu Lifebook U745 */
  524. .matches = {
  525. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  526. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U745"),
  527. },
  528. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  529. },
  530. {
  531. /* Fujitsu T70H */
  532. .matches = {
  533. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  534. DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
  535. },
  536. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  537. },
  538. {
  539. /* Fujitsu A544 laptop */
  540. /* https://bugzilla.redhat.com/show_bug.cgi?id=1111138 */
  541. .matches = {
  542. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  543. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK A544"),
  544. },
  545. .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
  546. },
  547. {
  548. /* Fujitsu AH544 laptop */
  549. /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
  550. .matches = {
  551. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  552. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK AH544"),
  553. },
  554. .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
  555. },
  556. {
  557. /* Fujitsu U574 laptop */
  558. /* https://bugzilla.kernel.org/show_bug.cgi?id=69731 */
  559. .matches = {
  560. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  561. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U574"),
  562. },
  563. .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
  564. },
  565. {
  566. /* Fujitsu UH554 laptop */
  567. .matches = {
  568. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  569. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK UH544"),
  570. },
  571. .driver_data = (void *)(SERIO_QUIRK_NOTIMEOUT)
  572. },
  573. {
  574. /* Fujitsu Lifebook P7010 */
  575. .matches = {
  576. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  577. DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"),
  578. },
  579. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  580. },
  581. {
  582. /* Fujitsu-Siemens Lifebook T3010 */
  583. .matches = {
  584. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  585. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"),
  586. },
  587. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  588. },
  589. {
  590. /* Fujitsu-Siemens Lifebook E4010 */
  591. .matches = {
  592. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  593. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"),
  594. },
  595. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  596. },
  597. {
  598. /* Fujitsu-Siemens Amilo Pro 2010 */
  599. .matches = {
  600. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  601. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"),
  602. },
  603. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  604. },
  605. {
  606. /* Fujitsu-Siemens Amilo Pro 2030 */
  607. .matches = {
  608. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
  609. DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"),
  610. },
  611. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  612. },
  613. {
  614. /* Fujitsu Lifebook A574/H */
  615. .matches = {
  616. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  617. DMI_MATCH(DMI_PRODUCT_NAME, "FMVA0501PZ"),
  618. },
  619. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  620. },
  621. {
  622. /* Fujitsu Lifebook E756 */
  623. /* https://bugzilla.suse.com/show_bug.cgi?id=1229056 */
  624. .matches = {
  625. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  626. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E756"),
  627. },
  628. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  629. },
  630. {
  631. /* Fujitsu Lifebook E5411 */
  632. .matches = {
  633. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
  634. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
  635. },
  636. .driver_data = (void *)(SERIO_QUIRK_NOAUX)
  637. },
  638. {
  639. /* Fujitsu Lifebook U728 */
  640. .matches = {
  641. DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
  642. DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U728"),
  643. },
  644. .driver_data = (void *)(SERIO_QUIRK_NOAUX)
  645. },
  646. {
  647. /* Gigabyte M912 */
  648. .matches = {
  649. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  650. DMI_MATCH(DMI_PRODUCT_NAME, "M912"),
  651. DMI_MATCH(DMI_PRODUCT_VERSION, "01"),
  652. },
  653. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  654. },
  655. {
  656. /* Gigabyte Spring Peak - defines wrong chassis type */
  657. .matches = {
  658. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  659. DMI_MATCH(DMI_PRODUCT_NAME, "Spring Peak"),
  660. },
  661. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  662. },
  663. {
  664. /* Gigabyte T1005 - defines wrong chassis type ("Other") */
  665. .matches = {
  666. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  667. DMI_MATCH(DMI_PRODUCT_NAME, "T1005"),
  668. },
  669. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  670. },
  671. {
  672. /* Gigabyte T1005M/P - defines wrong chassis type ("Other") */
  673. .matches = {
  674. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  675. DMI_MATCH(DMI_PRODUCT_NAME, "T1005M/P"),
  676. },
  677. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  678. },
  679. /*
  680. * Some laptops need keyboard reset before probing for the trackpad to get
  681. * it detected, initialised & finally work.
  682. */
  683. {
  684. /* Gigabyte P35 v2 - Elantech touchpad */
  685. .matches = {
  686. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  687. DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"),
  688. },
  689. .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
  690. },
  691. {
  692. /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */
  693. .matches = {
  694. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  695. DMI_MATCH(DMI_PRODUCT_NAME, "X3"),
  696. },
  697. .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
  698. },
  699. {
  700. /* Gigabyte P34 - Elantech touchpad */
  701. .matches = {
  702. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  703. DMI_MATCH(DMI_PRODUCT_NAME, "P34"),
  704. },
  705. .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
  706. },
  707. {
  708. /* Gigabyte P57 - Elantech touchpad */
  709. .matches = {
  710. DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"),
  711. DMI_MATCH(DMI_PRODUCT_NAME, "P57"),
  712. },
  713. .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
  714. },
  715. {
  716. /* Gericom Bellagio */
  717. .matches = {
  718. DMI_MATCH(DMI_SYS_VENDOR, "Gericom"),
  719. DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"),
  720. },
  721. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  722. },
  723. {
  724. /* Gigabyte M1022M netbook */
  725. .matches = {
  726. DMI_MATCH(DMI_BOARD_VENDOR, "Gigabyte Technology Co.,Ltd."),
  727. DMI_MATCH(DMI_BOARD_NAME, "M1022E"),
  728. DMI_MATCH(DMI_BOARD_VERSION, "1.02"),
  729. },
  730. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  731. },
  732. {
  733. .matches = {
  734. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  735. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv9700"),
  736. DMI_MATCH(DMI_PRODUCT_VERSION, "Rev 1"),
  737. },
  738. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  739. },
  740. {
  741. /*
  742. * HP Pavilion DV4017EA -
  743. * errors on MUX ports are reported without raising AUXDATA
  744. * causing "spurious NAK" messages.
  745. */
  746. .matches = {
  747. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  748. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"),
  749. },
  750. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  751. },
  752. {
  753. /*
  754. * HP Pavilion ZT1000 -
  755. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  756. */
  757. .matches = {
  758. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  759. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"),
  760. DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"),
  761. },
  762. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  763. },
  764. {
  765. /*
  766. * HP Pavilion DV4270ca -
  767. * like DV4017EA does not raise AUXERR for errors on MUX ports.
  768. */
  769. .matches = {
  770. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  771. DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"),
  772. },
  773. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  774. },
  775. {
  776. /* Newer HP Pavilion dv4 models */
  777. .matches = {
  778. DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
  779. DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"),
  780. },
  781. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_NOTIMEOUT)
  782. },
  783. {
  784. /* IBM 2656 */
  785. .matches = {
  786. DMI_MATCH(DMI_SYS_VENDOR, "IBM"),
  787. DMI_MATCH(DMI_PRODUCT_NAME, "2656"),
  788. },
  789. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  790. },
  791. {
  792. /* Avatar AVIU-145A6 */
  793. .matches = {
  794. DMI_MATCH(DMI_SYS_VENDOR, "Intel"),
  795. DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
  796. },
  797. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  798. },
  799. {
  800. /* Intel MBO Desktop D845PESV */
  801. .matches = {
  802. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  803. DMI_MATCH(DMI_BOARD_NAME, "D845PESV"),
  804. },
  805. .driver_data = (void *)(SERIO_QUIRK_NOPNP)
  806. },
  807. {
  808. /*
  809. * Intel NUC D54250WYK - does not have i8042 controller but
  810. * declares PS/2 devices in DSDT.
  811. */
  812. .matches = {
  813. DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"),
  814. DMI_MATCH(DMI_BOARD_NAME, "D54250WYK"),
  815. },
  816. .driver_data = (void *)(SERIO_QUIRK_NOPNP)
  817. },
  818. {
  819. /* Lenovo 3000 n100 */
  820. .matches = {
  821. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  822. DMI_MATCH(DMI_PRODUCT_NAME, "076804U"),
  823. },
  824. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  825. },
  826. {
  827. /* Lenovo XiaoXin Air 12 */
  828. .matches = {
  829. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  830. DMI_MATCH(DMI_PRODUCT_NAME, "80UN"),
  831. },
  832. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  833. },
  834. {
  835. /* Lenovo LaVie Z */
  836. .matches = {
  837. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  838. DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"),
  839. },
  840. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  841. },
  842. {
  843. /* Lenovo Ideapad U455 */
  844. .matches = {
  845. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  846. DMI_MATCH(DMI_PRODUCT_NAME, "20046"),
  847. },
  848. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  849. },
  850. {
  851. /* Lenovo ThinkPad L460 */
  852. .matches = {
  853. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  854. DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad L460"),
  855. },
  856. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  857. },
  858. {
  859. /* Lenovo ThinkPad Twist S230u */
  860. .matches = {
  861. DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
  862. DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
  863. },
  864. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  865. },
  866. {
  867. /* LG Electronics X110 */
  868. .matches = {
  869. DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."),
  870. DMI_MATCH(DMI_BOARD_NAME, "X110"),
  871. },
  872. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  873. },
  874. {
  875. /* Medion Akoya Mini E1210 */
  876. .matches = {
  877. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  878. DMI_MATCH(DMI_PRODUCT_NAME, "E1210"),
  879. },
  880. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  881. },
  882. {
  883. /* Medion Akoya E1222 */
  884. .matches = {
  885. DMI_MATCH(DMI_SYS_VENDOR, "MEDION"),
  886. DMI_MATCH(DMI_PRODUCT_NAME, "E122X"),
  887. },
  888. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  889. },
  890. {
  891. /* MSI Wind U-100 */
  892. .matches = {
  893. DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
  894. DMI_MATCH(DMI_BOARD_NAME, "U-100"),
  895. },
  896. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOPNP)
  897. },
  898. {
  899. /*
  900. * No data is coming from the touchscreen unless KBC
  901. * is in legacy mode.
  902. */
  903. /* Panasonic CF-29 */
  904. .matches = {
  905. DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"),
  906. DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"),
  907. },
  908. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  909. },
  910. {
  911. /* Medion Akoya E7225 */
  912. .matches = {
  913. DMI_MATCH(DMI_SYS_VENDOR, "Medion"),
  914. DMI_MATCH(DMI_PRODUCT_NAME, "Akoya E7225"),
  915. DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
  916. },
  917. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  918. },
  919. {
  920. /* Microsoft Virtual Machine */
  921. .matches = {
  922. DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
  923. DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
  924. DMI_MATCH(DMI_PRODUCT_VERSION, "VS2005R2"),
  925. },
  926. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  927. },
  928. {
  929. /* Medion MAM 2070 */
  930. .matches = {
  931. DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
  932. DMI_MATCH(DMI_PRODUCT_NAME, "MAM 2070"),
  933. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  934. },
  935. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  936. },
  937. {
  938. /* TUXEDO BU1406 */
  939. .matches = {
  940. DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
  941. DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
  942. },
  943. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  944. },
  945. {
  946. /* OQO Model 01 */
  947. .matches = {
  948. DMI_MATCH(DMI_SYS_VENDOR, "OQO"),
  949. DMI_MATCH(DMI_PRODUCT_NAME, "ZEPTO"),
  950. DMI_MATCH(DMI_PRODUCT_VERSION, "00"),
  951. },
  952. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  953. },
  954. {
  955. .matches = {
  956. DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"),
  957. DMI_MATCH(DMI_PRODUCT_NAME, "C15B"),
  958. },
  959. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  960. },
  961. {
  962. /* Acer Aspire 5 A515 */
  963. .matches = {
  964. DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
  965. DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
  966. },
  967. .driver_data = (void *)(SERIO_QUIRK_NOPNP)
  968. },
  969. {
  970. /* ULI EV4873 - AUX LOOP does not work properly */
  971. .matches = {
  972. DMI_MATCH(DMI_SYS_VENDOR, "ULI"),
  973. DMI_MATCH(DMI_PRODUCT_NAME, "EV4873"),
  974. DMI_MATCH(DMI_PRODUCT_VERSION, "5a"),
  975. },
  976. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  977. },
  978. {
  979. /*
  980. * Arima-Rioworks HDAMB -
  981. * AUX LOOP command does not raise AUX IRQ
  982. */
  983. .matches = {
  984. DMI_MATCH(DMI_BOARD_VENDOR, "RIOWORKS"),
  985. DMI_MATCH(DMI_BOARD_NAME, "HDAMB"),
  986. DMI_MATCH(DMI_BOARD_VERSION, "Rev E"),
  987. },
  988. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  989. },
  990. {
  991. /* Sharp Actius MM20 */
  992. .matches = {
  993. DMI_MATCH(DMI_SYS_VENDOR, "SHARP"),
  994. DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"),
  995. },
  996. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  997. },
  998. {
  999. /*
  1000. * Sony Vaio FZ-240E -
  1001. * reset and GET ID commands issued via KBD port are
  1002. * sometimes being delivered to AUX3.
  1003. */
  1004. .matches = {
  1005. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  1006. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"),
  1007. },
  1008. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1009. },
  1010. {
  1011. /*
  1012. * Most (all?) VAIOs do not have external PS/2 ports nor
  1013. * they implement active multiplexing properly, and
  1014. * MUX discovery usually messes up keyboard/touchpad.
  1015. */
  1016. .matches = {
  1017. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  1018. DMI_MATCH(DMI_BOARD_NAME, "VAIO"),
  1019. },
  1020. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1021. },
  1022. {
  1023. /* Sony Vaio FS-115b */
  1024. .matches = {
  1025. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  1026. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"),
  1027. },
  1028. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1029. },
  1030. {
  1031. /*
  1032. * Sony Vaio VGN-CS series require MUX or the touch sensor
  1033. * buttons will disturb touchpad operation
  1034. */
  1035. .matches = {
  1036. DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
  1037. DMI_MATCH(DMI_PRODUCT_NAME, "VGN-CS"),
  1038. },
  1039. .driver_data = (void *)(SERIO_QUIRK_FORCEMUX)
  1040. },
  1041. {
  1042. .matches = {
  1043. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  1044. DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
  1045. },
  1046. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1047. },
  1048. {
  1049. .matches = {
  1050. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  1051. DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"),
  1052. },
  1053. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1054. },
  1055. {
  1056. .matches = {
  1057. DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
  1058. DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"),
  1059. },
  1060. .driver_data = (void *)(SERIO_QUIRK_NOMUX)
  1061. },
  1062. /*
  1063. * A lot of modern Clevo barebones have touchpad and/or keyboard issues
  1064. * after suspend fixable with nomux + reset + noloop + nopnp. Luckily,
  1065. * none of them have an external PS/2 port so this can safely be set for
  1066. * all of them. These two are based on a Clevo design, but have the
  1067. * board_name changed.
  1068. */
  1069. {
  1070. .matches = {
  1071. DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
  1072. DMI_MATCH(DMI_BOARD_NAME, "AURA1501"),
  1073. },
  1074. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1075. },
  1076. {
  1077. .matches = {
  1078. DMI_MATCH(DMI_BOARD_VENDOR, "TUXEDO"),
  1079. DMI_MATCH(DMI_BOARD_NAME, "EDUBOOK1502"),
  1080. },
  1081. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1082. },
  1083. {
  1084. /* Mivvy M310 */
  1085. .matches = {
  1086. DMI_MATCH(DMI_SYS_VENDOR, "VIOOO"),
  1087. DMI_MATCH(DMI_PRODUCT_NAME, "N10"),
  1088. },
  1089. .driver_data = (void *)(SERIO_QUIRK_RESET_ALWAYS)
  1090. },
  1091. /*
  1092. * Some laptops need keyboard reset before probing for the trackpad to get
  1093. * it detected, initialised & finally work.
  1094. */
  1095. {
  1096. /* Schenker XMG C504 - Elantech touchpad */
  1097. .matches = {
  1098. DMI_MATCH(DMI_SYS_VENDOR, "XMG"),
  1099. DMI_MATCH(DMI_PRODUCT_NAME, "C504"),
  1100. },
  1101. .driver_data = (void *)(SERIO_QUIRK_KBDRESET)
  1102. },
  1103. {
  1104. /* Blue FB5601 */
  1105. .matches = {
  1106. DMI_MATCH(DMI_SYS_VENDOR, "blue"),
  1107. DMI_MATCH(DMI_PRODUCT_NAME, "FB5601"),
  1108. DMI_MATCH(DMI_PRODUCT_VERSION, "M606"),
  1109. },
  1110. .driver_data = (void *)(SERIO_QUIRK_NOLOOP)
  1111. },
  1112. /*
  1113. * Some TongFang barebones have touchpad and/or keyboard issues after
  1114. * suspend fixable with nomux + reset + noloop + nopnp. Luckily, none of
  1115. * them have an external PS/2 port so this can safely be set for all of
  1116. * them.
  1117. * TongFang barebones come with board_vendor and/or system_vendor set to
  1118. * a different value for each individual reseller. The only somewhat
  1119. * universal way to identify them is by board_name.
  1120. */
  1121. {
  1122. .matches = {
  1123. DMI_MATCH(DMI_BOARD_NAME, "GM6XGxX"),
  1124. },
  1125. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1126. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1127. },
  1128. {
  1129. .matches = {
  1130. DMI_MATCH(DMI_BOARD_NAME, "GMxXGxx"),
  1131. },
  1132. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1133. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1134. },
  1135. {
  1136. .matches = {
  1137. DMI_MATCH(DMI_BOARD_NAME, "GMxXGxX"),
  1138. },
  1139. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1140. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1141. },
  1142. {
  1143. .matches = {
  1144. DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),
  1145. },
  1146. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1147. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1148. },
  1149. {
  1150. .matches = {
  1151. DMI_MATCH(DMI_BOARD_NAME, "XxHP4NAx"),
  1152. },
  1153. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1154. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1155. },
  1156. {
  1157. .matches = {
  1158. DMI_MATCH(DMI_BOARD_NAME, "XxKK4NAx_XxSP4NAx"),
  1159. },
  1160. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1161. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1162. },
  1163. {
  1164. .matches = {
  1165. DMI_MATCH(DMI_BOARD_NAME, "X5KK45xS_X5SP45xS"),
  1166. },
  1167. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1168. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1169. },
  1170. {
  1171. .matches = {
  1172. DMI_MATCH(DMI_BOARD_NAME, "X6KK45xU_X6SP45xU"),
  1173. },
  1174. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1175. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1176. },
  1177. {
  1178. .matches = {
  1179. DMI_MATCH(DMI_BOARD_NAME, "WUJIE Series-X5SP4NAG"),
  1180. },
  1181. .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
  1182. SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
  1183. },
  1184. /*
  1185. * A lot of modern Clevo barebones have touchpad and/or keyboard issues
  1186. * after suspend fixable with the forcenorestore quirk.
  1187. * Clevo barebones come with board_vendor and/or system_vendor set to
  1188. * either the very generic string "Notebook" and/or a different value
  1189. * for each individual reseller. The only somewhat universal way to
  1190. * identify them is by board_name.
  1191. */
  1192. {
  1193. .matches = {
  1194. DMI_MATCH(DMI_BOARD_NAME, "LAPQC71A"),
  1195. },
  1196. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1197. },
  1198. {
  1199. .matches = {
  1200. DMI_MATCH(DMI_BOARD_NAME, "LAPQC71B"),
  1201. },
  1202. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1203. },
  1204. {
  1205. .matches = {
  1206. DMI_MATCH(DMI_BOARD_NAME, "N140CU"),
  1207. },
  1208. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1209. },
  1210. {
  1211. .matches = {
  1212. DMI_MATCH(DMI_BOARD_NAME, "N141CU"),
  1213. },
  1214. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1215. },
  1216. {
  1217. .matches = {
  1218. DMI_MATCH(DMI_BOARD_NAME, "N150CU"),
  1219. },
  1220. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1221. },
  1222. {
  1223. .matches = {
  1224. DMI_MATCH(DMI_BOARD_NAME, "NH5xAx"),
  1225. },
  1226. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1227. },
  1228. {
  1229. .matches = {
  1230. DMI_MATCH(DMI_BOARD_NAME, "NHxxRZQ"),
  1231. },
  1232. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1233. },
  1234. {
  1235. .matches = {
  1236. DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"),
  1237. },
  1238. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1239. },
  1240. /*
  1241. * At least one modern Clevo barebone has the touchpad connected both
  1242. * via PS/2 and i2c interface. This causes a race condition between the
  1243. * psmouse and i2c-hid driver. Since the full capability of the touchpad
  1244. * is available via the i2c interface and the device has no external
  1245. * PS/2 port, it is safe to just ignore all ps2 mouses here to avoid
  1246. * this issue. The known affected device is the
  1247. * TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU which comes with one of
  1248. * the two different dmi strings below. NS50MU is not a typo!
  1249. */
  1250. {
  1251. .matches = {
  1252. DMI_MATCH(DMI_BOARD_NAME, "NS50MU"),
  1253. },
  1254. .driver_data = (void *)(SERIO_QUIRK_NOAUX |
  1255. SERIO_QUIRK_FORCENORESTORE)
  1256. },
  1257. {
  1258. .matches = {
  1259. DMI_MATCH(DMI_BOARD_NAME, "NS50_70MU"),
  1260. },
  1261. .driver_data = (void *)(SERIO_QUIRK_NOAUX |
  1262. SERIO_QUIRK_FORCENORESTORE)
  1263. },
  1264. {
  1265. .matches = {
  1266. DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
  1267. },
  1268. .driver_data = (void *)(SERIO_QUIRK_NOAUX)
  1269. },
  1270. {
  1271. .matches = {
  1272. DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
  1273. },
  1274. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1275. },
  1276. {
  1277. .matches = {
  1278. DMI_MATCH(DMI_BOARD_NAME, "P640RE"),
  1279. },
  1280. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1281. },
  1282. {
  1283. /*
  1284. * This is only a partial board_name and might be followed by
  1285. * another letter or number. DMI_MATCH however does do partial
  1286. * matching.
  1287. */
  1288. .matches = {
  1289. DMI_MATCH(DMI_PRODUCT_NAME, "P65xH"),
  1290. },
  1291. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1292. },
  1293. {
  1294. /* Clevo P650RS, 650RP6, Sager NP8152-S, and others */
  1295. .matches = {
  1296. DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
  1297. },
  1298. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1299. },
  1300. {
  1301. /*
  1302. * This is only a partial board_name and might be followed by
  1303. * another letter or number. DMI_MATCH however does do partial
  1304. * matching.
  1305. */
  1306. .matches = {
  1307. DMI_MATCH(DMI_PRODUCT_NAME, "P65_P67H"),
  1308. },
  1309. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1310. },
  1311. {
  1312. /*
  1313. * This is only a partial board_name and might be followed by
  1314. * another letter or number. DMI_MATCH however does do partial
  1315. * matching.
  1316. */
  1317. .matches = {
  1318. DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RP"),
  1319. },
  1320. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1321. },
  1322. {
  1323. /*
  1324. * This is only a partial board_name and might be followed by
  1325. * another letter or number. DMI_MATCH however does do partial
  1326. * matching.
  1327. */
  1328. .matches = {
  1329. DMI_MATCH(DMI_PRODUCT_NAME, "P65_67RS"),
  1330. },
  1331. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1332. },
  1333. {
  1334. /*
  1335. * This is only a partial board_name and might be followed by
  1336. * another letter or number. DMI_MATCH however does do partial
  1337. * matching.
  1338. */
  1339. .matches = {
  1340. DMI_MATCH(DMI_PRODUCT_NAME, "P67xRP"),
  1341. },
  1342. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1343. },
  1344. {
  1345. .matches = {
  1346. DMI_MATCH(DMI_BOARD_NAME, "PB50_70DFx,DDx"),
  1347. },
  1348. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1349. },
  1350. {
  1351. .matches = {
  1352. DMI_MATCH(DMI_BOARD_NAME, "PB51RF"),
  1353. },
  1354. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1355. },
  1356. {
  1357. .matches = {
  1358. DMI_MATCH(DMI_BOARD_NAME, "PB71RD"),
  1359. },
  1360. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1361. },
  1362. {
  1363. .matches = {
  1364. DMI_MATCH(DMI_BOARD_NAME, "PC70DR"),
  1365. },
  1366. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1367. },
  1368. {
  1369. .matches = {
  1370. DMI_MATCH(DMI_BOARD_NAME, "PCX0DX"),
  1371. },
  1372. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1373. },
  1374. {
  1375. .matches = {
  1376. DMI_MATCH(DMI_BOARD_NAME, "PCX0DX_GN20"),
  1377. },
  1378. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1379. },
  1380. /* See comment on TUXEDO InfinityBook S17 Gen6 / Clevo NS70MU above */
  1381. {
  1382. .matches = {
  1383. DMI_MATCH(DMI_BOARD_NAME, "PD5x_7xPNP_PNR_PNN_PNT"),
  1384. },
  1385. .driver_data = (void *)(SERIO_QUIRK_NOAUX)
  1386. },
  1387. {
  1388. .matches = {
  1389. DMI_MATCH(DMI_BOARD_NAME, "X170SM"),
  1390. },
  1391. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1392. },
  1393. {
  1394. .matches = {
  1395. DMI_MATCH(DMI_BOARD_NAME, "X170KM-G"),
  1396. },
  1397. .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
  1398. },
  1399. {
  1400. /*
  1401. * The Ayaneo Kun is a handheld device where some the buttons
  1402. * are handled by an AT keyboard. The keyboard is usually
  1403. * detected as raw, but sometimes, usually after a cold boot,
  1404. * it is detected as translated. Make sure that the keyboard
  1405. * is always in raw mode.
  1406. */
  1407. .matches = {
  1408. DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "AYANEO"),
  1409. DMI_MATCH(DMI_BOARD_NAME, "KUN"),
  1410. },
  1411. .driver_data = (void *)(SERIO_QUIRK_DIRECT)
  1412. },
  1413. { }
  1414. };
  1415. #ifdef CONFIG_PNP
  1416. static const struct dmi_system_id i8042_dmi_laptop_table[] __initconst = {
  1417. {
  1418. .matches = {
  1419. DMI_MATCH(DMI_CHASSIS_TYPE, "8"), /* Portable */
  1420. },
  1421. },
  1422. {
  1423. .matches = {
  1424. DMI_MATCH(DMI_CHASSIS_TYPE, "9"), /* Laptop */
  1425. },
  1426. },
  1427. {
  1428. .matches = {
  1429. DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */
  1430. },
  1431. },
  1432. {
  1433. .matches = {
  1434. DMI_MATCH(DMI_CHASSIS_TYPE, "14"), /* Sub-Notebook */
  1435. },
  1436. },
  1437. { }
  1438. };
  1439. #endif
  1440. #endif /* CONFIG_X86 */
  1441. #ifdef CONFIG_PNP
  1442. #include <linux/pnp.h>
  1443. static bool i8042_pnp_kbd_registered;
  1444. static unsigned int i8042_pnp_kbd_devices;
  1445. static bool i8042_pnp_aux_registered;
  1446. static unsigned int i8042_pnp_aux_devices;
  1447. static int i8042_pnp_command_reg;
  1448. static int i8042_pnp_data_reg;
  1449. static int i8042_pnp_kbd_irq;
  1450. static int i8042_pnp_aux_irq;
  1451. static char i8042_pnp_kbd_name[32];
  1452. static char i8042_pnp_aux_name[32];
  1453. static void i8042_pnp_id_to_string(struct pnp_id *id, char *dst, int dst_size)
  1454. {
  1455. strscpy(dst, "PNP:", dst_size);
  1456. while (id) {
  1457. strlcat(dst, " ", dst_size);
  1458. strlcat(dst, id->id, dst_size);
  1459. id = id->next;
  1460. }
  1461. }
  1462. static int i8042_pnp_kbd_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  1463. {
  1464. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  1465. i8042_pnp_data_reg = pnp_port_start(dev,0);
  1466. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  1467. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  1468. if (pnp_irq_valid(dev,0))
  1469. i8042_pnp_kbd_irq = pnp_irq(dev, 0);
  1470. strscpy(i8042_pnp_kbd_name, did->id, sizeof(i8042_pnp_kbd_name));
  1471. if (strlen(pnp_dev_name(dev))) {
  1472. strlcat(i8042_pnp_kbd_name, ":", sizeof(i8042_pnp_kbd_name));
  1473. strlcat(i8042_pnp_kbd_name, pnp_dev_name(dev), sizeof(i8042_pnp_kbd_name));
  1474. }
  1475. i8042_pnp_id_to_string(dev->id, i8042_kbd_firmware_id,
  1476. sizeof(i8042_kbd_firmware_id));
  1477. i8042_kbd_fwnode = dev_fwnode(&dev->dev);
  1478. /* Keyboard ports are always supposed to be wakeup-enabled */
  1479. device_set_wakeup_enable(&dev->dev, true);
  1480. i8042_pnp_kbd_devices++;
  1481. return 0;
  1482. }
  1483. static int i8042_pnp_aux_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
  1484. {
  1485. if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
  1486. i8042_pnp_data_reg = pnp_port_start(dev,0);
  1487. if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
  1488. i8042_pnp_command_reg = pnp_port_start(dev, 1);
  1489. if (pnp_irq_valid(dev, 0))
  1490. i8042_pnp_aux_irq = pnp_irq(dev, 0);
  1491. strscpy(i8042_pnp_aux_name, did->id, sizeof(i8042_pnp_aux_name));
  1492. if (strlen(pnp_dev_name(dev))) {
  1493. strlcat(i8042_pnp_aux_name, ":", sizeof(i8042_pnp_aux_name));
  1494. strlcat(i8042_pnp_aux_name, pnp_dev_name(dev), sizeof(i8042_pnp_aux_name));
  1495. }
  1496. i8042_pnp_id_to_string(dev->id, i8042_aux_firmware_id,
  1497. sizeof(i8042_aux_firmware_id));
  1498. i8042_pnp_aux_devices++;
  1499. return 0;
  1500. }
  1501. static const struct pnp_device_id pnp_kbd_devids[] = {
  1502. { .id = "PNP0300", .driver_data = 0 },
  1503. { .id = "PNP0301", .driver_data = 0 },
  1504. { .id = "PNP0302", .driver_data = 0 },
  1505. { .id = "PNP0303", .driver_data = 0 },
  1506. { .id = "PNP0304", .driver_data = 0 },
  1507. { .id = "PNP0305", .driver_data = 0 },
  1508. { .id = "PNP0306", .driver_data = 0 },
  1509. { .id = "PNP0309", .driver_data = 0 },
  1510. { .id = "PNP030a", .driver_data = 0 },
  1511. { .id = "PNP030b", .driver_data = 0 },
  1512. { .id = "PNP0320", .driver_data = 0 },
  1513. { .id = "PNP0343", .driver_data = 0 },
  1514. { .id = "PNP0344", .driver_data = 0 },
  1515. { .id = "PNP0345", .driver_data = 0 },
  1516. { .id = "CPQA0D7", .driver_data = 0 },
  1517. { .id = "", },
  1518. };
  1519. MODULE_DEVICE_TABLE(pnp, pnp_kbd_devids);
  1520. static struct pnp_driver i8042_pnp_kbd_driver = {
  1521. .name = "i8042 kbd",
  1522. .id_table = pnp_kbd_devids,
  1523. .probe = i8042_pnp_kbd_probe,
  1524. .driver = {
  1525. .probe_type = PROBE_FORCE_SYNCHRONOUS,
  1526. .suppress_bind_attrs = true,
  1527. },
  1528. };
  1529. static const struct pnp_device_id pnp_aux_devids[] = {
  1530. { .id = "AUI0200", .driver_data = 0 },
  1531. { .id = "FJC6000", .driver_data = 0 },
  1532. { .id = "FJC6001", .driver_data = 0 },
  1533. { .id = "PNP0f03", .driver_data = 0 },
  1534. { .id = "PNP0f0b", .driver_data = 0 },
  1535. { .id = "PNP0f0e", .driver_data = 0 },
  1536. { .id = "PNP0f12", .driver_data = 0 },
  1537. { .id = "PNP0f13", .driver_data = 0 },
  1538. { .id = "PNP0f19", .driver_data = 0 },
  1539. { .id = "PNP0f1c", .driver_data = 0 },
  1540. { .id = "SYN0801", .driver_data = 0 },
  1541. { .id = "", },
  1542. };
  1543. MODULE_DEVICE_TABLE(pnp, pnp_aux_devids);
  1544. static struct pnp_driver i8042_pnp_aux_driver = {
  1545. .name = "i8042 aux",
  1546. .id_table = pnp_aux_devids,
  1547. .probe = i8042_pnp_aux_probe,
  1548. .driver = {
  1549. .probe_type = PROBE_FORCE_SYNCHRONOUS,
  1550. .suppress_bind_attrs = true,
  1551. },
  1552. };
  1553. static void i8042_pnp_exit(void)
  1554. {
  1555. if (i8042_pnp_kbd_registered) {
  1556. i8042_pnp_kbd_registered = false;
  1557. pnp_unregister_driver(&i8042_pnp_kbd_driver);
  1558. }
  1559. if (i8042_pnp_aux_registered) {
  1560. i8042_pnp_aux_registered = false;
  1561. pnp_unregister_driver(&i8042_pnp_aux_driver);
  1562. }
  1563. }
  1564. static int __init i8042_pnp_init(void)
  1565. {
  1566. char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
  1567. bool pnp_data_busted = false;
  1568. int err;
  1569. if (i8042_nopnp) {
  1570. pr_info("PNP detection disabled\n");
  1571. return 0;
  1572. }
  1573. err = pnp_register_driver(&i8042_pnp_kbd_driver);
  1574. if (!err)
  1575. i8042_pnp_kbd_registered = true;
  1576. err = pnp_register_driver(&i8042_pnp_aux_driver);
  1577. if (!err)
  1578. i8042_pnp_aux_registered = true;
  1579. if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
  1580. i8042_pnp_exit();
  1581. #if defined(__ia64__)
  1582. return -ENODEV;
  1583. #else
  1584. pr_info("PNP: No PS/2 controller found.\n");
  1585. #if defined(__loongarch__)
  1586. if (acpi_disabled == 0)
  1587. return -ENODEV;
  1588. #else
  1589. if (x86_platform.legacy.i8042 !=
  1590. X86_LEGACY_I8042_EXPECTED_PRESENT)
  1591. return -ENODEV;
  1592. #endif
  1593. pr_info("Probing ports directly.\n");
  1594. return 0;
  1595. #endif
  1596. }
  1597. if (i8042_pnp_kbd_devices)
  1598. snprintf(kbd_irq_str, sizeof(kbd_irq_str),
  1599. "%d", i8042_pnp_kbd_irq);
  1600. if (i8042_pnp_aux_devices)
  1601. snprintf(aux_irq_str, sizeof(aux_irq_str),
  1602. "%d", i8042_pnp_aux_irq);
  1603. pr_info("PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
  1604. i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  1605. i8042_pnp_aux_name,
  1606. i8042_pnp_data_reg, i8042_pnp_command_reg,
  1607. kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ? "," : "",
  1608. aux_irq_str);
  1609. #if defined(__ia64__)
  1610. if (!i8042_pnp_kbd_devices)
  1611. i8042_nokbd = true;
  1612. if (!i8042_pnp_aux_devices)
  1613. i8042_noaux = true;
  1614. #endif
  1615. if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
  1616. i8042_pnp_data_reg != i8042_data_reg) ||
  1617. !i8042_pnp_data_reg) {
  1618. pr_warn("PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
  1619. i8042_pnp_data_reg, i8042_data_reg);
  1620. i8042_pnp_data_reg = i8042_data_reg;
  1621. pnp_data_busted = true;
  1622. }
  1623. if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
  1624. i8042_pnp_command_reg != i8042_command_reg) ||
  1625. !i8042_pnp_command_reg) {
  1626. pr_warn("PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
  1627. i8042_pnp_command_reg, i8042_command_reg);
  1628. i8042_pnp_command_reg = i8042_command_reg;
  1629. pnp_data_busted = true;
  1630. }
  1631. if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
  1632. pr_warn("PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
  1633. i8042_kbd_irq);
  1634. i8042_pnp_kbd_irq = i8042_kbd_irq;
  1635. pnp_data_busted = true;
  1636. }
  1637. if (!i8042_noaux && !i8042_pnp_aux_irq) {
  1638. if (!pnp_data_busted && i8042_pnp_kbd_irq) {
  1639. pr_warn("PNP: PS/2 appears to have AUX port disabled, "
  1640. "if this is incorrect please boot with i8042.nopnp\n");
  1641. i8042_noaux = true;
  1642. } else {
  1643. pr_warn("PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
  1644. i8042_aux_irq);
  1645. i8042_pnp_aux_irq = i8042_aux_irq;
  1646. }
  1647. }
  1648. i8042_data_reg = i8042_pnp_data_reg;
  1649. i8042_command_reg = i8042_pnp_command_reg;
  1650. i8042_kbd_irq = i8042_pnp_kbd_irq;
  1651. i8042_aux_irq = i8042_pnp_aux_irq;
  1652. #ifdef CONFIG_X86
  1653. i8042_bypass_aux_irq_test = !pnp_data_busted &&
  1654. dmi_check_system(i8042_dmi_laptop_table);
  1655. #endif
  1656. return 0;
  1657. }
  1658. #else /* !CONFIG_PNP */
  1659. static inline int i8042_pnp_init(void) { return 0; }
  1660. static inline void i8042_pnp_exit(void) { }
  1661. #endif /* CONFIG_PNP */
  1662. #ifdef CONFIG_X86
  1663. static void __init i8042_check_quirks(void)
  1664. {
  1665. const struct dmi_system_id *device_quirk_info;
  1666. uintptr_t quirks;
  1667. device_quirk_info = dmi_first_match(i8042_dmi_quirk_table);
  1668. if (!device_quirk_info)
  1669. return;
  1670. quirks = (uintptr_t)device_quirk_info->driver_data;
  1671. if (quirks & SERIO_QUIRK_NOKBD)
  1672. i8042_nokbd = true;
  1673. if (quirks & SERIO_QUIRK_NOAUX)
  1674. i8042_noaux = true;
  1675. if (quirks & SERIO_QUIRK_NOMUX)
  1676. i8042_nomux = true;
  1677. if (quirks & SERIO_QUIRK_FORCEMUX)
  1678. i8042_nomux = false;
  1679. if (quirks & SERIO_QUIRK_UNLOCK)
  1680. i8042_unlock = true;
  1681. if (quirks & SERIO_QUIRK_PROBE_DEFER)
  1682. i8042_probe_defer = true;
  1683. /* Honor module parameter when value is not default */
  1684. if (i8042_reset == I8042_RESET_DEFAULT) {
  1685. if (quirks & SERIO_QUIRK_RESET_ALWAYS)
  1686. i8042_reset = I8042_RESET_ALWAYS;
  1687. if (quirks & SERIO_QUIRK_RESET_NEVER)
  1688. i8042_reset = I8042_RESET_NEVER;
  1689. }
  1690. if (quirks & SERIO_QUIRK_DIRECT)
  1691. i8042_direct = true;
  1692. if (quirks & SERIO_QUIRK_DUMBKBD)
  1693. i8042_dumbkbd = true;
  1694. if (quirks & SERIO_QUIRK_NOLOOP)
  1695. i8042_noloop = true;
  1696. if (quirks & SERIO_QUIRK_NOTIMEOUT)
  1697. i8042_notimeout = true;
  1698. if (quirks & SERIO_QUIRK_KBDRESET)
  1699. i8042_kbdreset = true;
  1700. if (quirks & SERIO_QUIRK_DRITEK)
  1701. i8042_dritek = true;
  1702. #ifdef CONFIG_PNP
  1703. if (quirks & SERIO_QUIRK_NOPNP)
  1704. i8042_nopnp = true;
  1705. #endif
  1706. if (quirks & SERIO_QUIRK_FORCENORESTORE)
  1707. i8042_forcenorestore = true;
  1708. }
  1709. #else
  1710. static inline void i8042_check_quirks(void) {}
  1711. #endif
  1712. static int __init i8042_platform_init(void)
  1713. {
  1714. int retval;
  1715. #ifdef CONFIG_X86
  1716. u8 a20_on = 0xdf;
  1717. /* Just return if platform does not have i8042 controller */
  1718. if (x86_platform.legacy.i8042 == X86_LEGACY_I8042_PLATFORM_ABSENT)
  1719. return -ENODEV;
  1720. #endif
  1721. /*
  1722. * On ix86 platforms touching the i8042 data register region can do really
  1723. * bad things. Because of this the region is always reserved on ix86 boxes.
  1724. *
  1725. * if (!request_region(I8042_DATA_REG, 16, "i8042"))
  1726. * return -EBUSY;
  1727. */
  1728. i8042_kbd_irq = I8042_MAP_IRQ(1);
  1729. i8042_aux_irq = I8042_MAP_IRQ(12);
  1730. #if defined(__ia64__)
  1731. i8042_reset = I8042_RESET_ALWAYS;
  1732. #endif
  1733. i8042_check_quirks();
  1734. pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
  1735. i8042_nokbd ? " nokbd" : "",
  1736. i8042_noaux ? " noaux" : "",
  1737. i8042_nomux ? " nomux" : "",
  1738. i8042_unlock ? " unlock" : "",
  1739. i8042_probe_defer ? "probe_defer" : "",
  1740. i8042_reset == I8042_RESET_DEFAULT ?
  1741. "" : i8042_reset == I8042_RESET_ALWAYS ?
  1742. " reset_always" : " reset_never",
  1743. i8042_direct ? " direct" : "",
  1744. i8042_dumbkbd ? " dumbkbd" : "",
  1745. i8042_noloop ? " noloop" : "",
  1746. i8042_notimeout ? " notimeout" : "",
  1747. i8042_kbdreset ? " kbdreset" : "",
  1748. #ifdef CONFIG_X86
  1749. i8042_dritek ? " dritek" : "",
  1750. #else
  1751. "",
  1752. #endif
  1753. #ifdef CONFIG_PNP
  1754. i8042_nopnp ? " nopnp" : "",
  1755. #else
  1756. "",
  1757. #endif
  1758. i8042_forcenorestore ? " forcenorestore" : "");
  1759. retval = i8042_pnp_init();
  1760. if (retval)
  1761. return retval;
  1762. #ifdef CONFIG_X86
  1763. /*
  1764. * A20 was already enabled during early kernel init. But some buggy
  1765. * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
  1766. * resume from S3. So we do it here and hope that nothing breaks.
  1767. */
  1768. i8042_command(&a20_on, 0x10d1);
  1769. i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
  1770. #endif /* CONFIG_X86 */
  1771. return retval;
  1772. }
  1773. static inline void i8042_platform_exit(void)
  1774. {
  1775. i8042_pnp_exit();
  1776. }
  1777. #endif /* _I8042_ACPIPNPIO_H */