Commit 667a7dd0e629ad244cf8bc7ceab10c90c214e976

Authored by Haibo Chen
1 parent 8caf1f5a3e

MLK-15950 input: egalax_ts: switch to i2c interface before wake up

For HannStar (HSD100PXN1 Rev: 1-A00C11 F/W:0634) LVDS touch screen,
it has a special request for the EETI touch controller. The host
needs to trigger I2C event to device FW at booting first, and then
the FW can switch to I2C interface. Otherwise, the FW can’t  work
with I2C interface, and can't generate any interrupt when touch
the screen.

This patch send an I2C command before the device wake up, make sure
the device switch to I2C interface first.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Reviewed-by: Andy Duan <fugang.duan@nxp.com>
(cherry picked from commit 037f88c1b9566008748d54b9d4feb647c38c6153)

Showing 1 changed file with 14 additions and 0 deletions Side-by-side Diff

drivers/input/touchscreen/egalax_ts.c
... ... @@ -186,6 +186,20 @@
186 186 ts->client = client;
187 187 ts->input_dev = input_dev;
188 188  
  189 + /* HannStar (HSD100PXN1 Rev: 1-A00C11 F/W:0634) LVDS touch
  190 + * screen needs to trigger I2C event to device FW at booting
  191 + * first, and then the FW can switch to I2C interface.
  192 + * Otherwise, the FW can’t work with I2C interface. So here
  193 + * just use the exist function egalax_firmware_version() to
  194 + * send a I2C command to the device, make sure the device FW
  195 + * switch to I2C interface.
  196 + */
  197 + error = egalax_firmware_version(client);
  198 + if (error) {
  199 + dev_err(&client->dev, "Failed to switch to I2C interface\n");
  200 + return error;
  201 + }
  202 +
189 203 /* controller may be in sleep, wake it up. */
190 204 error = egalax_wake_up_device(client);
191 205 if (error) {