summaryrefslogtreecommitdiff
path: root/drivers/input/rmi4/rmi_f55.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2016-11-22 17:57:02 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-11-22 17:59:25 -0800
commitc762cc68b6a12eedebefc156ea4838e54804e2eb (patch)
treeb5e6e92723464430f094fb6951b23bbdb10a217f /drivers/input/rmi4/rmi_f55.c
parent6adba43fd222ea362c36296d1a6897c2e28fdc8e (diff)
Input: synaptics-rmi4 - propagate correct number of rx and tx electrodes to F54
F54 diagnostics report functions provide data based on the number of enabled rx and tx electrodes, which is not identical to the number of electrodes reported with F54:Query0 and F54:Query1. Those values report the number of supported electrodes, not the number of enabled electrodes. The number of enabled electrodes can be determined by analyzing F55:Ctrl1 (sensor receiver assignment) and F55:Ctrl2 (sensor transmitter assignment). Propagate the number of enabled electrodes from F55 to F54 to avoid corrupted output if not all electrodes are enabled. Fixes: 3a762dbd5347 ("[media] Input: synaptics-rmi4 - add support for F54 ...") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Nick Dyer <nick@shmanahar.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4/rmi_f55.c')
-rw-r--r--drivers/input/rmi4/rmi_f55.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/input/rmi4/rmi_f55.c b/drivers/input/rmi4/rmi_f55.c
index 2d221cc97391..37390ca6a924 100644
--- a/drivers/input/rmi4/rmi_f55.c
+++ b/drivers/input/rmi4/rmi_f55.c
@@ -38,6 +38,8 @@ struct f55_data {
static int rmi_f55_detect(struct rmi_function *fn)
{
+ struct rmi_device *rmi_dev = fn->rmi_dev;
+ struct rmi_driver_data *drv_data = dev_get_drvdata(&rmi_dev->dev);
struct f55_data *f55;
int error;
@@ -57,6 +59,9 @@ static int rmi_f55_detect(struct rmi_function *fn)
f55->cfg_num_rx_electrodes = f55->num_rx_electrodes;
f55->cfg_num_tx_electrodes = f55->num_rx_electrodes;
+ drv_data->num_rx_electrodes = f55->cfg_num_rx_electrodes;
+ drv_data->num_tx_electrodes = f55->cfg_num_rx_electrodes;
+
if (f55->qry[F55_PHYS_CHAR_OFFSET] & F55_CAP_SENSOR_ASSIGN) {
int i, total;
u8 buf[256];
@@ -78,6 +83,7 @@ static int rmi_f55_detect(struct rmi_function *fn)
total++;
}
f55->cfg_num_rx_electrodes = total;
+ drv_data->num_rx_electrodes = total;
}
error = rmi_read_block(fn->rmi_dev,
@@ -90,6 +96,7 @@ static int rmi_f55_detect(struct rmi_function *fn)
total++;
}
f55->cfg_num_tx_electrodes = total;
+ drv_data->num_tx_electrodes = total;
}
}