aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2017-06-23 03:04:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-06-23 03:08:48 -0400
commit9768935264c4f0e4afd788a185d8e8d89c28e41d (patch)
tree35a8e2cc2b4e7e41e2afc7cce1cb2b7f365fe25d
parent817ae460c784f32cd45e60b2b1b21378c3c6a847 (diff)
Input: synaptics-rmi4 - only read the F54 query registers which are used
The F54 driver is currently only using the first 6 bytes of F54 so there is no need to read all 27 bytes. Some Dell systems (Dell XP13 9333 and similar) have an issue with the touchpad or I2C bus when reading reports larger then 16 bytes. Reads larger then 16 bytes are reported in two HID reports. Something about the back to back reports seems to cause the next read to report incorrect data. This results in F30 failing to load and the click button failing to work. Previous issues with the I2C controller or touchpad were addressed in: commit 5b65c2a02966 ("HID: rmi: check sanity of the incoming report") Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=195949 Signed-off-by: Andrew Duggan <aduggan@synaptics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Reviewed-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/rmi4/rmi_f54.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/input/rmi4/rmi_f54.c b/drivers/input/rmi4/rmi_f54.c
index dea63e2db3e6..f5206e2c767e 100644
--- a/drivers/input/rmi4/rmi_f54.c
+++ b/drivers/input/rmi4/rmi_f54.c
@@ -31,9 +31,6 @@
31#define F54_GET_REPORT 1 31#define F54_GET_REPORT 1
32#define F54_FORCE_CAL 2 32#define F54_FORCE_CAL 2
33 33
34/* Fixed sizes of reports */
35#define F54_QUERY_LEN 27
36
37/* F54 capabilities */ 34/* F54 capabilities */
38#define F54_CAP_BASELINE (1 << 2) 35#define F54_CAP_BASELINE (1 << 2)
39#define F54_CAP_IMAGE8 (1 << 3) 36#define F54_CAP_IMAGE8 (1 << 3)
@@ -95,7 +92,6 @@ struct rmi_f54_reports {
95struct f54_data { 92struct f54_data {
96 struct rmi_function *fn; 93 struct rmi_function *fn;
97 94
98 u8 qry[F54_QUERY_LEN];
99 u8 num_rx_electrodes; 95 u8 num_rx_electrodes;
100 u8 num_tx_electrodes; 96 u8 num_tx_electrodes;
101 u8 capabilities; 97 u8 capabilities;
@@ -632,22 +628,23 @@ static int rmi_f54_detect(struct rmi_function *fn)
632{ 628{
633 int error; 629 int error;
634 struct f54_data *f54; 630 struct f54_data *f54;
631 u8 buf[6];
635 632
636 f54 = dev_get_drvdata(&fn->dev); 633 f54 = dev_get_drvdata(&fn->dev);
637 634
638 error = rmi_read_block(fn->rmi_dev, fn->fd.query_base_addr, 635 error = rmi_read_block(fn->rmi_dev, fn->fd.query_base_addr,
639 &f54->qry, sizeof(f54->qry)); 636 buf, sizeof(buf));
640 if (error) { 637 if (error) {
641 dev_err(&fn->dev, "%s: Failed to query F54 properties\n", 638 dev_err(&fn->dev, "%s: Failed to query F54 properties\n",
642 __func__); 639 __func__);
643 return error; 640 return error;
644 } 641 }
645 642
646 f54->num_rx_electrodes = f54->qry[0]; 643 f54->num_rx_electrodes = buf[0];
647 f54->num_tx_electrodes = f54->qry[1]; 644 f54->num_tx_electrodes = buf[1];
648 f54->capabilities = f54->qry[2]; 645 f54->capabilities = buf[2];
649 f54->clock_rate = f54->qry[3] | (f54->qry[4] << 8); 646 f54->clock_rate = buf[3] | (buf[4] << 8);
650 f54->family = f54->qry[5]; 647 f54->family = buf[5];
651 648
652 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "F54 num_rx_electrodes: %d\n", 649 rmi_dbg(RMI_DEBUG_FN, &fn->dev, "F54 num_rx_electrodes: %d\n",
653 f54->num_rx_electrodes); 650 f54->num_rx_electrodes);