diff --git a/drivers/input/touchscreen/ili9882_mmi/Android.mk b/drivers/input/touchscreen/ili9882_mmi/Android.mk index f1b03d901f42..117e348edb73 100644 --- a/drivers/input/touchscreen/ili9882_mmi/Android.mk +++ b/drivers/input/touchscreen/ili9882_mmi/Android.mk @@ -21,6 +21,10 @@ ifeq ($(ILITEK_FW_PANEL),true) KERNEL_CFLAGS += CONFIG_ILITEK_FW_PANEL=y endif +ifeq ($(ILITEK_SUSPEND_PWROFF),true) + KERNEL_CFLAGS += CONFIG_ILITEK_SUSPEND_PWROFF=y +endif + ifeq ($(ILITEK_CHARGER),true) KERNEL_CFLAGS += CONFIG_ILITEK_CHARGER=y endif diff --git a/drivers/input/touchscreen/ili9882_mmi/Kbuild b/drivers/input/touchscreen/ili9882_mmi/Kbuild index aac41a3881fd..16db0dbfd172 100644 --- a/drivers/input/touchscreen/ili9882_mmi/Kbuild +++ b/drivers/input/touchscreen/ili9882_mmi/Kbuild @@ -26,6 +26,9 @@ endif ifneq ($(filter m y,$(CONFIG_ILITEK_FW_PANEL)),) EXTRA_CFLAGS += -DILI_FW_PANEL endif +ifneq ($(filter m y,$(CONFIG_ILITEK_SUSPEND_PWROFF)),) +EXTRA_CFLAGS += -DILI_SUSPEND_PWROFF +endif ifneq ($(filter m y,$(CONFIG_ILITEK_CHARGER)),) EXTRA_CFLAGS += -DILI_CONFIG_CHARGER endif diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882.c b/drivers/input/touchscreen/ili9882_mmi/ili9882.c index 490453a9e0d9..ebf9b2547a5c 100644 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882.c @@ -51,6 +51,10 @@ static void ilitek_resume_by_ddi_work(struct work_struct *work) disable_irq_wake(ilits->irq_num); #endif +#ifdef ILI_SUSPEND_PWROFF + ili_pinctrl_select_normal(ilits); +#endif + /* Set tp as demo mode and reload code if it's iram. */ ilits->actual_tp_mode = P5_X_FW_AP_MODE; if (ilits->fw_upgrade_mode == UPGRADE_IRAM) @@ -58,7 +62,9 @@ static void ilitek_resume_by_ddi_work(struct work_struct *work) else ili_reset_ctrl(ilits->reset); +#ifndef ILI_SUSPEND_PWROFF ili_pinctrl_select_normal(ilits); +#endif ili_irq_enable(); ILI_INFO("TP resume end by wq\n"); @@ -542,8 +548,17 @@ int ili_sleep_handler(int mode) #endif { ili_pinctrl_select_suspend(ilits); + +#ifdef ILI_SUSPEND_PWROFF + gpio_direction_output(ilits->tp_rst, 1); + mdelay(1); + gpio_set_value(ilits->tp_rst, 0); + mdelay(5); +#else if (ili_ic_func_ctrl("sleep", DEEP_SLEEP_IN) < 0) ILI_ERR("Write deep sleep in cmd failed\n"); +#endif + } ILI_INFO("TP deep suspend end\n"); ilits->tp_suspend = true;