aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse/elan_i2c_smbus.c
diff options
context:
space:
mode:
authorJingle Wu <jingle.wu@emc.com.tw>2020-07-20 12:46:10 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2020-07-21 10:11:18 -0700
commit04d5ce620f794f1df69b5f1b9ad62910fea547f1 (patch)
tree0ce909edccb217f0339238e7c02c558b89586751 /drivers/input/mouse/elan_i2c_smbus.c
parentInput: elan_i2c - do not constantly re-query pattern ID (diff)
downloadlinux-dev-04d5ce620f794f1df69b5f1b9ad62910fea547f1.tar.xz
linux-dev-04d5ce620f794f1df69b5f1b9ad62910fea547f1.zip
Input: elan_i2c - add support for high resolution reports
Newer controllers (identified as "pattern" version 2) send higher resolution reports, with 16-bit X and Y coordinates (previous generations used 12-bit values). These new high resolution reports use report ID of 0x60. SMbus controllers use the same buffer size for both the new and old reports, and because of that high resolution reports no longer carry area of contact data with SMbus. Signed-off-by: Jingle Wu <jingle.wu@emc.com.tw> Link: https://lore.kernel.org/r/20200710054116.5529-1-jingle.wu@emc.com.tw Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to '')
-rw-r--r--drivers/input/mouse/elan_i2c_smbus.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/input/mouse/elan_i2c_smbus.c b/drivers/input/mouse/elan_i2c_smbus.c
index f7af8b7b345f..8ff823751f3b 100644
--- a/drivers/input/mouse/elan_i2c_smbus.c
+++ b/drivers/input/mouse/elan_i2c_smbus.c
@@ -469,7 +469,21 @@ static int elan_smbus_write_fw_block(struct i2c_client *client, u16 fw_page_size
return 0;
}
-static int elan_smbus_get_report(struct i2c_client *client, u8 *report)
+static int elan_smbus_get_report_features(struct i2c_client *client, u8 pattern,
+ unsigned int *features,
+ unsigned int *report_len)
+{
+ /*
+ * SMBus controllers with pattern 2 lack area info, as newer
+ * high-precision packets use that space for coordinates.
+ */
+ *features = pattern <= 0x01 ? ETP_FEATURE_REPORT_MK : 0;
+ *report_len = ETP_SMBUS_REPORT_LEN;
+ return 0;
+}
+
+static int elan_smbus_get_report(struct i2c_client *client,
+ u8 *report, unsigned int report_len)
{
int len;
@@ -534,6 +548,7 @@ const struct elan_transport_ops elan_smbus_ops = {
.write_fw_block = elan_smbus_write_fw_block,
.finish_fw_update = elan_smbus_finish_fw_update,
+ .get_report_features = elan_smbus_get_report_features,
.get_report = elan_smbus_get_report,
.get_pattern = elan_smbus_get_pattern,
};