From: Johnny Chuang <johnny.chuang.emc@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Peter Hutterer <peter.hutterer@who-t.net>,
linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
Harry Cutts <hcutts@chromium.org>,
Johnny Chuang <johnny.chuang@emc.com.tw>
Cc: James Chen <james.chen@emc.com.tw>,
Jennifer Tsai <jennifer.tsai@emc.com.tw>,
Paul Liang <paul.liang@emc.com.tw>,
Jeff Chuang <jeff.chuang@emc.com.tw>,
Douglas Anderson <dianders@chromium.org>,
Jingle <jingle.wu@emc.com.tw>
Subject: [PATCH] HID: i2c-hid: Skip ELAN power-on command after reset
Date: Wed, 7 Apr 2021 14:49:17 +0800 [thread overview]
Message-ID: <1617778157-11007-1-git-send-email-johnny.chuang.emc@gmail.com> (raw)
Previous commit 43b7029f475e ("HID: i2c-hid:
Send power-on command after reset"), it fixed issue for SIS touchscreen.
For ELAN touchscreen, we found our boot code of IC was not flexible enough
to receive and handle this command.
Once the FW main code of our controller is crashed for some reason,
the controller could not be enumerated successfully to be recognized
by the system host. therefore, it lost touch functionality.
Add quirk for skip send power-on command after reset.
It will impact to ELAN touchscreen and touchpad on HID over I2C projects.
Signed-off-by: Johnny Chuang <johnny.chuang.emc@gmail.com>
---
drivers/hid/i2c-hid/i2c-hid-core.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 9993133..6b407f7 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -45,6 +45,7 @@
#define I2C_HID_QUIRK_BOGUS_IRQ BIT(4)
#define I2C_HID_QUIRK_RESET_ON_RESUME BIT(5)
#define I2C_HID_QUIRK_BAD_INPUT_SIZE BIT(6)
+#define I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET BIT(7)
/* flags */
@@ -157,6 +158,10 @@ struct i2c_hid {
struct i2chid_ops *ops;
};
+/*
+ * Sending the wakeup after reset actually break ELAN touchscreen controller
+ * So add I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET to skip wakeup after reset
+ */
static const struct i2c_hid_quirks {
__u16 idVendor;
__u16 idProduct;
@@ -178,6 +183,8 @@ static const struct i2c_hid_quirks {
I2C_HID_QUIRK_RESET_ON_RESUME },
{ USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720,
I2C_HID_QUIRK_BAD_INPUT_SIZE },
+ { USB_VENDOR_ID_ELAN, HID_ANY_ID,
+ I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET },
{ 0, 0 }
};
@@ -461,7 +468,8 @@ static int i2c_hid_hwreset(struct i2c_client *client)
}
/* At least some SIS devices need this after reset */
- ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
+ if (!(ihid->quirks & I2C_HID_QUIRK_NO_WAKEUP_AFTER_RESET))
+ ret = i2c_hid_set_power(client, I2C_HID_PWR_ON);
out_unlock:
mutex_unlock(&ihid->reset_lock);
--
2.7.4
next reply other threads:[~2021-04-07 6:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 6:49 Johnny Chuang [this message]
2021-04-09 17:32 ` [PATCH] HID: i2c-hid: Skip ELAN power-on command after reset Harry Cutts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1617778157-11007-1-git-send-email-johnny.chuang.emc@gmail.com \
--to=johnny.chuang.emc@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=hcutts@chromium.org \
--cc=james.chen@emc.com.tw \
--cc=jeff.chuang@emc.com.tw \
--cc=jennifer.tsai@emc.com.tw \
--cc=jingle.wu@emc.com.tw \
--cc=johnny.chuang@emc.com.tw \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paul.liang@emc.com.tw \
--cc=peter.hutterer@who-t.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).