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 <hdegoede@redhat.com>
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 7 B1-750 */
21 		.matches = {
22 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
23 			DMI_MATCH(DMI_PRODUCT_NAME, "VESPA2"),
24 		},
25 		.driver_data = (void *)&acer_b1_750_info,
26 	},
27 	{
28 		/* Advantech MICA-071 */
29 		.matches = {
30 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Advantech"),
31 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "MICA-071"),
32 		},
33 		.driver_data = (void *)&advantech_mica_071_info,
34 	},
35 	{
36 		/* Asus MeMO Pad 7 ME176C */
37 		.matches = {
38 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
39 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "ME176C"),
40 		},
41 		.driver_data = (void *)&asus_me176c_info,
42 	},
43 	{
44 		/* Asus TF103C */
45 		.matches = {
46 			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
47 			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
48 		},
49 		.driver_data = (void *)&asus_tf103c_info,
50 	},
51 	{
52 		/* Chuwi Hi8 (CWI509) */
53 		.matches = {
54 			DMI_MATCH(DMI_BOARD_VENDOR, "Hampoo"),
55 			DMI_MATCH(DMI_BOARD_NAME, "BYT-PA03C"),
56 			DMI_MATCH(DMI_SYS_VENDOR, "ilife"),
57 			DMI_MATCH(DMI_PRODUCT_NAME, "S806"),
58 		},
59 		.driver_data = (void *)&chuwi_hi8_info,
60 	},
61 	{
62 		/* CZC P10T */
63 		.ident = "CZC ODEON TPC-10 (\"P10T\")",
64 		.matches = {
65 			DMI_MATCH(DMI_SYS_VENDOR, "CZC"),
66 			DMI_MATCH(DMI_PRODUCT_NAME, "ODEON*TPC-10"),
67 		},
68 		.driver_data = (void *)&czc_p10t,
69 	},
70 	{
71 		/* CZC P10T variant */
72 		.ident = "ViewSonic ViewPad 10",
73 		.matches = {
74 			DMI_MATCH(DMI_SYS_VENDOR, "ViewSonic"),
75 			DMI_MATCH(DMI_PRODUCT_NAME, "VPAD10"),
76 		},
77 		.driver_data = (void *)&czc_p10t,
78 	},
79 	{
80 		/* Lenovo Yoga Book X90F / X90L */
81 		.matches = {
82 			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
83 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
84 			DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "YETI-11"),
85 		},
86 		.driver_data = (void *)&lenovo_yogabook_x90_info,
87 	},
88 	{
89 		/* Lenovo Yoga Book X91F / X91L */
90 		.matches = {
91 			/* Non exact match to match F + L versions */
92 			DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X91"),
93 		},
94 		.driver_data = (void *)&lenovo_yogabook_x91_info,
95 	},
96 	{
97 		/*
98 		 * Lenovo Yoga Tablet 2 830F/L or 1050F/L (The 8" and 10"
99 		 * Lenovo Yoga Tablet 2 use the same mainboard)
100 		 */
101 		.matches = {
102 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
103 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
104 			DMI_MATCH(DMI_BOARD_NAME, "BYT-T FFD8"),
105 			/* Partial match on beginning of BIOS version */
106 			DMI_MATCH(DMI_BIOS_VERSION, "BLADE_21"),
107 		},
108 		.driver_data = (void *)&lenovo_yoga_tab2_830_1050_info,
109 	},
110 	{
111 		/* Lenovo Yoga Tab 3 Pro YT3-X90F */
112 		.matches = {
113 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
114 			DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
115 			DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
116 		},
117 		.driver_data = (void *)&lenovo_yt3_info,
118 	},
119 	{
120 		/* Medion Lifetab S10346 */
121 		.matches = {
122 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
123 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
124 			/* Above strings are much too generic, also match on BIOS date */
125 			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
126 		},
127 		.driver_data = (void *)&medion_lifetab_s10346_info,
128 	},
129 	{
130 		/* Nextbook Ares 8 */
131 		.matches = {
132 			DMI_MATCH(DMI_SYS_VENDOR, "Insyde"),
133 			DMI_MATCH(DMI_PRODUCT_NAME, "M890BAP"),
134 		},
135 		.driver_data = (void *)&nextbook_ares8_info,
136 	},
137 	{
138 		/* Peaq C1010 */
139 		.matches = {
140 			DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"),
141 			DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"),
142 		},
143 		.driver_data = (void *)&peaq_c1010_info,
144 	},
145 	{
146 		/* Whitelabel (sold as various brands) TM800A550L */
147 		.matches = {
148 			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
149 			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
150 			/* Above strings are too generic, also match on BIOS version */
151 			DMI_MATCH(DMI_BIOS_VERSION, "ZY-8-BI-PX4S70VTR400-X423B-005-D"),
152 		},
153 		.driver_data = (void *)&whitelabel_tm800a550l_info,
154 	},
155 	{
156 		/* Xiaomi Mi Pad 2 */
157 		.matches = {
158 			DMI_MATCH(DMI_SYS_VENDOR, "Xiaomi Inc"),
159 			DMI_MATCH(DMI_PRODUCT_NAME, "Mipad2"),
160 		},
161 		.driver_data = (void *)&xiaomi_mipad2_info,
162 	},
163 	{ }
164 };
165 MODULE_DEVICE_TABLE(dmi, x86_android_tablet_ids);
166