From e581210daab98b03d6b7ce894fb01bc93990b102 Mon Sep 17 00:00:00 2001 From: Konstantin Makariev Date: Wed, 4 Dec 2019 11:50:19 -0600 Subject: [PATCH] sec_mmi: make dynamic refresh rate optional Among the current products only Racer_turbo and Racer support dynamic refresh rate capability. This feature needs to become optional in LSI driver. Change-Id: I669fef68fbd65f9227ceae4d3adb80091b60394a Signed-off-by: Konstantin Makariev Reviewed-on: https://gerrit.mot.com/1465946 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ryan Lattrel Reviewed-by: Konstantin Makariev Submit-Approved: Jira Key --- drivers/input/touchscreen/sec_mmi/Kbuild | 4 +++- drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c | 13 +++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/sec_mmi/Kbuild b/drivers/input/touchscreen/sec_mmi/Kbuild index f56fda9eb188..75f45518d088 100644 --- a/drivers/input/touchscreen/sec_mmi/Kbuild +++ b/drivers/input/touchscreen/sec_mmi/Kbuild @@ -5,7 +5,9 @@ EXTRA_CFLAGS += \ -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/sec_mmi ifneq (,$(filter racer% burton%,$(TARGET_PRODUCT))) -EXTRA_CFLAGS += -DUSE_STUBS +# NOTE: USE_STUBS option will go away when touchscreen_mmi class introduced, but +# CONFIG_DRM_DYNAMIC_REFRESH_RATE is staying!!! +EXTRA_CFLAGS += -DUSE_STUBS -DCONFIG_DRM_DYNAMIC_REFRESH_RATE endif obj-m := sec_mmi.o diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c index be5ccb20978f..708f6b3e8f0e 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts_mmi.c @@ -33,7 +33,16 @@ #include "sec_ts.h" #include "sec_mmi.h" +#ifdef CONFIG_DRM_DYNAMIC_REFRESH_RATE extern struct blocking_notifier_head dsi_freq_head; +#define register_dynamic_refresh_rate_notifier(...) \ + blocking_notifier_chain_register(&dsi_freq_head, &data->freq_nb) +#define unregister_dynamic_refresh_rate_notifier(...) \ + blocking_notifier_chain_unregister(&dsi_freq_head, &data->freq_nb) +#else +#define register_dynamic_refresh_rate_notifier(...) rc +#define unregister_dynamic_refresh_rate_notifier(...) rc +#endif #if defined(USE_STUBS) static struct class *local_touchscreen_class; @@ -817,7 +826,7 @@ static int sec_mmi_register_notifiers( if (data->update_refresh_rate) { data->freq_nb.notifier_call = sec_mmi_refresh_rate; - rc = blocking_notifier_chain_register( + rc = register_dynamic_refresh_rate_notifier( &dsi_freq_head, &data->freq_nb); } } else { @@ -826,7 +835,7 @@ static int sec_mmi_register_notifiers( power_supply_unreg_notifier(&data->ps_notif); if (data->update_refresh_rate) { - rc = blocking_notifier_chain_unregister( + rc = unregister_dynamic_refresh_rate_notifier( &dsi_freq_head, &data->freq_nb); } }