From a64c750e89af2cdf4cff0213355cad96bf3f0ea9 Mon Sep 17 00:00:00 2001 From: UtsavisGreat Date: Sun, 7 Jul 2019 19:02:28 -0400 Subject: [PATCH] goodix_driver_gt9886: switch to qcom drm notifier * also switch fb notifier api to qcom drm notifier Signed-off-by: UtsavisGreat --- .../goodix_driver_gt9886/goodix_cfg_bin.c | 8 ++--- .../goodix_driver_gt9886/goodix_ts_core.c | 29 +++++++++---------- .../goodix_driver_gt9886/goodix_ts_core.h | 10 +++---- 3 files changed, 23 insertions(+), 24 deletions(-) diff --git a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_cfg_bin.c b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_cfg_bin.c index 4719b53d15a7..a4d24b45c766 100644 --- a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_cfg_bin.c +++ b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_cfg_bin.c @@ -1,5 +1,5 @@ #include "goodix_cfg_bin.h" -#include +#include extern int goodix_i2c_write(struct goodix_ts_device *dev, unsigned int reg, unsigned char *data, unsigned int len); extern int goodix_i2c_read(struct goodix_ts_device *dev, unsigned int reg, unsigned char *data, unsigned int len); @@ -250,9 +250,9 @@ int goodix_cfg_bin_proc(void *data) /*complete_all(&goodix_modules.core_comp);*/ #ifdef CONFIG_DRM - core_data->fb_notifier.notifier_call = goodix_ts_fb_notifier_callback; - if (drm_register_client(&core_data->fb_notifier)) - ts_err("Failed to register fb notifier client:%d", r); + core_data->msm_drm_notifier.notifier_call = goodix_ts_msm_drm_notifier_callback; + if (msm_drm_register_client(&core_data->msm_drm_notifier)) + ts_err("Failed to register drm notifier client:%d", r); #elif defined(CONFIG_HAS_EARLYSUSPEND) core_data->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 1; core_data->early_suspend.resume = goodix_ts_lateresume; diff --git a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.c b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.c index ce01425d162f..8acfcd3980fc 100644 --- a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.c @@ -28,9 +28,8 @@ #include #include #ifdef CONFIG_DRM -#include +#include #include -#include #endif #include #include @@ -694,7 +693,7 @@ int goodix_ts_unregister_notifier(struct notifier_block *nb) EXPORT_SYMBOL(goodix_ts_unregister_notifier); /** - * fb_notifier_call_chain - notify clients of fb_events + * msm_drm_notifier_call_chain - notify clients of msm_drm_notifier * see enum ts_notify_event in goodix_ts_core.h */ int goodix_ts_blocking_notify(enum ts_notify_event evt, void *v) @@ -1731,29 +1730,29 @@ static int goodix_bl_state_chg_callback(struct notifier_block *nb, unsigned long #ifdef CONFIG_DRM /** - * goodix_ts_fb_notifier_callback - Framebuffer notifier callback - * Called by kernel during framebuffer blanck/unblank phrase + * goodix_ts_msm_drm_notifier_callback - msm drm notifier callback + * Called by kernel during drm blanck/unblank phrase */ -int goodix_ts_fb_notifier_callback(struct notifier_block *self, +int goodix_ts_msm_drm_notifier_callback(struct notifier_block *self, unsigned long event, void *data) { struct goodix_ts_core *core_data = - container_of(self, struct goodix_ts_core, fb_notifier); - struct drm_notify_data *fb_event = data; + container_of(self, struct goodix_ts_core, msm_drm_notifier); + struct msm_drm_notifier *msm_drm_event = data; int blank; - if (fb_event && fb_event->data && core_data) { - blank = *(int *)(fb_event->data); + if (msm_drm_event && msm_drm_event->data && core_data) { + blank = *(int *)(msm_drm_event->data); flush_workqueue(core_data->event_wq); - if (event == DRM_EVENT_BLANK && (blank == DRM_BLANK_POWERDOWN || - blank == DRM_BLANK_LP1 || blank == DRM_BLANK_LP2)) { + if (event == MSM_DRM_EVENT_BLANK && (blank == MSM_DRM_BLANK_POWERDOWN || + blank == MSM_DRM_BLANK_LP1 || blank == MSM_DRM_BLANK_LP2)) { ts_info("touchpanel suspend .....blank=%d\n",blank); ts_info("touchpanel suspend .....suspend_stat=%d\n", atomic_read(&core_data->suspend_stat)); if (atomic_read(&core_data->suspend_stat)) return 0; - ts_info("touchpanel suspend by %s", blank == DRM_BLANK_POWERDOWN ? "blank" : "doze"); + ts_info("touchpanel suspend by %s", blank == MSM_DRM_BLANK_POWERDOWN ? "blank" : "doze"); queue_work(core_data->event_wq, &core_data->suspend_work); - } else if (event == DRM_EVENT_BLANK && blank == DRM_BLANK_UNBLANK) { + } else if (event == MSM_DRM_EVENT_BLANK && blank == MSM_DRM_BLANK_UNBLANK) { //if (!atomic_read(&core_data->suspend_stat)) ts_info("core_data->suspend_stat = %d\n",atomic_read(&core_data->suspend_stat)); ts_info("touchpanel resume"); @@ -2523,7 +2522,7 @@ static int goodix_ts_remove(struct platform_device *pdev) { struct goodix_ts_core *core_data = platform_get_drvdata(pdev); #ifdef CONFIG_DRM - drm_unregister_client(&core_data->fb_notifier); + msm_drm_unregister_client(&core_data->msm_drm_notifier); #endif //wake_lock_destroy(&core_data->tp_wakelock); power_supply_unreg_notifier(&core_data->power_supply_notifier); diff --git a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.h b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.h index f604d4919bc2..a04f899c3c13 100644 --- a/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.h +++ b/drivers/input/touchscreen/goodix_driver_gt9886/goodix_ts_core.h @@ -48,7 +48,7 @@ #include #endif #ifdef CONFIG_DRM -#include +#include #include #include #endif @@ -422,7 +422,7 @@ struct goodix_ts_esd { * @hw_err: indicate that hw_ops->init() failed * @ts_notifier: generic notifier * @ts_esd: esd protector structure - * @fb_notifier: framebuffer notifier + * @msm_drm_notifier: framebuffer notifier * @early_suspend: early suspend */ struct goodix_ts_core { @@ -462,7 +462,7 @@ struct goodix_ts_core { struct proc_dir_entry *tp_fw_version_proc; struct proc_dir_entry *tp_lockdown_info_proc; #ifdef CONFIG_DRM - struct notifier_block fb_notifier; + struct notifier_block msm_drm_notifier; #elif defined(CONFIG_HAS_EARLYSUSPEND) struct early_suspend early_suspend; #endif @@ -746,7 +746,7 @@ int goodix_ts_irq_enable(struct goodix_ts_core *core_data, bool enable); struct kobj_type *goodix_get_default_ktype(void); /** - * fb_notifier_call_chain - notify clients of fb_events + * msm_drm_notifier_call_chain - notify clients of fb_events * see enum ts_notify_event in goodix_ts_core.h */ int goodix_ts_blocking_notify(enum ts_notify_event evt, void *v); @@ -773,7 +773,7 @@ int goodix_ts_esd_init(struct goodix_ts_core *core); int goodix_ts_register_notifier(struct notifier_block *nb); int goodix_generic_noti_callback(struct notifier_block *self, unsigned long action, void *data); -int goodix_ts_fb_notifier_callback(struct notifier_block *self, +int goodix_ts_msm_drm_notifier_callback(struct notifier_block *self, unsigned long event, void *data); extern void goodix_msg_printf(const char *fmt, ...); int goodix_gesture_enable(bool enable);