From: yzq Date: Sat, 29 Sep 2012 06:43:02 +0000 (+0800) Subject: rk3066b m701:fix ft5306 sometimes do not work when resume X-Git-Tag: firefly_0821_release~8500 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=71f67176a9d166fe5ff329780e36c5db10f83d7e;p=firefly-linux-kernel-4.4.55.git rk3066b m701:fix ft5306 sometimes do not work when resume --- diff --git a/drivers/input/touchscreen/ft5306_ts_av.c b/drivers/input/touchscreen/ft5306_ts_av.c index e2da4b3edff5..a6b1522c4ab4 100644 --- a/drivers/input/touchscreen/ft5306_ts_av.c +++ b/drivers/input/touchscreen/ft5306_ts_av.c @@ -721,11 +721,25 @@ static int ft5306_suspend(struct early_suspend *h) static int ft5306_resume(struct early_suspend *h) { struct ft5x0x_ts_data *ft5x0x_ts; + int trytimes; + u8 val = 0; ft5x0x_ts = container_of(h, struct ft5x0x_ts_data, ft5306_early_suspend); FTprintk("TSP ft5306_resume\n"); enable_irq(ft5x0x_ts->irq); if (ft5x0x_ts->platform_wakeup) ft5x0x_ts->platform_wakeup(); + + for(trytimes = 0 ;trytimes < 5; trytimes++){ + if(ft5306_read_regs(this_client, 0x00, &val,1)<0){ + if (ft5x0x_ts->platform_sleep) + ft5x0x_ts->platform_sleep(); + if (ft5x0x_ts->platform_wakeup) + ft5x0x_ts->platform_wakeup(); + }else{ + break; + } + } + //gpio_set_value(TOUCH_RESET_PIN,GPIO_LOW); //mdelay(100); //gpio_set_value(TOUCH_RESET_PIN,GPIO_HIGH);