Skip to content

Commit e112324

Browse files
pH5dtor
authored andcommitted
Input: edt-ft5x06 - work around first register access error
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]>
1 parent fd7bba6 commit e112324

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
@@ -1050,6 +1050,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
10501050
{
10511051
const struct edt_i2c_chip_data *chip_data;
10521052
struct edt_ft5x06_ts_data *tsdata;
1053+
u8 buf[2] = { 0xfc, 0x00 };
10531054
struct input_dev *input;
10541055
unsigned long irq_flags;
10551056
int error;
@@ -1140,6 +1141,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
11401141
return error;
11411142
}
11421143

1144+
/*
1145+
* Dummy read access. EP0700MLP1 returns bogus data on the first
1146+
* register read access and ignores writes.
1147+
*/
1148+
edt_ft5x06_ts_readwrite(tsdata->client, 2, buf, 2, buf);
1149+
11431150
edt_ft5x06_ts_set_regs(tsdata);
11441151
edt_ft5x06_ts_get_defaults(&client->dev, tsdata);
11451152
edt_ft5x06_ts_get_parameters(tsdata);

0 commit comments

Comments
 (0)