touchscreen_dmi.c 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. /*
  2. * Touchscreen driver DMI based configuration code
  3. *
  4. * Copyright (c) 2017 Red Hat Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Red Hat authors:
  12. * Hans de Goede <hdegoede@redhat.com>
  13. */
  14. #include <linux/acpi.h>
  15. #include <linux/device.h>
  16. #include <linux/dmi.h>
  17. #include <linux/i2c.h>
  18. #include <linux/notifier.h>
  19. #include <linux/property.h>
  20. #include <linux/string.h>
  21. struct ts_dmi_data {
  22. const char *acpi_name;
  23. const struct property_entry *properties;
  24. };
  25. /* NOTE: Please keep all entries sorted alphabetically */
  26. static const struct property_entry chuwi_hi8_props[] = {
  27. PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
  28. PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
  29. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  30. PROPERTY_ENTRY_BOOL("silead,home-button"),
  31. PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
  32. { }
  33. };
  34. static const struct ts_dmi_data chuwi_hi8_data = {
  35. .acpi_name = "MSSL0001:00",
  36. .properties = chuwi_hi8_props,
  37. };
  38. static const struct property_entry chuwi_hi8_pro_props[] = {
  39. PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
  40. PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
  41. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  42. PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
  43. PROPERTY_ENTRY_BOOL("silead,home-button"),
  44. { }
  45. };
  46. static const struct ts_dmi_data chuwi_hi8_pro_data = {
  47. .acpi_name = "MSSL1680:00",
  48. .properties = chuwi_hi8_pro_props,
  49. };
  50. static const struct property_entry chuwi_vi8_props[] = {
  51. PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
  52. PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
  53. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  54. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"),
  55. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  56. PROPERTY_ENTRY_BOOL("silead,home-button"),
  57. { }
  58. };
  59. static const struct ts_dmi_data chuwi_vi8_data = {
  60. .acpi_name = "MSSL1680:00",
  61. .properties = chuwi_vi8_props,
  62. };
  63. static const struct property_entry chuwi_vi10_props[] = {
  64. PROPERTY_ENTRY_U32("touchscreen-min-x", 0),
  65. PROPERTY_ENTRY_U32("touchscreen-min-y", 4),
  66. PROPERTY_ENTRY_U32("touchscreen-size-x", 1858),
  67. PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
  68. PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-vi10.fw"),
  69. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  70. PROPERTY_ENTRY_BOOL("silead,home-button"),
  71. { }
  72. };
  73. static const struct ts_dmi_data chuwi_vi10_data = {
  74. .acpi_name = "MSSL0002:00",
  75. .properties = chuwi_vi10_props,
  76. };
  77. static const struct property_entry connect_tablet9_props[] = {
  78. PROPERTY_ENTRY_U32("touchscreen-min-x", 9),
  79. PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
  80. PROPERTY_ENTRY_U32("touchscreen-size-x", 1664),
  81. PROPERTY_ENTRY_U32("touchscreen-size-y", 878),
  82. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  83. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  84. PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-connect-tablet9.fw"),
  85. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  86. { }
  87. };
  88. static const struct ts_dmi_data connect_tablet9_data = {
  89. .acpi_name = "MSSL1680:00",
  90. .properties = connect_tablet9_props,
  91. };
  92. static const struct property_entry cube_iwork8_air_props[] = {
  93. PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
  94. PROPERTY_ENTRY_U32("touchscreen-size-y", 900),
  95. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  96. PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
  97. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  98. { }
  99. };
  100. static const struct ts_dmi_data cube_iwork8_air_data = {
  101. .acpi_name = "MSSL1680:00",
  102. .properties = cube_iwork8_air_props,
  103. };
  104. static const struct property_entry cube_knote_i1101_props[] = {
  105. PROPERTY_ENTRY_U32("touchscreen-min-x", 20),
  106. PROPERTY_ENTRY_U32("touchscreen-min-y", 22),
  107. PROPERTY_ENTRY_U32("touchscreen-size-x", 1961),
  108. PROPERTY_ENTRY_U32("touchscreen-size-y", 1513),
  109. PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-cube-knote-i1101.fw"),
  110. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  111. PROPERTY_ENTRY_BOOL("silead,home-button"),
  112. { }
  113. };
  114. static const struct ts_dmi_data cube_knote_i1101_data = {
  115. .acpi_name = "MSSL1680:00",
  116. .properties = cube_knote_i1101_props,
  117. };
  118. static const struct property_entry dexp_ursus_7w_props[] = {
  119. PROPERTY_ENTRY_U32("touchscreen-size-x", 890),
  120. PROPERTY_ENTRY_U32("touchscreen-size-y", 630),
  121. PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"),
  122. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  123. PROPERTY_ENTRY_BOOL("silead,home-button"),
  124. { }
  125. };
  126. static const struct ts_dmi_data dexp_ursus_7w_data = {
  127. .acpi_name = "MSSL1680:00",
  128. .properties = dexp_ursus_7w_props,
  129. };
  130. static const struct property_entry digma_citi_e200_props[] = {
  131. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  132. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  133. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  134. PROPERTY_ENTRY_STRING("firmware-name",
  135. "gsl1686-digma_citi_e200.fw"),
  136. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  137. PROPERTY_ENTRY_BOOL("silead,home-button"),
  138. { }
  139. };
  140. static const struct ts_dmi_data digma_citi_e200_data = {
  141. .acpi_name = "MSSL1680:00",
  142. .properties = digma_citi_e200_props,
  143. };
  144. static const struct property_entry estar_beauty_hd_props[] = {
  145. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  146. { }
  147. };
  148. static const struct ts_dmi_data estar_beauty_hd_data = {
  149. .acpi_name = "GDIX1001:00",
  150. .properties = estar_beauty_hd_props,
  151. };
  152. static const struct property_entry gp_electronic_t701_props[] = {
  153. PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
  154. PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
  155. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  156. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  157. PROPERTY_ENTRY_STRING("firmware-name",
  158. "gsl1680-gp-electronic-t701.fw"),
  159. { }
  160. };
  161. static const struct ts_dmi_data gp_electronic_t701_data = {
  162. .acpi_name = "MSSL1680:00",
  163. .properties = gp_electronic_t701_props,
  164. };
  165. static const struct property_entry itworks_tw891_props[] = {
  166. PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
  167. PROPERTY_ENTRY_U32("touchscreen-size-y", 890),
  168. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  169. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  170. PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
  171. { }
  172. };
  173. static const struct ts_dmi_data itworks_tw891_data = {
  174. .acpi_name = "MSSL1680:00",
  175. .properties = itworks_tw891_props,
  176. };
  177. static const struct property_entry jumper_ezpad_6_pro_props[] = {
  178. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  179. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  180. PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"),
  181. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  182. PROPERTY_ENTRY_BOOL("silead,home-button"),
  183. { }
  184. };
  185. static const struct ts_dmi_data jumper_ezpad_6_pro_data = {
  186. .acpi_name = "MSSL1680:00",
  187. .properties = jumper_ezpad_6_pro_props,
  188. };
  189. static const struct property_entry jumper_ezpad_mini3_props[] = {
  190. PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
  191. PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
  192. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  193. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
  194. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  195. { }
  196. };
  197. static const struct ts_dmi_data jumper_ezpad_mini3_data = {
  198. .acpi_name = "MSSL1680:00",
  199. .properties = jumper_ezpad_mini3_props,
  200. };
  201. static const struct property_entry onda_obook_20_plus_props[] = {
  202. PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
  203. PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
  204. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  205. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  206. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  207. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
  208. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  209. PROPERTY_ENTRY_BOOL("silead,home-button"),
  210. { }
  211. };
  212. static const struct ts_dmi_data onda_obook_20_plus_data = {
  213. .acpi_name = "MSSL1680:00",
  214. .properties = onda_obook_20_plus_props,
  215. };
  216. static const struct property_entry onda_v820w_32g_props[] = {
  217. PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
  218. PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
  219. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  220. PROPERTY_ENTRY_STRING("firmware-name",
  221. "gsl1680-onda-v820w-32g.fw"),
  222. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  223. PROPERTY_ENTRY_BOOL("silead,home-button"),
  224. { }
  225. };
  226. static const struct ts_dmi_data onda_v820w_32g_data = {
  227. .acpi_name = "MSSL1680:00",
  228. .properties = onda_v820w_32g_props,
  229. };
  230. static const struct property_entry onda_v891w_v1_props[] = {
  231. PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
  232. PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
  233. PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
  234. PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
  235. PROPERTY_ENTRY_STRING("firmware-name",
  236. "gsl3680-onda-v891w-v1.fw"),
  237. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  238. PROPERTY_ENTRY_BOOL("silead,home-button"),
  239. { }
  240. };
  241. static const struct ts_dmi_data onda_v891w_v1_data = {
  242. .acpi_name = "MSSL1680:00",
  243. .properties = onda_v891w_v1_props,
  244. };
  245. static const struct property_entry onda_v891w_v3_props[] = {
  246. PROPERTY_ENTRY_U32("touchscreen-min-x", 35),
  247. PROPERTY_ENTRY_U32("touchscreen-min-y", 15),
  248. PROPERTY_ENTRY_U32("touchscreen-size-x", 1625),
  249. PROPERTY_ENTRY_U32("touchscreen-size-y", 1135),
  250. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  251. PROPERTY_ENTRY_STRING("firmware-name",
  252. "gsl3676-onda-v891w-v3.fw"),
  253. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  254. PROPERTY_ENTRY_BOOL("silead,home-button"),
  255. { }
  256. };
  257. static const struct ts_dmi_data onda_v891w_v3_data = {
  258. .acpi_name = "MSSL1680:00",
  259. .properties = onda_v891w_v3_props,
  260. };
  261. static const struct property_entry pipo_w2s_props[] = {
  262. PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
  263. PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
  264. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  265. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  266. PROPERTY_ENTRY_STRING("firmware-name",
  267. "gsl1680-pipo-w2s.fw"),
  268. { }
  269. };
  270. static const struct ts_dmi_data pipo_w2s_data = {
  271. .acpi_name = "MSSL1680:00",
  272. .properties = pipo_w2s_props,
  273. };
  274. static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
  275. PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
  276. PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
  277. PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
  278. PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
  279. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  280. PROPERTY_ENTRY_STRING("firmware-name",
  281. "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
  282. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  283. PROPERTY_ENTRY_BOOL("silead,home-button"),
  284. { }
  285. };
  286. static const struct ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
  287. .acpi_name = "MSSL1680:00",
  288. .properties = pov_mobii_wintab_p800w_v20_props,
  289. };
  290. static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
  291. PROPERTY_ENTRY_U32("touchscreen-size-x", 1800),
  292. PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
  293. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  294. PROPERTY_ENTRY_STRING("firmware-name",
  295. "gsl3692-pov-mobii-wintab-p800w.fw"),
  296. PROPERTY_ENTRY_BOOL("silead,home-button"),
  297. { }
  298. };
  299. static const struct ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
  300. .acpi_name = "MSSL1680:00",
  301. .properties = pov_mobii_wintab_p800w_v21_props,
  302. };
  303. static const struct property_entry teclast_x3_plus_props[] = {
  304. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  305. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  306. PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
  307. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  308. PROPERTY_ENTRY_BOOL("silead,home-button"),
  309. { }
  310. };
  311. static const struct ts_dmi_data teclast_x3_plus_data = {
  312. .acpi_name = "MSSL1680:00",
  313. .properties = teclast_x3_plus_props,
  314. };
  315. static const struct property_entry teclast_x98plus2_props[] = {
  316. PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
  317. PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
  318. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  319. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  320. PROPERTY_ENTRY_STRING("firmware-name",
  321. "gsl1686-teclast_x98plus2.fw"),
  322. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  323. { }
  324. };
  325. static const struct ts_dmi_data teclast_x98plus2_data = {
  326. .acpi_name = "MSSL1680:00",
  327. .properties = teclast_x98plus2_props,
  328. };
  329. static const struct property_entry trekstor_primebook_c13_props[] = {
  330. PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
  331. PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
  332. PROPERTY_ENTRY_STRING("firmware-name",
  333. "gsl1680-trekstor-primebook-c13.fw"),
  334. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  335. PROPERTY_ENTRY_BOOL("silead,home-button"),
  336. { }
  337. };
  338. static const struct ts_dmi_data trekstor_primebook_c13_data = {
  339. .acpi_name = "MSSL1680:00",
  340. .properties = trekstor_primebook_c13_props,
  341. };
  342. static const struct property_entry trekstor_surftab_twin_10_1_props[] = {
  343. PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
  344. PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
  345. PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
  346. PROPERTY_ENTRY_STRING("firmware-name",
  347. "gsl3670-surftab-twin-10-1-st10432-8.fw"),
  348. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  349. { }
  350. };
  351. static const struct ts_dmi_data trekstor_surftab_twin_10_1_data = {
  352. .acpi_name = "MSSL1680:00",
  353. .properties = trekstor_surftab_twin_10_1_props,
  354. };
  355. static const struct property_entry trekstor_surftab_wintron70_props[] = {
  356. PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
  357. PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
  358. PROPERTY_ENTRY_STRING("firmware-name",
  359. "gsl1686-surftab-wintron70-st70416-6.fw"),
  360. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  361. PROPERTY_ENTRY_BOOL("silead,home-button"),
  362. { }
  363. };
  364. static const struct ts_dmi_data trekstor_surftab_wintron70_data = {
  365. .acpi_name = "MSSL1680:00",
  366. .properties = trekstor_surftab_wintron70_props,
  367. };
  368. /* NOTE: Please keep this table sorted alphabetically */
  369. static const struct dmi_system_id touchscreen_dmi_table[] = {
  370. {
  371. /* Chuwi Hi8 */
  372. .driver_data = (void *)&chuwi_hi8_data,
  373. .matches = {
  374. DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
  375. DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
  376. },
  377. },
  378. {
  379. /* Chuwi Hi8 (H1D_S806_206) */
  380. .driver_data = (void *)&chuwi_hi8_data,
  381. .matches = {
  382. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  383. DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
  384. DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
  385. },
  386. },
  387. {
  388. /* Chuwi Hi8 Pro (CWI513) */
  389. .driver_data = (void *)&chuwi_hi8_pro_data,
  390. .matches = {
  391. DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
  392. DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
  393. },
  394. },
  395. {
  396. /* Chuwi Vi8 (CWI506) */
  397. .driver_data = (void *)&chuwi_vi8_data,
  398. .matches = {
  399. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  400. DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
  401. DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
  402. },
  403. },
  404. {
  405. /* Chuwi Vi10 (CWI505) */
  406. .driver_data = (void *)&chuwi_vi10_data,
  407. .matches = {
  408. DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
  409. DMI_MATCH(DMI_BOARD_NAME, "BYT-PF02"),
  410. DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
  411. DMI_MATCH(DMI_PRODUCT_NAME, "S165"),
  412. },
  413. },
  414. {
  415. /* Connect Tablet 9 */
  416. .driver_data = (void *)&connect_tablet9_data,
  417. .matches = {
  418. DMI_MATCH(DMI_SYS_VENDOR, "Connect"),
  419. DMI_MATCH(DMI_PRODUCT_NAME, "Tablet 9"),
  420. },
  421. },
  422. {
  423. /* CUBE iwork8 Air */
  424. .driver_data = (void *)&cube_iwork8_air_data,
  425. .matches = {
  426. DMI_MATCH(DMI_SYS_VENDOR, "cube"),
  427. DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
  428. DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
  429. },
  430. },
  431. {
  432. /* Cube KNote i1101 */
  433. .driver_data = (void *)&cube_knote_i1101_data,
  434. .matches = {
  435. DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
  436. DMI_MATCH(DMI_BOARD_NAME, "L1W6_I1101"),
  437. DMI_MATCH(DMI_SYS_VENDOR, "ALLDOCUBE"),
  438. DMI_MATCH(DMI_PRODUCT_NAME, "i1101"),
  439. },
  440. },
  441. {
  442. /* DEXP Ursus 7W */
  443. .driver_data = (void *)&dexp_ursus_7w_data,
  444. .matches = {
  445. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  446. DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
  447. },
  448. },
  449. {
  450. /* Digma Citi E200 */
  451. .driver_data = (void *)&digma_citi_e200_data,
  452. .matches = {
  453. DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
  454. DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
  455. DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
  456. },
  457. },
  458. {
  459. /* Estar Beauty HD (MID 7316R) */
  460. .driver_data = (void *)&estar_beauty_hd_data,
  461. .matches = {
  462. DMI_MATCH(DMI_SYS_VENDOR, "Estar"),
  463. DMI_MATCH(DMI_PRODUCT_NAME, "eSTAR BEAUTY HD Intel Quad core"),
  464. },
  465. },
  466. {
  467. /* GP-electronic T701 */
  468. .driver_data = (void *)&gp_electronic_t701_data,
  469. .matches = {
  470. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  471. DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
  472. DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
  473. },
  474. },
  475. {
  476. /* I.T.Works TW701 (same hardware as the Trekstor ST70416-6) */
  477. .driver_data = (void *)&trekstor_surftab_wintron70_data,
  478. .matches = {
  479. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  480. DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
  481. DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
  482. },
  483. },
  484. {
  485. /* I.T.Works TW891 */
  486. .driver_data = (void *)&itworks_tw891_data,
  487. .matches = {
  488. DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
  489. DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
  490. },
  491. },
  492. {
  493. /* Jumper EZpad 6 Pro */
  494. .driver_data = (void *)&jumper_ezpad_6_pro_data,
  495. .matches = {
  496. DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
  497. DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
  498. DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
  499. /* Above matches are too generic, add bios-date match */
  500. DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
  501. },
  502. },
  503. {
  504. /* Jumper EZpad mini3 */
  505. .driver_data = (void *)&jumper_ezpad_mini3_data,
  506. .matches = {
  507. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  508. /* jumperx.T87.KFBNEEA02 with the version-nr dropped */
  509. DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
  510. },
  511. },
  512. {
  513. /* Onda oBook 20 Plus */
  514. .driver_data = (void *)&onda_obook_20_plus_data,
  515. .matches = {
  516. DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
  517. DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
  518. },
  519. },
  520. {
  521. /* ONDA V820w DualOS */
  522. .driver_data = (void *)&onda_v820w_32g_data,
  523. .matches = {
  524. DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
  525. DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "V820w DualOS")
  526. },
  527. },
  528. {
  529. /* ONDA V891w revision P891WBEBV1B00 aka v1 */
  530. .driver_data = (void *)&onda_v891w_v1_data,
  531. .matches = {
  532. DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
  533. DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
  534. DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
  535. /* Exact match, different versions need different fw */
  536. DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
  537. },
  538. },
  539. {
  540. /* ONDA V891w Dual OS P891DCF2V1A01274 64GB */
  541. .driver_data = (void *)&onda_v891w_v3_data,
  542. .matches = {
  543. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  544. DMI_MATCH(DMI_PRODUCT_NAME, "ONDA Tablet"),
  545. DMI_MATCH(DMI_BIOS_VERSION, "ONDA.D890HBBNR0A"),
  546. },
  547. },
  548. {
  549. /* Pipo W2S */
  550. .driver_data = (void *)&pipo_w2s_data,
  551. .matches = {
  552. DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
  553. DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
  554. },
  555. },
  556. {
  557. /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
  558. .driver_data = (void *)&trekstor_surftab_wintron70_data,
  559. .matches = {
  560. DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
  561. DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
  562. /* Exact match, different versions need different fw */
  563. DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
  564. },
  565. },
  566. {
  567. /* Point of View mobii wintab p800w (v2.0) */
  568. .driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
  569. .matches = {
  570. DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
  571. DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
  572. DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
  573. /* Above matches are too generic, add bios-date match */
  574. DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
  575. },
  576. },
  577. {
  578. /* Point of View mobii wintab p800w (v2.1) */
  579. .driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
  580. .matches = {
  581. DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
  582. DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
  583. DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
  584. /* Above matches are too generic, add bios-date match */
  585. DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
  586. },
  587. },
  588. {
  589. /* Teclast X3 Plus */
  590. .driver_data = (void *)&teclast_x3_plus_data,
  591. .matches = {
  592. DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
  593. DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
  594. DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
  595. },
  596. },
  597. {
  598. /* Teclast X98 Plus II */
  599. .driver_data = (void *)&teclast_x98plus2_data,
  600. .matches = {
  601. DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
  602. DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
  603. },
  604. },
  605. {
  606. /* Trekstor Primebook C13 */
  607. .driver_data = (void *)&trekstor_primebook_c13_data,
  608. .matches = {
  609. DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
  610. DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
  611. },
  612. },
  613. {
  614. /* TrekStor SurfTab twin 10.1 ST10432-8 */
  615. .driver_data = (void *)&trekstor_surftab_twin_10_1_data,
  616. .matches = {
  617. DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
  618. DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
  619. },
  620. },
  621. {
  622. /* Trekstor Surftab Wintron 7.0 ST70416-6 */
  623. .driver_data = (void *)&trekstor_surftab_wintron70_data,
  624. .matches = {
  625. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  626. DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
  627. /* Exact match, different versions need different fw */
  628. DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
  629. },
  630. },
  631. {
  632. /* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
  633. .driver_data = (void *)&trekstor_surftab_wintron70_data,
  634. .matches = {
  635. DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
  636. DMI_MATCH(DMI_PRODUCT_NAME,
  637. "SurfTab wintron 7.0 ST70416-6"),
  638. /* Exact match, different versions need different fw */
  639. DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
  640. },
  641. },
  642. {
  643. /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
  644. .driver_data = (void *)&chuwi_vi8_data,
  645. .matches = {
  646. DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
  647. DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
  648. },
  649. },
  650. { },
  651. };
  652. static const struct ts_dmi_data *ts_data;
  653. static void ts_dmi_add_props(struct i2c_client *client)
  654. {
  655. struct device *dev = &client->dev;
  656. int error;
  657. if (has_acpi_companion(dev) &&
  658. !strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
  659. error = device_add_properties(dev, ts_data->properties);
  660. if (error)
  661. dev_err(dev, "failed to add properties: %d\n", error);
  662. }
  663. }
  664. static int ts_dmi_notifier_call(struct notifier_block *nb,
  665. unsigned long action, void *data)
  666. {
  667. struct device *dev = data;
  668. struct i2c_client *client;
  669. switch (action) {
  670. case BUS_NOTIFY_ADD_DEVICE:
  671. client = i2c_verify_client(dev);
  672. if (client)
  673. ts_dmi_add_props(client);
  674. break;
  675. default:
  676. break;
  677. }
  678. return 0;
  679. }
  680. static struct notifier_block ts_dmi_notifier = {
  681. .notifier_call = ts_dmi_notifier_call,
  682. };
  683. static int __init ts_dmi_init(void)
  684. {
  685. const struct dmi_system_id *dmi_id;
  686. int error;
  687. dmi_id = dmi_first_match(touchscreen_dmi_table);
  688. if (!dmi_id)
  689. return 0; /* Not an error */
  690. ts_data = dmi_id->driver_data;
  691. error = bus_register_notifier(&i2c_bus_type, &ts_dmi_notifier);
  692. if (error)
  693. pr_err("%s: failed to register i2c bus notifier: %d\n",
  694. __func__, error);
  695. return error;
  696. }
  697. /*
  698. * We are registering out notifier after i2c core is initialized and i2c bus
  699. * itself is ready (which happens at postcore initcall level), but before
  700. * ACPI starts enumerating devices (at subsys initcall level).
  701. */
  702. arch_initcall(ts_dmi_init);