From 30a726faeeebf95c247def813a2d71143535630a Mon Sep 17 00:00:00 2001 From: dx Date: Mon, 28 Nov 2022 14:37:42 +0100 Subject: [PATCH] elantp: Include 04F3:0400 (bootloader) as a valid i2c-hid touchpad (#5283) * elantp: Include 04F3:0400 (bootloader) as a valid i2c-hid touchpad ELAN Touchpads with product ids between 0x3000 and 0x4000 can sometimes end up in bootloader mode (due to not having a valid firmware, for example) The bootloader has a product id outside of the range checked by fu_elantp_hid_device_probe, resulting in the device disappearing from get-devices when it's in that mode, which makes it seem dead. This expands the range of that check to include 0x400 so that it is possible to upload a valid firmware to it. --- plugins/elantp/fu-elantp-hid-device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/elantp/fu-elantp-hid-device.c b/plugins/elantp/fu-elantp-hid-device.c index ef1dcfe36..4d9224352 100644 --- a/plugins/elantp/fu-elantp-hid-device.c +++ b/plugins/elantp/fu-elantp-hid-device.c @@ -53,6 +53,8 @@ fu_elantp_hid_device_to_string(FuDevice *device, guint idt, GString *str) static gboolean fu_elantp_hid_device_probe(FuDevice *device, GError **error) { + guint16 device_id = fu_udev_device_get_model(FU_UDEV_DEVICE(device)); + /* check is valid */ if (g_strcmp0(fu_udev_device_get_subsystem(FU_UDEV_DEVICE(device)), "hidraw") != 0) { g_set_error(error, @@ -64,8 +66,7 @@ fu_elantp_hid_device_probe(FuDevice *device, GError **error) } /* i2c-hid */ - if (fu_udev_device_get_model(FU_UDEV_DEVICE(device)) < 0x3000 || - fu_udev_device_get_model(FU_UDEV_DEVICE(device)) >= 0x4000) { + if (device_id != 0x400 && (device_id < 0x3000 || device_id >= 0x4000)) { g_set_error_literal(error, FWUPD_ERROR, FWUPD_ERROR_NOT_SUPPORTED,