Skip to content

Commit dbcbfd6

Browse files
committed
platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names
On some devices the ACPI name of the touchscreen is e.g. either MSSL1680:00 or MSSL1680:01 depending on the BIOS version. This happens for example on the "Chuwi Hi8 Air" tablet where the initial commit's ts_data uses "MSSL1680:00" but the tablets from the github issue and linux-hardware.org probe linked below both use "MSSL1680:01". Replace the strcmp() match on ts_data->acpi_name with a strstarts() check to allow using a partial match on just the ACPI HID of "MSSL1680" and change the ts_data->acpi_name for the "Chuwi Hi8 Air" accordingly to fix the touchscreen not working on models where it is "MSSL1680:01". Note this drops the length check for I2C_NAME_SIZE. This never was necessary since the ACPI names used are never more then 11 chars and I2C_NAME_SIZE is 20 so the replaced strncmp() would always stop long before reaching I2C_NAME_SIZE. Link: https://linux-hardware.org/?computer=AC4301C0542A Fixes: bbb97d7 ("platform/x86: touchscreen_dmi: Add info for the Chuwi Hi8 Air tablet") Closes: onitake/gsl-firmware#91 Cc: stable@vger.kernel.org Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Link: https://lore.kernel.org/r/20240212120608.30469-1-hdegoede@redhat.com
1 parent 8f81237 commit dbcbfd6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/platform/x86/touchscreen_dmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static const struct property_entry chuwi_hi8_air_props[] = {
8181
};
8282

8383
static const struct ts_dmi_data chuwi_hi8_air_data = {
84-
.acpi_name = "MSSL1680:00",
84+
.acpi_name = "MSSL1680",
8585
.properties = chuwi_hi8_air_props,
8686
};
8787

@@ -1821,7 +1821,7 @@ static void ts_dmi_add_props(struct i2c_client *client)
18211821
int error;
18221822

18231823
if (has_acpi_companion(dev) &&
1824-
!strncmp(ts_data->acpi_name, client->name, I2C_NAME_SIZE)) {
1824+
strstarts(client->name, ts_data->acpi_name)) {
18251825
error = device_create_managed_software_node(dev, ts_data->properties, NULL);
18261826
if (error)
18271827
dev_err(dev, "failed to add properties: %d\n", error);

0 commit comments

Comments
 (0)