summaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid
diff options
context:
space:
mode:
authorKai-Heng Feng <kai.heng.feng@canonical.com>2019-01-07 02:24:29 -0500
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-21 04:46:18 -0500
commit1475af255e18f35dc46f8a7acc18354c73d45149 (patch)
treec700d6974a5f7d89db992e5673975ceff9cc3a8a /drivers/hid/i2c-hid
parentcf26057a9441173ad552e90cea3344607075c9ad (diff)
HID: i2c-hid: Ignore input report if there's no data present on Elan touchpanels
While using Elan touchpads, the message floods: [ 136.138487] i2c_hid i2c-DELL08D6:00: i2c_hid_get_input: incomplete report (14/65535) Though the message flood is annoying, the device it self works without any issue. I suspect that the device in question takes too much time to pull the IRQ back to high after I2C host has done reading its data. Since the host receives all useful data, let's ignore the input report when there's no data. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid-core.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 8555ce7e737b..2f940c1de616 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -50,6 +50,7 @@
50#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) 50#define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
51#define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2) 51#define I2C_HID_QUIRK_NO_RUNTIME_PM BIT(2)
52#define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3) 52#define I2C_HID_QUIRK_DELAY_AFTER_SLEEP BIT(3)
53#define I2C_HID_QUIRK_BOGUS_IRQ BIT(4)
53 54
54/* flags */ 55/* flags */
55#define I2C_HID_STARTED 0 56#define I2C_HID_STARTED 0
@@ -179,6 +180,8 @@ static const struct i2c_hid_quirks {
179 I2C_HID_QUIRK_DELAY_AFTER_SLEEP }, 180 I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
180 { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001, 181 { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001,
181 I2C_HID_QUIRK_NO_RUNTIME_PM }, 182 I2C_HID_QUIRK_NO_RUNTIME_PM },
183 { USB_VENDOR_ID_ELAN, HID_ANY_ID,
184 I2C_HID_QUIRK_BOGUS_IRQ },
182 { 0, 0 } 185 { 0, 0 }
183}; 186};
184 187
@@ -503,6 +506,12 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
503 return; 506 return;
504 } 507 }
505 508
509 if (ihid->quirks & I2C_HID_QUIRK_BOGUS_IRQ && ret_size == 0xffff) {
510 dev_warn_once(&ihid->client->dev, "%s: IRQ triggered but "
511 "there's no data\n", __func__);
512 return;
513 }
514
506 if ((ret_size > size) || (ret_size < 2)) { 515 if ((ret_size > size) || (ret_size < 2)) {
507 dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", 516 dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
508 __func__, size, ret_size); 517 __func__, size, ret_size);