touch: Pull down GPIOs during SUSPEND
Enablement and disablement of GPIO pins along with LDOs during RESUME and SUSPEND state respectively. Change-Id: If24272ca1410ac583ba9ea6792c44459a8429334 Signed-off-by: Surya Teja Kudiri <quic_skudiri@quicinc.com>
This commit is contained in:
34
pt/pt_core.c
34
pt/pt_core.c
@@ -7664,8 +7664,14 @@ static int pt_core_sleep_(struct pt_core_data *cd)
|
||||
|
||||
if (IS_EASY_WAKE_CONFIGURED(cd->easy_wakeup_gesture))
|
||||
rc = pt_put_device_into_easy_wakeup_(cd);
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_POWEROFF_ON_SLEEP)
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_POWEROFF_ON_SLEEP) {
|
||||
pt_debug(cd->dev, DL_INFO,
|
||||
"%s: Entering into poweroff mode:\n", __func__);
|
||||
rc = pt_core_poweroff_device_(cd);
|
||||
if (rc < 0)
|
||||
pr_err("%s: Poweroff error detected :rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_DEEP_STANDBY)
|
||||
rc = pt_put_device_into_deep_standby_(cd);
|
||||
else
|
||||
@@ -9490,8 +9496,14 @@ static int pt_core_wake_(struct pt_core_data *cd)
|
||||
if (!(cd->cpdata->flags & PT_CORE_FLAG_SKIP_RESUME)) {
|
||||
if (IS_EASY_WAKE_CONFIGURED(cd->easy_wakeup_gesture))
|
||||
rc = pt_core_wake_device_from_easy_wake_(cd);
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_POWEROFF_ON_SLEEP)
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_POWEROFF_ON_SLEEP) {
|
||||
pt_debug(cd->dev, DL_INFO,
|
||||
"%s: Entering into poweron mode:\n", __func__);
|
||||
rc = pt_core_poweron_device_(cd);
|
||||
if (rc < 0)
|
||||
pr_err("%s: Poweron error detected: rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
else if (cd->cpdata->flags & PT_CORE_FLAG_DEEP_STANDBY)
|
||||
rc = pt_core_wake_device_from_deep_standby_(cd);
|
||||
else /* Default action to exit DeepSleep */
|
||||
@@ -10438,11 +10450,6 @@ static int pt_core_rt_suspend(struct device *dev)
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
rc = pt_enable_regulator(cd, false);
|
||||
if (rc < 0) {
|
||||
dev_err(dev, "%s: Failed to disable regulators: rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -10468,15 +10475,6 @@ static int pt_core_rt_resume(struct device *dev)
|
||||
if (cd->cpdata->flags & PT_CORE_FLAG_SKIP_RUNTIME)
|
||||
return 0;
|
||||
|
||||
rc = pt_enable_regulator(cd, true);
|
||||
if (rc < 0) {
|
||||
dev_err(dev, "%s: Failed to enable regulators: rc=%d\n",
|
||||
__func__, rc);
|
||||
}
|
||||
|
||||
dev_info(dev, "%s: Runtime voltage regulator enabled: rc=%d\n",
|
||||
__func__, rc);
|
||||
|
||||
rc = pt_core_wake(cd);
|
||||
if (rc < 0) {
|
||||
pt_debug(dev, DL_ERROR, "%s: Error on wake\n", __func__);
|
||||
@@ -10507,6 +10505,8 @@ static int pt_core_suspend_(struct device *dev)
|
||||
int rc;
|
||||
struct pt_core_data *cd = dev_get_drvdata(dev);
|
||||
|
||||
pt_debug(dev, DL_INFO, "%s: Entering into suspend mode:\n",
|
||||
__func__);
|
||||
rc = pt_core_sleep(cd);
|
||||
if (rc < 0) {
|
||||
pt_debug(dev, DL_ERROR, "%s: Error on sleep\n", __func__);
|
||||
@@ -10579,7 +10579,7 @@ static int pt_core_suspend(struct device *dev)
|
||||
******************************************************************************/
|
||||
static int pt_core_resume_(struct device *dev)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0;
|
||||
struct pt_core_data *cd = dev_get_drvdata(dev);
|
||||
|
||||
dev_info(dev, "%s: Entering into resume mode:\n",
|
||||
|
@@ -541,7 +541,10 @@ static int pt_wakeup(struct pt_core_platform_data *pdata,
|
||||
int rc = 0;
|
||||
|
||||
#ifdef PT_PINCTRL_EN
|
||||
pt_pinctrl_select_normal(pdata, dev);
|
||||
rc = pt_pinctrl_select_normal(pdata, dev);
|
||||
if (rc)
|
||||
pr_err("%s: GPIO pins activation error: rc=%d\n",
|
||||
__func__, rc);
|
||||
#endif
|
||||
|
||||
#ifdef TT7XXX_EXAMPLE
|
||||
@@ -674,7 +677,10 @@ static int pt_sleep(struct pt_core_platform_data *pdata,
|
||||
pt_debug(dev, DL_INFO, "%s: Turn off defined pwr\n", __func__);
|
||||
#endif
|
||||
#ifdef PT_PINCTRL_EN
|
||||
pt_pinctrl_select_suspend(pdata, dev);
|
||||
rc = pt_pinctrl_select_suspend(pdata, dev);
|
||||
if (rc)
|
||||
pr_err("%s: GPIO pins suspend error: rc=%d\n",
|
||||
__func__, rc);
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
@@ -120,8 +120,13 @@
|
||||
#define CONFIG_PM_SLEEP
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_PM_RUNTIME
|
||||
#define CONFIG_PM_RUNTIME
|
||||
/* Pin Control Macro Enablement */
|
||||
#ifndef PT_PINCTRL_EN
|
||||
#define PT_PINCTRL_EN
|
||||
#endif
|
||||
|
||||
#ifndef TT7XXX_EXAMPLE
|
||||
#define TT7XXX_EXAMPLE
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user