xref: /linux/drivers/platform/x86/x86-android-tablets/dmi.c (revision 6093a688a07da07808f0122f9aa2a3eed250d853)
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * DMI based code to deal with broken DSDTs on X86 tablets which ship with
4  * Android as (part of) the factory image. The factory kernels shipped on these
5  * devices typically have a bunch of things hardcoded, rather than specified
6  * in their DSDT.
7  *
8  * Copyright (C) 2021-2023 Hans de Goede <hansg@kernel.org>
9  */
10 
11 #include <linux/dmi.h>
12 #include <linux/init.h>
13 #include <linux/mod_devicetable.h>
14 #include <linux/module.h>
15 
16 #include "x86-android-tablets.h"
17 
18 const struct dmi_system_id x86_android_tablet_ids[] __initconst = {
19 	{
20 		/* Acer Iconia One 8 A1-840 (non FHD version) */
21 		.matches = {
22 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
23 			DMI_MATCH(DMI_PRODUCT_NAME, "BayTrail"),
24 			/* Above strings are too generic also match BIOS date */
25 			DMI_MATCH(DMI_BIOS_DATE, "04/01/2014"),
26 		},
27 		.driver_data = (void *)&acer_a1_840_info,
28 	},
29 	{
30 		/* Acer Iconia One 7 B1-750 */
31 		.matches = {
32 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
33 			DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
34 		},
35 		.driver_data = (void *)&acer_b1_750_info,
36 	},
37 	{
38 		/* Advantech MICA-071 */
39 		.matches = {
40 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Advantech"),
41 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"),
42 		},
43 		.driver_data = (void *)&advantech_mica_071_info,
44 	},
45 	{
46 		/* Asus MeMO Pad 7 ME176C */
47 		.matches = {
48 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
49 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ME176C"),
50 		},
51 		.driver_data = (void *)&asus_me176c_info,
52 	},
53 	{
54 		/* Asus TF103C */
55 		.matches = {
56 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
57 			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
58 		},
59 		.driver_data = (void *)&asus_tf103c_info,
60 	},
61 	{
62 		/* Chuwi Hi8 (CWI509) */
63 		.matches = {
64 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
65 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PA03C"),
66 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
67 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
68 		},
69 		.driver_data = (void *)&chuwi_hi8_info,
70 	},
71 	{
72 		/* Cyberbook T116 Android version */
73 		.matches = {
74 			DMI_MATCH(DMI_BOARD_VENDOR, "Default string"),
75 			DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"),
76 			/* Above strings are much too generic, also match on SKU + BIOS date */
77 			DMI_MATCH(DMI_PRODUCT_SKU, "20170531"),
78 			DMI_MATCH(DMI_BIOS_DATE, "07/12/2017"),
79 		},
80 		.driver_data = (void *)&cyberbook_t116_info,
81 	},
82 	{
83 		/* CZC P10T */
84 		.ident = "CZC ODEON TPC-10 (\"P10T\")",
85 		.matches = {
86 			DMI_MATCH(DMI_SYS_VENDOR, "CZC"),
87 			DMI_MATCH(DMI_PRODUCT_NAME, "ODEON*TPC-10"),
88 		},
89 		.driver_data = (void *)&czc_p10t,
90 	},
91 	{
92 		/* CZC P10T variant */
93 		.ident = "ViewSonic ViewPad 10",
94 		.matches = {
95 			DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
96 			DMI_MATCH(DMI_PRODUCT_NAME, "VPAD10"),
97 		},
98 		.driver_data = (void *)&czc_p10t,
99 	},
100 	{
101 		/* Lenovo Yoga Book X90F / X90L */
102 		.matches = {
103 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
104 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
105 			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
106 		},
107 		.driver_data = (void *)&lenovo_yogabook_x90_info,
108 	},
109 	{
110 		/* Lenovo Yoga Book X91F / X91L */
111 		.matches = {
112 			/* Inexact match to match F + L versions */
113 			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
114 		},
115 		.driver_data = (void *)&lenovo_yogabook_x91_info,
116 	},
117 	{
118 		/*
119 		 * Lenovo Yoga Tablet 2 Pro 1380F/L (13")
120 		 * This has more or less the same BIOS as the 830F/L or 1050F/L
121 		 * (8" and 10") below, but unlike the 8"/10" models which share
122 		 * the same mainboard this model has a different mainboard.
123 		 * This match for the 13" model MUST come before the 8" + 10"
124 		 * match since that one will also match the 13" model!
125 		 */
126 		.matches = {
127 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
128 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
129 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
130 			/* Full match so as to NOT match the 830/1050 BIOS */
131 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21.X64.0005.R00.1504101516"),
132 		},
133 		.driver_data = (void *)&lenovo_yoga_tab2_1380_info,
134 	},
135 	{
136 		/*
137 		 * Lenovo Yoga Tablet 2 830F/L or 1050F/L
138 		 * The 8" and 10" Lenovo Yoga Tablet 2 use the same mainboard.
139 		 */
140 		.matches = {
141 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
142 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
143 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
144 			/* Partial match on beginning of BIOS version */
145 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
146 		},
147 		.driver_data = (void *)&lenovo_yoga_tab2_830_1050_info,
148 	},
149 	{
150 		/* Lenovo Yoga Tab 3 Pro YT3-X90F */
151 		.matches = {
152 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
153 			DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
154 		},
155 		.driver_data = (void *)&lenovo_yt3_info,
156 	},
157 	{
158 		/* Medion Lifetab S10346 */
159 		.matches = {
160 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
161 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
162 			/* Above strings are much too generic, also match on BIOS date */
163 			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
164 		},
165 		.driver_data = (void *)&medion_lifetab_s10346_info,
166 	},
167 	{
168 		/* Nextbook Ares 8 (BYT version) */
169 		.matches = {
170 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
171 			DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
172 		},
173 		.driver_data = (void *)&nextbook_ares8_info,
174 	},
175 	{
176 		/* Nextbook Ares 8A (CHT version) */
177 		.matches = {
178 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
179 			DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"),
180 			DMI_MATCH(DMI_BIOS_VERSION, "M882"),
181 		},
182 		.driver_data = (void *)&nextbook_ares8a_info,
183 	},
184 	{
185 		/* Peaq C1010 */
186 		.matches = {
187 			DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
188 			DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"),
189 		},
190 		.driver_data = (void *)&peaq_c1010_info,
191 	},
192 	{
193 		/* Vexia Edu Atla 10 tablet 5V version */
194 		.matches = {
195 			/* Having all 3 of these not set is somewhat unique */
196 			DMI_MATCH(DMI_SYS_VENDOR, "To be filled by O.E.M."),
197 			DMI_MATCH(DMI_PRODUCT_NAME, "To be filled by O.E.M."),
198 			DMI_MATCH(DMI_BOARD_NAME, "To be filled by O.E.M."),
199 			/* Above strings are too generic, also match on BIOS date */
200 			DMI_MATCH(DMI_BIOS_DATE, "05/14/2015"),
201 		},
202 		.driver_data = (void *)&vexia_edu_atla10_5v_info,
203 	},
204 	{
205 		/* Vexia Edu Atla 10 tablet 9V version */
206 		.matches = {
207 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
208 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
209 			/* Above strings are too generic, also match on BIOS date */
210 			DMI_MATCH(DMI_BIOS_DATE, "08/25/2014"),
211 		},
212 		.driver_data = (void *)&vexia_edu_atla10_9v_info,
213 	},
214 	{
215 		/* Whitelabel (sold as various brands) TM800A550L */
216 		.matches = {
217 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
218 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
219 			/* Above strings are too generic, also match on BIOS version */
220 			DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"),
221 		},
222 		.driver_data = (void *)&whitelabel_tm800a550l_info,
223 	},
224 	{
225 		/* Xiaomi Mi Pad 2 */
226 		.matches = {
227 			DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
228 			DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
229 		},
230 		.driver_data = (void *)&xiaomi_mipad2_info,
231 	},
232 	{ }
233 };
234 MODULE_DEVICE_TABLE(dmi, x86_android_tablet_ids);
235