WSL2-Linux-Kernel/drivers/platform
Hans de Goede e20b24b175 platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names
commit dbcbfd662a725641d118fb3ae5ffb7be4e3d0fb0 upstream.

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: bbb97d728f ("platform/x86: touchscreen_dmi: Add info for the Chuwi Hi8 Air tablet")
Closes: https://github.com/onitake/gsl-firmware/issues/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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:21:48 +01:00
..
chrome platform/chrome: cros_ec_chardev: fix kernel data leak from ioctl 2023-03-30 12:47:50 +02:00
goldfish platform/goldfish: Convert pipe tasklet to threaded irq 2021-01-27 14:57:06 +01:00
mellanox platform/mellanox: Check devm_hwmon_device_register_with_groups() return value 2023-12-13 18:36:35 +01:00
mips MIPS: Loongson-3: fix compile mips cpu_hwmon as module build error. 2022-06-22 14:21:58 +02:00
olpc platform/olpc: Fix uninitialized data in debugfs write 2022-08-17 14:23:58 +02:00
surface platform/surface: aggregator: fix recv_buf() return value 2023-12-13 18:36:44 +01:00
x86 platform/x86: touchscreen_dmi: Allow partial (prefix) matches for ACPI names 2024-03-01 13:21:48 +01:00
Kconfig
Makefile