Skip to content

Commit bb3a3a6

Browse files
jwrdegoedegregkh
authored andcommitted
Input: goodix - platform/x86: touchscreen_dmi - Move upside down quirks to touchscreen_dmi.c
[ Upstream commit 5a6f0db ] Move the DMI quirks for upside-down mounted Goodix touchscreens from drivers/input/touchscreen/goodix.c to drivers/platform/x86/touchscreen_dmi.c, where all the other x86 touchscreen quirks live. Note the touchscreen_dmi.c code attaches standard touchscreen device-properties to an i2c-client device based on a combination of a DMI match + a device-name match. I've verified that the: Teclast X98 Pro, WinBook TW100 and WinBook TW700 uses an ACPI devicename of "GDIX1001:00" based on acpidumps and/or dmesg output available on the web. This patch was tested on a Teclast X89 tablet. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20210504185746.175461-2-hdegoede@redhat.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 9e914f5 commit bb3a3a6

2 files changed

Lines changed: 56 additions & 52 deletions

File tree

‎drivers/input/touchscreen/goodix.c‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -178,51 +178,6 @@ static const unsigned long goodix_irq_flags[] = {
178178
IRQ_TYPE_LEVEL_HIGH,
179179
};
180180

181-
/*
182-
* Those tablets have their coordinates origin at the bottom right
183-
* of the tablet, as if rotated 180 degrees
184-
*/
185-
static const struct dmi_system_id rotated_screen[] = {
186-
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
187-
{
188-
.ident = "Teclast X89",
189-
.matches = {
190-
/* tPAD is too generic, also match on bios date */
191-
DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
192-
DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
193-
DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"),
194-
},
195-
},
196-
{
197-
.ident = "Teclast X98 Pro",
198-
.matches = {
199-
/*
200-
* Only match BIOS date, because the manufacturers
201-
* BIOS does not report the board name at all
202-
* (sometimes)...
203-
*/
204-
DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
205-
DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"),
206-
},
207-
},
208-
{
209-
.ident = "WinBook TW100",
210-
.matches = {
211-
DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
212-
DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
213-
}
214-
},
215-
{
216-
.ident = "WinBook TW700",
217-
.matches = {
218-
DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
219-
DMI_MATCH(DMI_PRODUCT_NAME, "TW700")
220-
},
221-
},
222-
#endif
223-
{}
224-
};
225-
226181
static const struct dmi_system_id nine_bytes_report[] = {
227182
#if defined(CONFIG_DMI) && defined(CONFIG_X86)
228183
{
@@ -1121,13 +1076,6 @@ static int goodix_configure_dev(struct goodix_ts_data *ts)
11211076
ABS_MT_POSITION_Y, ts->prop.max_y);
11221077
}
11231078

1124-
if (dmi_check_system(rotated_screen)) {
1125-
ts->prop.invert_x = true;
1126-
ts->prop.invert_y = true;
1127-
dev_dbg(&ts->client->dev,
1128-
"Applying '180 degrees rotated screen' quirk\n");
1129-
}
1130-
11311079
if (dmi_check_system(nine_bytes_report)) {
11321080
ts->contact_size = 9;
11331081

‎drivers/platform/x86/touchscreen_dmi.c‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,23 @@ static const struct ts_dmi_data estar_beauty_hd_data = {
299299
.properties = estar_beauty_hd_props,
300300
};
301301

302+
/* Generic props + data for upside-down mounted GDIX1001 touchscreens */
303+
static const struct property_entry gdix1001_upside_down_props[] = {
304+
PROPERTY_ENTRY_BOOL("touchscreen-inverted-x"),
305+
PROPERTY_ENTRY_BOOL("touchscreen-inverted-y"),
306+
{ }
307+
};
308+
309+
static const struct ts_dmi_data gdix1001_00_upside_down_data = {
310+
.acpi_name = "GDIX1001:00",
311+
.properties = gdix1001_upside_down_props,
312+
};
313+
314+
static const struct ts_dmi_data gdix1001_01_upside_down_data = {
315+
.acpi_name = "GDIX1001:01",
316+
.properties = gdix1001_upside_down_props,
317+
};
318+
302319
static const struct property_entry gp_electronic_t701_props[] = {
303320
PROPERTY_ENTRY_U32("touchscreen-size-x", 960),
304321
PROPERTY_ENTRY_U32("touchscreen-size-y", 640),
@@ -1268,6 +1285,16 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
12681285
DMI_MATCH(DMI_BOARD_NAME, "X3 Plus"),
12691286
},
12701287
},
1288+
{
1289+
/* Teclast X89 (Windows version / BIOS) */
1290+
.driver_data = (void *)&gdix1001_01_upside_down_data,
1291+
.matches = {
1292+
/* tPAD is too generic, also match on bios date */
1293+
DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
1294+
DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
1295+
DMI_MATCH(DMI_BIOS_DATE, "12/19/2014"),
1296+
},
1297+
},
12711298
{
12721299
/* Teclast X98 Plus II */
12731300
.driver_data = (void *)&teclast_x98plus2_data,
@@ -1276,6 +1303,19 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
12761303
DMI_MATCH(DMI_PRODUCT_NAME, "X98 Plus II"),
12771304
},
12781305
},
1306+
{
1307+
/* Teclast X98 Pro */
1308+
.driver_data = (void *)&gdix1001_00_upside_down_data,
1309+
.matches = {
1310+
/*
1311+
* Only match BIOS date, because the manufacturers
1312+
* BIOS does not report the board name at all
1313+
* (sometimes)...
1314+
*/
1315+
DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
1316+
DMI_MATCH(DMI_BIOS_DATE, "10/28/2015"),
1317+
},
1318+
},
12791319
{
12801320
/* Trekstor Primebook C11 */
12811321
.driver_data = (void *)&trekstor_primebook_c11_data,
@@ -1351,6 +1391,22 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
13511391
DMI_MATCH(DMI_PRODUCT_NAME, "VINGA Twizzle J116"),
13521392
},
13531393
},
1394+
{
1395+
/* "WinBook TW100" */
1396+
.driver_data = (void *)&gdix1001_00_upside_down_data,
1397+
.matches = {
1398+
DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
1399+
DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
1400+
}
1401+
},
1402+
{
1403+
/* WinBook TW700 */
1404+
.driver_data = (void *)&gdix1001_00_upside_down_data,
1405+
.matches = {
1406+
DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
1407+
DMI_MATCH(DMI_PRODUCT_NAME, "TW700")
1408+
},
1409+
},
13541410
{
13551411
/* Yours Y8W81, same case and touchscreen as Chuwi Vi8 */
13561412
.driver_data = (void *)&chuwi_vi8_data,

0 commit comments

Comments
 (0)