From 377a72515da7debefe12772f16132d2a2dac1482 Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Mon, 29 Jun 2020 16:34:48 +0800 Subject: [PATCH] input: ilitek_0flash_mmi: resume touch by ddi - Trigger touch firmware download by display driver for quick touch response. - Only use panel notify, avoid trigger drm and panel notification at the same time. NO_PROP_NEEDED: New IC driver. Change-Id: I01313efff3713d45362af18c277aa759e67dda23 Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/1649595 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jun Weng Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- .../touchscreen/ilitek_0flash_mmi/Android.mk | 4 ++++ .../touchscreen/ilitek_0flash_mmi/Kbuild | 3 +++ .../touchscreen/ilitek_0flash_mmi/ilitek.h | 4 ++++ .../ilitek_0flash_mmi/ilitek_qcom.c | 23 +++++++++++++------ include/linux/panel_notifier.h | 1 + 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/Android.mk b/drivers/input/touchscreen/ilitek_0flash_mmi/Android.mk index 9b2dfe8ae350..d9cca7d059cd 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/Android.mk +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/Android.mk @@ -9,6 +9,10 @@ ifneq ($(BOARD_USES_PANEL_NOTIFICATIONS),) KERNEL_CFLAGS += CONFIG_INPUT_ILI_PANEL_NOTIFICATIONS=y endif +ifneq ($(DL_FW_BY_DISPLAY),) + KERNEL_CFLAGS += CONFIG_ILITEK_RESUME_BY_DDI=y +endif + include $(CLEAR_VARS) LOCAL_MODULE := ilitek_0flash_mmi.ko LOCAL_MODULE_TAGS := optional diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/Kbuild b/drivers/input/touchscreen/ilitek_0flash_mmi/Kbuild index 15cfc7114d5a..aad8cb64d1f9 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/Kbuild +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/Kbuild @@ -13,6 +13,9 @@ endif ifneq ($(filter m y,$(CONFIG_INPUT_ILI_PANEL_NOTIFICATIONS)),) EXTRA_CFLAGS += -DILI_CONFIG_PANEL_NOTIFICATIONS endif +ifneq ($(filter m y,$(CONFIG_ILITEK_RESUME_BY_DDI)),) +EXTRA_CFLAGS += -DILI_CONFIG_RESUME_BY_DDI +endif ilitek_0flash_mmi-objs += ilitek.o ilitek_0flash_mmi-objs += ilitek_spi.o diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h index e391df53e923..66f9d05e6ecf 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek.h @@ -142,7 +142,11 @@ #endif #define REGULATOR_POWER DISABLE #define TP_SUSPEND_PRIO ENABLE +#ifdef ILI_CONFIG_RESUME_BY_DDI +#define RESUME_BY_DDI ENABLE +#else #define RESUME_BY_DDI DISABLE +#endif #define BOOT_FW_UPDATE ENABLE #define MP_INT_LEVEL DISABLE #define Pll_Clk_Wakeup_TP_Resume ENABLE diff --git a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c index b6c5f8ba2340..0662d86ea762 100644 --- a/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c +++ b/drivers/input/touchscreen/ilitek_0flash_mmi/ilitek_qcom.c @@ -480,6 +480,7 @@ int ili_check_default_tp(struct device_node *dt, const char *prop) return ret; } +#ifndef ILI_CONFIG_PANEL_NOTIFICATIONS static int drm_notifier_callback(struct notifier_block *self, unsigned long event, void *data) { @@ -526,6 +527,7 @@ static int drm_notifier_callback(struct notifier_block *self, return 0; } #endif +#endif #if defined(CONFIG_DRM_MSM) static int drm_notifier_callback(struct notifier_block *self, unsigned long event, void *data) @@ -704,7 +706,13 @@ static int ili_panel_notifier_callback(struct notifier_block *self, unsigned lon ILI_INFO("event=%lu\n", event); if (ili_sleep_handler(TP_RESUME) < 0) ILI_ERR("TP resume failed\n"); - break; + break; + case PANEL_EVENT_DISPLAY_ON_PREPARE: + ILI_INFO("event=%lu\n", event); +#if RESUME_BY_DDI + ili_resume_by_ddi(); +#endif + break; default: /* use DEV_TS here to avoid unused variable */ ILI_INFO("%s: function not implemented event %lu\n", __func__, event); break; @@ -728,6 +736,13 @@ static void ilitek_plat_sleep_init(void) ILI_ERR("Unable to register notifier_fb\n"); #endif /* CONFIG_PLAT_SPRD */ #endif +#ifdef ILI_CONFIG_PANEL_NOTIFICATIONS + ilits->panel_notif.notifier_call = ili_panel_notifier_callback; + ret = register_panel_notifier(&ilits->panel_notif); + if(ret) { + ILI_ERR("register panel_notifier failed. ret=%d\n", ret); + } +#else #if defined(CONFIG_DRM) ilits->notifier_fb.notifier_call = drm_notifier_callback; #if defined(CONFIG_DRM_PANEL) @@ -744,12 +759,6 @@ static void ilitek_plat_sleep_init(void) } #endif #endif/* CONFIG_DRM */ -#ifdef ILI_CONFIG_PANEL_NOTIFICATIONS - ilits->panel_notif.notifier_call = ili_panel_notifier_callback; - ret = register_panel_notifier(&ilits->panel_notif); - if(ret) { - ILI_ERR("register panel_notifier failed. ret=%d\n", ret); - } #endif #if defined(CONFIG_HAS_EARLYSUSPEND) ILI_ERR("Init eqarly_suspend struct\n"); diff --git a/include/linux/panel_notifier.h b/include/linux/panel_notifier.h index 2905be449d13..ecb2dba3e92d 100644 --- a/include/linux/panel_notifier.h +++ b/include/linux/panel_notifier.h @@ -21,6 +21,7 @@ enum panel_event { PANEL_EVENT_PRE_DISPLAY_ON, PANEL_EVENT_DISPLAY_OFF, PANEL_EVENT_DISPLAY_ON, + PANEL_EVENT_DISPLAY_ON_PREPARE, }; #ifdef CONFIG_PANEL_NOTIFICATIONS