diff mbox series

HID: i2c-hid: Remove RESEND_REPORT_DESCR quirk and its handling

Message ID 20180909105039.18600-1-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series HID: i2c-hid: Remove RESEND_REPORT_DESCR quirk and its handling | expand

Commit Message

Hans de Goede Sept. 9, 2018, 10:50 a.m. UTC
Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume")
removes the need for the RESEND_REPORT_DESCR quirk for Raydium devices, but
kept it for the SIS device id 10FB touchscreens, as the author of that
commit could not determine if the quirk is still necessary there.

I've tested suspend/resume on a Toshiba Click Mini L9W-B which is the
device for which this quirk was added in the first place and with the
"Don't reset device upon system resume" fix the quirk is no longer
necessary, so this commit removes it.

Note even better I also had some other devices with SIS touchscreens which
suspend/resume issues, where the RESEND_REPORT_DESCR quirk did not help.

I've also tested these devices with the "Don't reset device upon system
resume" fix and I'm happy to report that that fix also fixes touchscreen
resume on the following devices:

Asus T100HA
Asus T200TA
Peaq C1010

Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/hid/hid-ids.h         |  1 -
 drivers/hid/i2c-hid/i2c-hid.c | 16 ++--------------
 2 files changed, 2 insertions(+), 15 deletions(-)

Comments

Benjamin Tissoires Sept. 10, 2018, 7:05 a.m. UTC | #1
On Sun, Sep 9, 2018 at 12:50 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Commit 52cf93e63ee6 ("HID: i2c-hid: Don't reset device upon system resume")
> removes the need for the RESEND_REPORT_DESCR quirk for Raydium devices, but
> kept it for the SIS device id 10FB touchscreens, as the author of that
> commit could not determine if the quirk is still necessary there.
>
> I've tested suspend/resume on a Toshiba Click Mini L9W-B which is the
> device for which this quirk was added in the first place and with the
> "Don't reset device upon system resume" fix the quirk is no longer
> necessary, so this commit removes it.
>
> Note even better I also had some other devices with SIS touchscreens which
> suspend/resume issues, where the RESEND_REPORT_DESCR quirk did not help.
>
> I've also tested these devices with the "Don't reset device upon system
> resume" fix and I'm happy to report that that fix also fixes touchscreen
> resume on the following devices:
>
> Asus T100HA
> Asus T200TA
> Peaq C1010
>
> Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---

Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>  drivers/hid/hid-ids.h         |  1 -
>  drivers/hid/i2c-hid/i2c-hid.c | 16 ++--------------
>  2 files changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
> index 5faffb5d4fb0..286a56415905 100644
> --- a/drivers/hid/hid-ids.h
> +++ b/drivers/hid/hid-ids.h
> @@ -973,7 +973,6 @@
>  #define USB_DEVICE_ID_SIS817_TOUCH     0x0817
>  #define USB_DEVICE_ID_SIS_TS           0x1013
>  #define USB_DEVICE_ID_SIS1030_TOUCH    0x1030
> -#define USB_DEVICE_ID_SIS10FB_TOUCH    0x10fb
>
>  #define USB_VENDOR_ID_SKYCABLE                 0x1223
>  #define        USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER       0x3F07
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index f3076659361a..9e1800a74bbe 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -47,7 +47,6 @@
>  /* quirks to control the device */
>  #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV       BIT(0)
>  #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET       BIT(1)
> -#define I2C_HID_QUIRK_RESEND_REPORT_DESCR      BIT(2)
>
>  /* flags */
>  #define I2C_HID_STARTED                0
> @@ -170,8 +169,6 @@ static const struct i2c_hid_quirks {
>                 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
>         { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
>                 I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
> -       { USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH,
> -               I2C_HID_QUIRK_RESEND_REPORT_DESCR },
>         { 0, 0 }
>  };
>
> @@ -1236,22 +1233,13 @@ static int i2c_hid_resume(struct device *dev)
>
>         /* Instead of resetting device, simply powers the device on. This
>          * solves "incomplete reports" on Raydium devices 2386:3118 and
> -        * 2386:4B33
> +        * 2386:4B33 and fixes various SIS touchscreens no longer sending
> +        * data after a suspend/resume.
>          */
>         ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
>         if (ret)
>                 return ret;
>
> -       /* Some devices need to re-send report descr cmd
> -        * after resume, after this it will be back normal.
> -        * otherwise it issues too many incomplete reports.
> -        */
> -       if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
> -               ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
> -               if (ret)
> -                       return ret;
> -       }
> -
>         if (hid->driver && hid->driver->reset_resume) {
>                 ret = hid->driver->reset_resume(hid);
>                 return ret;
> --
> 2.19.0.rc0
>
diff mbox series

Patch

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 5faffb5d4fb0..286a56415905 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -973,7 +973,6 @@ 
 #define USB_DEVICE_ID_SIS817_TOUCH	0x0817
 #define USB_DEVICE_ID_SIS_TS		0x1013
 #define USB_DEVICE_ID_SIS1030_TOUCH	0x1030
-#define USB_DEVICE_ID_SIS10FB_TOUCH	0x10fb
 
 #define USB_VENDOR_ID_SKYCABLE			0x1223
 #define	USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER	0x3F07
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index f3076659361a..9e1800a74bbe 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -47,7 +47,6 @@ 
 /* quirks to control the device */
 #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV	BIT(0)
 #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET	BIT(1)
-#define I2C_HID_QUIRK_RESEND_REPORT_DESCR	BIT(2)
 
 /* flags */
 #define I2C_HID_STARTED		0
@@ -170,8 +169,6 @@  static const struct i2c_hid_quirks {
 		I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
 	{ I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
 		I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
-	{ USB_VENDOR_ID_SIS_TOUCH, USB_DEVICE_ID_SIS10FB_TOUCH,
-		I2C_HID_QUIRK_RESEND_REPORT_DESCR },
 	{ 0, 0 }
 };
 
@@ -1236,22 +1233,13 @@  static int i2c_hid_resume(struct device *dev)
 
 	/* Instead of resetting device, simply powers the device on. This
 	 * solves "incomplete reports" on Raydium devices 2386:3118 and
-	 * 2386:4B33
+	 * 2386:4B33 and fixes various SIS touchscreens no longer sending
+	 * data after a suspend/resume.
 	 */
 	ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
 	if (ret)
 		return ret;
 
-	/* Some devices need to re-send report descr cmd
-	 * after resume, after this it will be back normal.
-	 * otherwise it issues too many incomplete reports.
-	 */
-	if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
-		ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
-		if (ret)
-			return ret;
-	}
-
 	if (hid->driver && hid->driver->reset_resume) {
 		ret = hid->driver->reset_resume(hid);
 		return ret;