silead_dmi.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. /*
  2. * Silead 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 silead_ts_dmi_data {
  22. const char *acpi_name;
  23. const struct property_entry *properties;
  24. };
  25. static const struct property_entry cube_iwork8_air_props[] = {
  26. PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
  27. PROPERTY_ENTRY_U32("touchscreen-size-y", 900),
  28. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  29. PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-cube-iwork8-air.fw"),
  30. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  31. { }
  32. };
  33. static const struct silead_ts_dmi_data cube_iwork8_air_data = {
  34. .acpi_name = "MSSL1680:00",
  35. .properties = cube_iwork8_air_props,
  36. };
  37. static const struct property_entry jumper_ezpad_mini3_props[] = {
  38. PROPERTY_ENTRY_U32("touchscreen-size-x", 1700),
  39. PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
  40. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  41. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-jumper-ezpad-mini3.fw"),
  42. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  43. { }
  44. };
  45. static const struct silead_ts_dmi_data jumper_ezpad_mini3_data = {
  46. .acpi_name = "MSSL1680:00",
  47. .properties = jumper_ezpad_mini3_props,
  48. };
  49. static const struct property_entry jumper_ezpad_6_pro_props[] = {
  50. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  51. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  52. PROPERTY_ENTRY_STRING("firmware-name", "gsl3692-jumper-ezpad-6-pro.fw"),
  53. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  54. PROPERTY_ENTRY_BOOL("silead,home-button"),
  55. { }
  56. };
  57. static const struct silead_ts_dmi_data jumper_ezpad_6_pro_data = {
  58. .acpi_name = "MSSL1680:00",
  59. .properties = jumper_ezpad_6_pro_props,
  60. };
  61. static const struct property_entry dexp_ursus_7w_props[] = {
  62. PROPERTY_ENTRY_U32("touchscreen-size-x", 890),
  63. PROPERTY_ENTRY_U32("touchscreen-size-y", 630),
  64. PROPERTY_ENTRY_STRING("firmware-name", "gsl1686-dexp-ursus-7w.fw"),
  65. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  66. PROPERTY_ENTRY_BOOL("silead,home-button"),
  67. { }
  68. };
  69. static const struct silead_ts_dmi_data dexp_ursus_7w_data = {
  70. .acpi_name = "MSSL1680:00",
  71. .properties = dexp_ursus_7w_props,
  72. };
  73. static const struct property_entry surftab_twin_10_1_st10432_8_props[] = {
  74. PROPERTY_ENTRY_U32("touchscreen-size-x", 1900),
  75. PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
  76. PROPERTY_ENTRY_U32("touchscreen-inverted-y", 1),
  77. PROPERTY_ENTRY_STRING("firmware-name",
  78. "gsl3670-surftab-twin-10-1-st10432-8.fw"),
  79. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  80. { }
  81. };
  82. static const struct silead_ts_dmi_data surftab_twin_10_1_st10432_8_data = {
  83. .acpi_name = "MSSL1680:00",
  84. .properties = surftab_twin_10_1_st10432_8_props,
  85. };
  86. static const struct property_entry surftab_wintron70_st70416_6_props[] = {
  87. PROPERTY_ENTRY_U32("touchscreen-size-x", 884),
  88. PROPERTY_ENTRY_U32("touchscreen-size-y", 632),
  89. PROPERTY_ENTRY_STRING("firmware-name",
  90. "gsl1686-surftab-wintron70-st70416-6.fw"),
  91. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  92. PROPERTY_ENTRY_BOOL("silead,home-button"),
  93. { }
  94. };
  95. static const struct silead_ts_dmi_data surftab_wintron70_st70416_6_data = {
  96. .acpi_name = "MSSL1680:00",
  97. .properties = surftab_wintron70_st70416_6_props,
  98. };
  99. static const struct property_entry gp_electronic_t701_props[] = {
  100. PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
  101. PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
  102. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  103. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  104. PROPERTY_ENTRY_STRING("firmware-name",
  105. "gsl1680-gp-electronic-t701.fw"),
  106. { }
  107. };
  108. static const struct silead_ts_dmi_data gp_electronic_t701_data = {
  109. .acpi_name = "MSSL1680:00",
  110. .properties = gp_electronic_t701_props,
  111. };
  112. static const struct property_entry pipo_w2s_props[] = {
  113. PROPERTY_ENTRY_U32("touchscreen-size-x", 1660),
  114. PROPERTY_ENTRY_U32("touchscreen-size-y", 880),
  115. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  116. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  117. PROPERTY_ENTRY_STRING("firmware-name",
  118. "gsl1680-pipo-w2s.fw"),
  119. { }
  120. };
  121. static const struct silead_ts_dmi_data pipo_w2s_data = {
  122. .acpi_name = "MSSL1680:00",
  123. .properties = pipo_w2s_props,
  124. };
  125. static const struct property_entry pov_mobii_wintab_p800w_v20_props[] = {
  126. PROPERTY_ENTRY_U32("touchscreen-min-x", 32),
  127. PROPERTY_ENTRY_U32("touchscreen-min-y", 16),
  128. PROPERTY_ENTRY_U32("touchscreen-size-x", 1692),
  129. PROPERTY_ENTRY_U32("touchscreen-size-y", 1146),
  130. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  131. PROPERTY_ENTRY_STRING("firmware-name",
  132. "gsl3680-pov-mobii-wintab-p800w-v20.fw"),
  133. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  134. PROPERTY_ENTRY_BOOL("silead,home-button"),
  135. { }
  136. };
  137. static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_v20_data = {
  138. .acpi_name = "MSSL1680:00",
  139. .properties = pov_mobii_wintab_p800w_v20_props,
  140. };
  141. static const struct property_entry pov_mobii_wintab_p800w_v21_props[] = {
  142. PROPERTY_ENTRY_U32("touchscreen-size-x", 1800),
  143. PROPERTY_ENTRY_U32("touchscreen-size-y", 1150),
  144. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  145. PROPERTY_ENTRY_STRING("firmware-name",
  146. "gsl3692-pov-mobii-wintab-p800w.fw"),
  147. PROPERTY_ENTRY_BOOL("silead,home-button"),
  148. { }
  149. };
  150. static const struct silead_ts_dmi_data pov_mobii_wintab_p800w_v21_data = {
  151. .acpi_name = "MSSL1680:00",
  152. .properties = pov_mobii_wintab_p800w_v21_props,
  153. };
  154. static const struct property_entry itworks_tw891_props[] = {
  155. PROPERTY_ENTRY_U32("touchscreen-size-x", 1600),
  156. PROPERTY_ENTRY_U32("touchscreen-size-y", 890),
  157. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  158. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  159. PROPERTY_ENTRY_STRING("firmware-name", "gsl3670-itworks-tw891.fw"),
  160. { }
  161. };
  162. static const struct silead_ts_dmi_data itworks_tw891_data = {
  163. .acpi_name = "MSSL1680:00",
  164. .properties = itworks_tw891_props,
  165. };
  166. static const struct property_entry chuwi_hi8_pro_props[] = {
  167. PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
  168. PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
  169. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  170. PROPERTY_ENTRY_STRING("firmware-name", "gsl3680-chuwi-hi8-pro.fw"),
  171. PROPERTY_ENTRY_BOOL("silead,home-button"),
  172. { }
  173. };
  174. static const struct silead_ts_dmi_data chuwi_hi8_pro_data = {
  175. .acpi_name = "MSSL1680:00",
  176. .properties = chuwi_hi8_pro_props,
  177. };
  178. static const struct property_entry digma_citi_e200_props[] = {
  179. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  180. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  181. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  182. PROPERTY_ENTRY_STRING("firmware-name",
  183. "gsl1686-digma_citi_e200.fw"),
  184. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  185. PROPERTY_ENTRY_BOOL("silead,home-button"),
  186. { }
  187. };
  188. static const struct silead_ts_dmi_data digma_citi_e200_data = {
  189. .acpi_name = "MSSL1680:00",
  190. .properties = digma_citi_e200_props,
  191. };
  192. static const struct property_entry onda_obook_20_plus_props[] = {
  193. PROPERTY_ENTRY_U32("touchscreen-size-x", 1728),
  194. PROPERTY_ENTRY_U32("touchscreen-size-y", 1148),
  195. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  196. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  197. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  198. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-onda-obook-20-plus.fw"),
  199. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  200. PROPERTY_ENTRY_BOOL("silead,home-button"),
  201. { }
  202. };
  203. static const struct silead_ts_dmi_data onda_obook_20_plus_data = {
  204. .acpi_name = "MSSL1680:00",
  205. .properties = onda_obook_20_plus_props,
  206. };
  207. static const struct property_entry chuwi_hi8_props[] = {
  208. PROPERTY_ENTRY_U32("touchscreen-size-x", 1665),
  209. PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
  210. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  211. PROPERTY_ENTRY_BOOL("silead,home-button"),
  212. PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-chuwi-hi8.fw"),
  213. { }
  214. };
  215. static const struct silead_ts_dmi_data chuwi_hi8_data = {
  216. .acpi_name = "MSSL0001:00",
  217. .properties = chuwi_hi8_props,
  218. };
  219. static const struct property_entry chuwi_vi8_props[] = {
  220. PROPERTY_ENTRY_U32("touchscreen-size-x", 1724),
  221. PROPERTY_ENTRY_U32("touchscreen-size-y", 1140),
  222. PROPERTY_ENTRY_BOOL("touchscreen-swapped-x-y"),
  223. PROPERTY_ENTRY_STRING("firmware-name", "gsl3676-chuwi-vi8.fw"),
  224. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  225. PROPERTY_ENTRY_BOOL("silead,home-button"),
  226. { }
  227. };
  228. static const struct silead_ts_dmi_data chuwi_vi8_data = {
  229. .acpi_name = "MSSL1680:00",
  230. .properties = chuwi_vi8_props,
  231. };
  232. static const struct property_entry trekstor_primebook_c13_props[] = {
  233. PROPERTY_ENTRY_U32("touchscreen-size-x", 2624),
  234. PROPERTY_ENTRY_U32("touchscreen-size-y", 1920),
  235. PROPERTY_ENTRY_STRING("firmware-name",
  236. "gsl1680-trekstor-primebook-c13.fw"),
  237. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  238. PROPERTY_ENTRY_BOOL("silead,home-button"),
  239. { }
  240. };
  241. static const struct silead_ts_dmi_data trekstor_primebook_c13_data = {
  242. .acpi_name = "MSSL1680:00",
  243. .properties = trekstor_primebook_c13_props,
  244. };
  245. static const struct property_entry teclast_x98plus2_props[] = {
  246. PROPERTY_ENTRY_U32("touchscreen-size-x", 2048),
  247. PROPERTY_ENTRY_U32("touchscreen-size-y", 1280),
  248. PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
  249. PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
  250. PROPERTY_ENTRY_STRING("firmware-name",
  251. "gsl1686-teclast_x98plus2.fw"),
  252. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  253. { }
  254. };
  255. static const struct silead_ts_dmi_data teclast_x98plus2_data = {
  256. .acpi_name = "MSSL1680:00",
  257. .properties = teclast_x98plus2_props,
  258. };
  259. static const struct property_entry teclast_x3_plus_props[] = {
  260. PROPERTY_ENTRY_U32("touchscreen-size-x", 1980),
  261. PROPERTY_ENTRY_U32("touchscreen-size-y", 1500),
  262. PROPERTY_ENTRY_STRING("firmware-name", "gsl1680-teclast-x3-plus.fw"),
  263. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  264. PROPERTY_ENTRY_BOOL("silead,home-button"),
  265. { }
  266. };
  267. static const struct silead_ts_dmi_data teclast_x3_plus_data = {
  268. .acpi_name = "MSSL1680:00",
  269. .properties = teclast_x3_plus_props,
  270. };
  271. static const struct property_entry onda_v891w_v1_props[] = {
  272. PROPERTY_ENTRY_U32("touchscreen-min-x", 46),
  273. PROPERTY_ENTRY_U32("touchscreen-min-y", 8),
  274. PROPERTY_ENTRY_U32("touchscreen-size-x", 1676),
  275. PROPERTY_ENTRY_U32("touchscreen-size-y", 1130),
  276. PROPERTY_ENTRY_STRING("firmware-name",
  277. "gsl3680-onda-v891w-v1.fw"),
  278. PROPERTY_ENTRY_U32("silead,max-fingers", 10),
  279. PROPERTY_ENTRY_BOOL("silead,home-button"),
  280. { }
  281. };
  282. static const struct silead_ts_dmi_data onda_v891w_v1_data = {
  283. .acpi_name = "MSSL1680:00",
  284. .properties = onda_v891w_v1_props,
  285. };
  286. static const struct dmi_system_id silead_ts_dmi_table[] = {
  287. {
  288. /* CUBE iwork8 Air */
  289. .driver_data = (void *)&cube_iwork8_air_data,
  290. .matches = {
  291. DMI_MATCH(DMI_SYS_VENDOR, "cube"),
  292. DMI_MATCH(DMI_PRODUCT_NAME, "i1-TF"),
  293. DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
  294. },
  295. },
  296. {
  297. /* Jumper EZpad mini3 */
  298. .driver_data = (void *)&jumper_ezpad_mini3_data,
  299. .matches = {
  300. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  301. /* jumperx.T87.KFBNEEA02 with the version-nr dropped */
  302. DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"),
  303. },
  304. },
  305. {
  306. /* Jumper EZpad 6 Pro */
  307. .driver_data = (void *)&jumper_ezpad_6_pro_data,
  308. .matches = {
  309. DMI_MATCH(DMI_SYS_VENDOR, "Jumper"),
  310. DMI_MATCH(DMI_PRODUCT_NAME, "EZpad"),
  311. DMI_MATCH(DMI_BIOS_VERSION, "5.12"),
  312. /* Above matches are too generic, add bios-date match */
  313. DMI_MATCH(DMI_BIOS_DATE, "08/18/2017"),
  314. },
  315. },
  316. {
  317. /* DEXP Ursus 7W */
  318. .driver_data = (void *)&dexp_ursus_7w_data,
  319. .matches = {
  320. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  321. DMI_MATCH(DMI_PRODUCT_NAME, "7W"),
  322. },
  323. },
  324. {
  325. /* TrekStor SurfTab twin 10.1 ST10432-8 */
  326. .driver_data = (void *)&surftab_twin_10_1_st10432_8_data,
  327. .matches = {
  328. DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
  329. DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab twin 10.1"),
  330. },
  331. },
  332. {
  333. /* Trekstor Surftab Wintron 7.0 ST70416-6 */
  334. .driver_data = (void *)&surftab_wintron70_st70416_6_data,
  335. .matches = {
  336. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  337. DMI_MATCH(DMI_PRODUCT_NAME, "ST70416-6"),
  338. /* Exact match, different versions need different fw */
  339. DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA04"),
  340. },
  341. },
  342. {
  343. /* Trekstor Surftab Wintron 7.0 ST70416-6, newer BIOS */
  344. .driver_data = (void *)&surftab_wintron70_st70416_6_data,
  345. .matches = {
  346. DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"),
  347. DMI_MATCH(DMI_PRODUCT_NAME,
  348. "SurfTab wintron 7.0 ST70416-6"),
  349. /* Exact match, different versions need different fw */
  350. DMI_MATCH(DMI_BIOS_VERSION, "TREK.G.WI71C.JGBMRBA05"),
  351. },
  352. },
  353. {
  354. /* Ployer Momo7w (same hardware as the Trekstor ST70416-6) */
  355. .driver_data = (void *)&surftab_wintron70_st70416_6_data,
  356. .matches = {
  357. DMI_MATCH(DMI_SYS_VENDOR, "Shenzhen PLOYER"),
  358. DMI_MATCH(DMI_PRODUCT_NAME, "MOMO7W"),
  359. /* Exact match, different versions need different fw */
  360. DMI_MATCH(DMI_BIOS_VERSION, "MOMO.G.WI71C.MABMRBA02"),
  361. },
  362. },
  363. {
  364. /* GP-electronic T701 */
  365. .driver_data = (void *)&gp_electronic_t701_data,
  366. .matches = {
  367. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  368. DMI_MATCH(DMI_PRODUCT_NAME, "T701"),
  369. DMI_MATCH(DMI_BIOS_VERSION, "BYT70A.YNCHENG.WIN.007"),
  370. },
  371. },
  372. {
  373. /* Pipo W2S */
  374. .driver_data = (void *)&pipo_w2s_data,
  375. .matches = {
  376. DMI_MATCH(DMI_SYS_VENDOR, "PIPO"),
  377. DMI_MATCH(DMI_PRODUCT_NAME, "W2S"),
  378. },
  379. },
  380. {
  381. /* Point of View mobii wintab p800w (v2.0) */
  382. .driver_data = (void *)&pov_mobii_wintab_p800w_v20_data,
  383. .matches = {
  384. DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
  385. DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
  386. DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1014"),
  387. /* Above matches are too generic, add bios-date match */
  388. DMI_MATCH(DMI_BIOS_DATE, "10/24/2014"),
  389. },
  390. },
  391. {
  392. /* Point of View mobii wintab p800w (v2.1) */
  393. .driver_data = (void *)&pov_mobii_wintab_p800w_v21_data,
  394. .matches = {
  395. DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
  396. DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
  397. DMI_MATCH(DMI_BIOS_VERSION, "3BAIR1013"),
  398. /* Above matches are too generic, add bios-date match */
  399. DMI_MATCH(DMI_BIOS_DATE, "08/22/2014"),
  400. },
  401. },
  402. {
  403. /* I.T.Works TW891 */
  404. .driver_data = (void *)&itworks_tw891_data,
  405. .matches = {
  406. DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
  407. DMI_MATCH(DMI_PRODUCT_NAME, "TW891"),
  408. },
  409. },
  410. {
  411. /* Chuwi Hi8 Pro */
  412. .driver_data = (void *)&chuwi_hi8_pro_data,
  413. .matches = {
  414. DMI_MATCH(DMI_SYS_VENDOR, "Hampoo"),
  415. DMI_MATCH(DMI_PRODUCT_NAME, "X1D3_C806N"),
  416. },
  417. },
  418. {
  419. /* Digma Citi E200 */
  420. .driver_data = (void *)&digma_citi_e200_data,
  421. .matches = {
  422. DMI_MATCH(DMI_SYS_VENDOR, "Digma"),
  423. DMI_MATCH(DMI_PRODUCT_NAME, "CITI E200"),
  424. DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
  425. },
  426. },
  427. {
  428. /* Onda oBook 20 Plus */
  429. .driver_data = (void *)&onda_obook_20_plus_data,
  430. .matches = {
  431. DMI_MATCH(DMI_SYS_VENDOR, "ONDA"),
  432. DMI_MATCH(DMI_PRODUCT_NAME, "OBOOK 20 PLUS"),
  433. },
  434. },
  435. {
  436. /* Chuwi Hi8 */
  437. .driver_data = (void *)&chuwi_hi8_data,
  438. .matches = {
  439. DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
  440. DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
  441. },
  442. },
  443. {
  444. /* Chuwi Hi8 (H1D_S806_206) */
  445. .driver_data = (void *)&chuwi_hi8_data,
  446. .matches = {
  447. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  448. DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
  449. DMI_MATCH(DMI_BIOS_VERSION, "H1D_S806_206"),
  450. },
  451. },
  452. {
  453. /* Chuwi Vi8 (CWI506) */
  454. .driver_data = (void *)&chuwi_vi8_data,
  455. .matches = {
  456. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  457. DMI_MATCH(DMI_PRODUCT_NAME, "i86"),
  458. DMI_MATCH(DMI_BIOS_VERSION, "CHUWI.D86JLBNR"),
  459. },
  460. },
  461. {
  462. /* Trekstor Primebook C13 */
  463. .driver_data = (void *)&trekstor_primebook_c13_data,
  464. .matches = {
  465. DMI_MATCH(DMI_SYS_VENDOR, "TREKSTOR"),
  466. DMI_MATCH(DMI_PRODUCT_NAME, "Primebook C13"),
  467. },
  468. },
  469. {
  470. /* Teclast X98 Plus II */
  471. .driver_data = (void *)&teclast_x98plus2_data,
  472. .matches = {
  473. DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
  474. DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
  475. },
  476. },
  477. {
  478. /* Teclast X3 Plus */
  479. .driver_data = (void *)&teclast_x3_plus_data,
  480. .matches = {
  481. DMI_MATCH(DMI_SYS_VENDOR, "TECLAST"),
  482. DMI_MATCH(DMI_PRODUCT_NAME, "X3 Plus"),
  483. DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
  484. },
  485. },
  486. {
  487. /* I.T.Works TW701 */
  488. .driver_data = (void *)&surftab_wintron70_st70416_6_data,
  489. .matches = {
  490. DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
  491. DMI_MATCH(DMI_PRODUCT_NAME, "i71c"),
  492. DMI_MATCH(DMI_BIOS_VERSION, "itWORKS.G.WI71C.JGBMRB"),
  493. },
  494. },
  495. {
  496. /* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
  497. .driver_data = (void *)&chuwi_vi8_data,
  498. .matches = {
  499. DMI_MATCH(DMI_SYS_VENDOR, "YOURS"),
  500. DMI_MATCH(DMI_PRODUCT_NAME, "Y8W81"),
  501. },
  502. },
  503. {
  504. /* ONDA V891w revision P891WBEBV1B00 aka v1 */
  505. .driver_data = (void *)&onda_v891w_v1_data,
  506. .matches = {
  507. DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "ONDA"),
  508. DMI_EXACT_MATCH(DMI_BOARD_NAME, "ONDA Tablet"),
  509. DMI_EXACT_MATCH(DMI_BOARD_VERSION, "V001"),
  510. /* Exact match, different versions need different fw */
  511. DMI_EXACT_MATCH(DMI_BIOS_VERSION, "ONDA.W89EBBN08"),
  512. },
  513. },
  514. { },
  515. };
  516. static const struct silead_ts_dmi_data *silead_ts_data;
  517. static void silead_ts_dmi_add_props(struct i2c_client *client)
  518. {
  519. struct device *dev = &client->dev;
  520. int error;
  521. if (has_acpi_companion(dev) &&
  522. !strncmp(silead_ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
  523. error = device_add_properties(dev, silead_ts_data->properties);
  524. if (error)
  525. dev_err(dev, "failed to add properties: %d\n", error);
  526. }
  527. }
  528. static int silead_ts_dmi_notifier_call(struct notifier_block *nb,
  529. unsigned long action, void *data)
  530. {
  531. struct device *dev = data;
  532. struct i2c_client *client;
  533. switch (action) {
  534. case BUS_NOTIFY_ADD_DEVICE:
  535. client = i2c_verify_client(dev);
  536. if (client)
  537. silead_ts_dmi_add_props(client);
  538. break;
  539. default:
  540. break;
  541. }
  542. return 0;
  543. }
  544. static struct notifier_block silead_ts_dmi_notifier = {
  545. .notifier_call = silead_ts_dmi_notifier_call,
  546. };
  547. static int __init silead_ts_dmi_init(void)
  548. {
  549. const struct dmi_system_id *dmi_id;
  550. int error;
  551. dmi_id = dmi_first_match(silead_ts_dmi_table);
  552. if (!dmi_id)
  553. return 0; /* Not an error */
  554. silead_ts_data = dmi_id->driver_data;
  555. error = bus_register_notifier(&i2c_bus_type, &silead_ts_dmi_notifier);
  556. if (error)
  557. pr_err("%s: failed to register i2c bus notifier: %d\n",
  558. __func__, error);
  559. return error;
  560. }
  561. /*
  562. * We are registering out notifier after i2c core is initialized and i2c bus
  563. * itself is ready (which happens at postcore initcall level), but before
  564. * ACPI starts enumerating devices (at subsys initcall level).
  565. */
  566. arch_initcall(silead_ts_dmi_init);