diff mbox series

[2/2] platform/x86: touchscreen_dmi: Consolidate Goodix upside-down touchscreen data

Message ID 20240212120608.30469-2-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Hans de Goede
Headers show
Series [1/2] platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names | expand

Commit Message

Hans de Goede Feb. 12, 2024, 12:06 p.m. UTC
Now that prefix matches for ACPI names are supported, the ts_dmi_data
structs for "GDIX1001:00" and "GDIX1001:01" can be consolidated into
a single match matching on "GDIX1001".

For consistency also change gdix1002_00_upside_down_data to match.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/touchscreen_dmi.c | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

Comments

Kuppuswamy Sathyanarayanan Feb. 13, 2024, 1:01 a.m. UTC | #1
On 2/12/24 4:06 AM, Hans de Goede wrote:
> Now that prefix matches for ACPI names are supported, the ts_dmi_data
> structs for "GDIX1001:00" and "GDIX1001:01" can be consolidated into
> a single match matching on "GDIX1001".
>
> For consistency also change gdix1002_00_upside_down_data to match.
>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---

Looks good to me.

Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>

>  drivers/platform/x86/touchscreen_dmi.c | 25 ++++++++++---------------
>  1 file changed, 10 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
> index 969477c83e56..975cf24ae359 100644
> --- a/drivers/platform/x86/touchscreen_dmi.c
> +++ b/drivers/platform/x86/touchscreen_dmi.c
> @@ -415,18 +415,13 @@ static const struct property_entry gdix1001_upside_down_props[] = {
>  	{ }
>  };
>  
> -static const struct ts_dmi_data gdix1001_00_upside_down_data = {
> -	.acpi_name	= "GDIX1001:00",
> +static const struct ts_dmi_data gdix1001_upside_down_data = {
> +	.acpi_name	= "GDIX1001",
>  	.properties	= gdix1001_upside_down_props,
>  };
>  
> -static const struct ts_dmi_data gdix1001_01_upside_down_data = {
> -	.acpi_name	= "GDIX1001:01",
> -	.properties	= gdix1001_upside_down_props,
> -};
> -
> -static const struct ts_dmi_data gdix1002_00_upside_down_data = {
> -	.acpi_name	= "GDIX1002:00",
> +static const struct ts_dmi_data gdix1002_upside_down_data = {
> +	.acpi_name	= "GDIX1002",
>  	.properties	= gdix1001_upside_down_props,
>  };
>  
> @@ -1412,7 +1407,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* Juno Tablet */
> -		.driver_data = (void *)&gdix1002_00_upside_down_data,
> +		.driver_data = (void *)&gdix1002_upside_down_data,
>  		.matches = {
>  			DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
>  			/* Both product- and board-name being "Default string" is somewhat rare */
> @@ -1658,7 +1653,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* Teclast X89 (Android version / BIOS) */
> -		.driver_data = (void *)&gdix1001_00_upside_down_data,
> +		.driver_data = (void *)&gdix1001_upside_down_data,
>  		.matches = {
>  			DMI_MATCH(DMI_BOARD_VENDOR, "WISKY"),
>  			DMI_MATCH(DMI_BOARD_NAME, "3G062i"),
> @@ -1666,7 +1661,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* Teclast X89 (Windows version / BIOS) */
> -		.driver_data = (void *)&gdix1001_01_upside_down_data,
> +		.driver_data = (void *)&gdix1001_upside_down_data,
>  		.matches = {
>  			/* tPAD is too generic, also match on bios date */
>  			DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
> @@ -1684,7 +1679,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* Teclast X98 Pro */
> -		.driver_data = (void *)&gdix1001_00_upside_down_data,
> +		.driver_data = (void *)&gdix1001_upside_down_data,
>  		.matches = {
>  			/*
>  			 * Only match BIOS date, because the manufacturers
> @@ -1788,7 +1783,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* "WinBook TW100" */
> -		.driver_data = (void *)&gdix1001_00_upside_down_data,
> +		.driver_data = (void *)&gdix1001_upside_down_data,
>  		.matches = {
>  			DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
>  			DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
> @@ -1796,7 +1791,7 @@ const struct dmi_system_id touchscreen_dmi_table[] = {
>  	},
>  	{
>  		/* WinBook TW700 */
> -		.driver_data = (void *)&gdix1001_00_upside_down_data,
> +		.driver_data = (void *)&gdix1001_upside_down_data,
>  		.matches = {
>  			DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
>  			DMI_MATCH(DMI_PRODUCT_NAME, "TW700")
diff mbox series

Patch

diff --git a/drivers/platform/x86/touchscreen_dmi.c b/drivers/platform/x86/touchscreen_dmi.c
index 969477c83e56..975cf24ae359 100644
--- a/drivers/platform/x86/touchscreen_dmi.c
+++ b/drivers/platform/x86/touchscreen_dmi.c
@@ -415,18 +415,13 @@  static const struct property_entry gdix1001_upside_down_props[] = {
 	{ }
 };
 
-static const struct ts_dmi_data gdix1001_00_upside_down_data = {
-	.acpi_name	= "GDIX1001:00",
+static const struct ts_dmi_data gdix1001_upside_down_data = {
+	.acpi_name	= "GDIX1001",
 	.properties	= gdix1001_upside_down_props,
 };
 
-static const struct ts_dmi_data gdix1001_01_upside_down_data = {
-	.acpi_name	= "GDIX1001:01",
-	.properties	= gdix1001_upside_down_props,
-};
-
-static const struct ts_dmi_data gdix1002_00_upside_down_data = {
-	.acpi_name	= "GDIX1002:00",
+static const struct ts_dmi_data gdix1002_upside_down_data = {
+	.acpi_name	= "GDIX1002",
 	.properties	= gdix1001_upside_down_props,
 };
 
@@ -1412,7 +1407,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* Juno Tablet */
-		.driver_data = (void *)&gdix1002_00_upside_down_data,
+		.driver_data = (void *)&gdix1002_upside_down_data,
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Default string"),
 			/* Both product- and board-name being "Default string" is somewhat rare */
@@ -1658,7 +1653,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* Teclast X89 (Android version / BIOS) */
-		.driver_data = (void *)&gdix1001_00_upside_down_data,
+		.driver_data = (void *)&gdix1001_upside_down_data,
 		.matches = {
 			DMI_MATCH(DMI_BOARD_VENDOR, "WISKY"),
 			DMI_MATCH(DMI_BOARD_NAME, "3G062i"),
@@ -1666,7 +1661,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* Teclast X89 (Windows version / BIOS) */
-		.driver_data = (void *)&gdix1001_01_upside_down_data,
+		.driver_data = (void *)&gdix1001_upside_down_data,
 		.matches = {
 			/* tPAD is too generic, also match on bios date */
 			DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
@@ -1684,7 +1679,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* Teclast X98 Pro */
-		.driver_data = (void *)&gdix1001_00_upside_down_data,
+		.driver_data = (void *)&gdix1001_upside_down_data,
 		.matches = {
 			/*
 			 * Only match BIOS date, because the manufacturers
@@ -1788,7 +1783,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* "WinBook TW100" */
-		.driver_data = (void *)&gdix1001_00_upside_down_data,
+		.driver_data = (void *)&gdix1001_upside_down_data,
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "TW100")
@@ -1796,7 +1791,7 @@  const struct dmi_system_id touchscreen_dmi_table[] = {
 	},
 	{
 		/* WinBook TW700 */
-		.driver_data = (void *)&gdix1001_00_upside_down_data,
+		.driver_data = (void *)&gdix1001_upside_down_data,
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "WinBook"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "TW700")