msm: dcvs: remove idle notification registration.
Register the idle enable callback along with the core. The code
becomes cleaner and easy to update.
Importantly, the msm_dcvs_idle driver becomes useless. Remove it
and instead let the msm governor handle idle enabling and disabling.
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
(cherry picked from commit c1ed66c9035b4fbf240e46837d86a9a6442531f1)
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
(cherry picked from commit b4f5c2274fa2180b53563f2db0922eef212c0fcd)
Change-Id: Ice039e608d45bdeb9b8b718e5fbbf82a698d584d
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
diff --git a/arch/arm/mach-msm/msm_dcvs.c b/arch/arm/mach-msm/msm_dcvs.c
index 288d6bb..6899146 100644
--- a/arch/arm/mach-msm/msm_dcvs.c
+++ b/arch/arm/mach-msm/msm_dcvs.c
@@ -99,6 +99,8 @@
wait_queue_head_t wait_q;
int (*set_frequency)(struct msm_dcvs_freq *self, unsigned int freq);
unsigned int (*get_frequency)(struct msm_dcvs_freq *self);
+ int (*idle_enable)(struct msm_dcvs_idle *self,
+ enum msm_core_control_event event);
};
static int msm_dcvs_debug;
@@ -177,13 +179,13 @@
*/
if (core->actual_freq >
core->algo_param.disable_pc_threshold) {
- core->idle_driver->enable(core->idle_driver,
+ core->idle_enable(core->idle_driver,
MSM_DCVS_DISABLE_HIGH_LATENCY_MODES);
if (msm_dcvs_debug & MSM_DCVS_DEBUG_IDLE_PULSE)
__info("Disabling LPM for %s\n", core->core_name);
} else if (core->actual_freq <=
core->algo_param.disable_pc_threshold) {
- core->idle_driver->enable(core->idle_driver,
+ core->idle_enable(core->idle_driver,
MSM_DCVS_ENABLE_HIGH_LATENCY_MODES);
if (msm_dcvs_debug & MSM_DCVS_DEBUG_IDLE_PULSE)
__info("Enabling LPM for %s\n", core->core_name);
@@ -580,6 +582,8 @@
struct msm_dcvs_core_info *info,
int (*set_frequency)(struct msm_dcvs_freq *self, unsigned int freq),
unsigned int (*get_frequency)(struct msm_dcvs_freq *self),
+ int (*idle_enable)(struct msm_dcvs_idle *self,
+ enum msm_core_control_event event),
int sensor)
{
int ret = -EINVAL;
@@ -598,6 +602,7 @@
core->set_frequency = set_frequency;
core->get_frequency = get_frequency;
+ core->idle_enable = idle_enable;
core->info = info;
memcpy(&core->algo_param, &info->algo_param,
@@ -685,7 +690,7 @@
/* Notify TZ to start receiving idle info for the core */
ret = msm_dcvs_update_freq(core, MSM_DCVS_SCM_DCVS_ENABLE, 1,
&ret1, &ret2);
- core->idle_driver->enable(core->idle_driver,
+ core->idle_enable(core->idle_driver,
MSM_DCVS_ENABLE_IDLE_PULSE);
}
@@ -713,13 +718,13 @@
if (msm_dcvs_debug & MSM_DCVS_DEBUG_IDLE_PULSE)
__info("Disabling idle pulse for %s\n", core->core_name);
if (core->idle_driver) {
- core->idle_driver->enable(core->idle_driver,
+ core->idle_enable(core->idle_driver,
MSM_DCVS_DISABLE_IDLE_PULSE);
/* Notify TZ to stop receiving idle info for the core */
ret = msm_dcvs_update_freq(core, MSM_DCVS_SCM_DCVS_ENABLE, 0,
&ret1, &ret2);
hrtimer_cancel(&core->timer);
- core->idle_driver->enable(core->idle_driver,
+ core->idle_enable(core->idle_driver,
MSM_DCVS_ENABLE_HIGH_LATENCY_MODES);
if (msm_dcvs_debug & MSM_DCVS_DEBUG_IDLE_PULSE)
__info("Enabling LPM for %s\n", core->core_name);