touchscreen_dmi.c 25 KB

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