i8042-acpipnpio.h 45 KB

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