From: guoyi Date: Fri, 10 Jul 2015 06:51:45 +0000 (+0800) Subject: Drivers: TP: disable vcc_tp when gt9xx in suspend mode X-Git-Tag: firefly_0821_release~3920 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6fe9516f7984362e721b4bd5ab2e2bce18659e15;p=firefly-linux-kernel-4.4.55.git Drivers: TP: disable vcc_tp when gt9xx in suspend mode Signed-off-by: guoyi --- diff --git a/drivers/input/touchscreen/gt9xx/gt9xx.c b/drivers/input/touchscreen/gt9xx/gt9xx.c index 1fa511ff8951..1bac1f8a53e3 100755 --- a/drivers/input/touchscreen/gt9xx/gt9xx.c +++ b/drivers/input/touchscreen/gt9xx/gt9xx.c @@ -49,6 +49,7 @@ #include #include "gt9xx.h" +#include #if GTP_ICS_SLOT_REPORT #include @@ -1908,6 +1909,9 @@ static int goodix_ts_early_suspend(struct tp_device *tp_d) { struct goodix_ts_data *ts; s8 ret = -1; + struct regulator *regulator_tp = NULL; + int reg = 0; + ts = container_of(tp_d, struct goodix_ts_data, tp); GTP_DEBUG_FUNC(); @@ -1938,7 +1942,19 @@ static int goodix_ts_early_suspend(struct tp_device *tp_d) // to avoid waking up while not sleeping // delay 48 + 10ms to ensure reliability msleep(58); - + regulator_tp = regulator_get(NULL,"vcc_tp"); + if(regulator_tp ==NULL) + { + printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__); + return 0; + } + while(regulator_is_enabled(regulator_tp)) + { + reg = regulator_disable(regulator_tp); + msleep(10); + } + regulator_put(regulator_tp); + msleep(20); return 0; } @@ -1954,11 +1970,27 @@ static int goodix_ts_early_resume(struct tp_device *tp_d) { struct goodix_ts_data *ts; s8 ret = -1; + struct regulator *regulator_tp = NULL; + int reg = 0; ts = container_of(tp_d, struct goodix_ts_data, tp); GTP_DEBUG_FUNC(); GTP_INFO("System resume."); + regulator_tp = regulator_get(NULL, "vcc_tp"); + if(regulator_tp ==NULL) + { + printk("!!!!%s:%d:get regulator_tp failed\n",__func__,__LINE__); + return 0; + } + while(!(regulator_is_enabled(regulator_tp))) + { + reg = regulator_enable(regulator_tp); + msleep(10); + } + regulator_put(regulator_tp); + msleep(10); + ret = gtp_wakeup_sleep(ts); #if GTP_GESTURE_WAKEUP