Skip to content

Commit 8257c19

Browse files
pH5gregkh
authored andcommitted
Input: edt-ft5x06 - work around first register access error
[ Upstream commit e112324 ] The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00): edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40 It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly. Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Tested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent cd9ea1f commit 8257c19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/input/touchscreen/edt-ft5x06.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
887887
{
888888
const struct edt_i2c_chip_data *chip_data;
889889
struct edt_ft5x06_ts_data *tsdata;
890+
u8 buf[2] = { 0xfc, 0x00 };
890891
struct input_dev *input;
891892
unsigned long irq_flags;
892893
int error;
@@ -956,6 +957,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
956957
return error;
957958
}
958959

960+
/*
961+
* Dummy read access. EP0700MLP1 returns bogus data on the first
962+
* register read access and ignores writes.
963+
*/
964+
edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf);
965+
959966
edt_ft5x06_ts_set_regs(tsdata);
960967
edt_ft5x06_ts_get_defaults(&client->dev, tsdata);
961968
edt_ft5x06_ts_get_parameters(tsdata);

0 commit comments

Comments
 (0)