From: Charlie Mooney <charliemooney@chromium.org>
To: linux-input@vger.kernel.org
Cc: dmitry.torokhov@gmail.com, dusonlin@emc.com.tw,
charliemooney@chromium.org, jkosina@suse.com,
michele.curti@gmail.com, k.kozlowski@samsung.com,
bleung@chromium.org, drake@endlessm.com,
linux-kernel@vger.kernel.org
Subject: [PATCH] input: Report vendor and product IDs for elan_i2c
Date: Tue, 15 Dec 2015 11:11:12 -0800 [thread overview]
Message-ID: <1450206672-9840-1-git-send-email-charliemooney@chromium.org> (raw)
Previously the "vendor" and "product" IDs for the elan_i2c
driver simply reported 0000. This patch modifies the elan_i2c
driver to include the Elan vendor ID and the touchpad's product
id under input/input*/{vendor,product}.
Specifically, this is to allow us to apply a generic Elan gestures
config that will apply to all Elan touchpads on ChromeOS. These
configs match to input devices in various ways, but one major way
is by matching on vendor ID. Adding this patch allows the
default Elan touchpad config to be applied to Elan touchpads in
this kernel by matching on devices that have vendor ID 04f3.
To test this patch, I mannually built and installed the modified
driver for my laptop which has an elan_i2c touchpad. Everything
still functions correctly, and when I query the vendor and product
ID I see what I expected:
localhost i2c-ELAN0000:00 # cat \
/sys/bus/i2c/devices/i2c-ELAN0000\:00/input/input6/id/{vendor,product}
04f3
007f
Before this patch it simply returned 0000 for both values. Note that
007F is the product ID that this device will return through its custom
sysfs entry "product_id" as well.
Signed-off-by: Charlie Mooney <charliemooney@chromium.org>
---
drivers/input/mouse/elan_i2c_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 5e1665b..2f58985 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -41,6 +41,7 @@
#define DRIVER_NAME "elan_i2c"
#define ELAN_DRIVER_VERSION "1.6.1"
+#define ELAN_VENDOR_ID 0x04f3
#define ETP_MAX_PRESSURE 255
#define ETP_FWIDTH_REDUCE 90
#define ETP_FINGER_WIDTH 15
@@ -914,6 +915,8 @@ static int elan_setup_input_device(struct elan_tp_data *data)
input->name = "Elan Touchpad";
input->id.bustype = BUS_I2C;
+ input->id.vendor = ELAN_VENDOR_ID;
+ input->id.product = data->product_id;
input_set_drvdata(input, data);
error = input_mt_init_slots(input, ETP_MAX_FINGERS,
--
2.1.2
next reply other threads:[~2015-12-15 19:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-15 19:11 Charlie Mooney [this message]
2015-12-15 19:34 ` [PATCH] input: Report vendor and product IDs for elan_i2c Dmitry Torokhov
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=1450206672-9840-1-git-send-email-charliemooney@chromium.org \
--to=charliemooney@chromium.org \
--cc=bleung@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=drake@endlessm.com \
--cc=dusonlin@emc.com.tw \
--cc=jkosina@suse.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michele.curti@gmail.com \
/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).