static void mali_dvfs_event_proc(struct work_struct *w) { #ifdef CONFIG_MALI_DEVFREQ if (mali_devfreq) { mutex_lock(&mali_devfreq->lock); update_devfreq(mali_devfreq); mutex_unlock(&mali_devfreq->lock); } return 0; #else mali_dvfs_status *dvfs_status; mutex_lock(&mali_enable_clock_lock); dvfs_status = &mali_dvfs_status_current; mali_dvfs_decide_next_level(dvfs_status); if (dvfs_status->step >= dvfs_step_max) dvfs_status->step = dvfs_step_max-1; if (dvfs_status->step < dvfs_step_min) dvfs_status->step = dvfs_step_min; if (!pm_runtime_status_suspended(dvfs_status->kbdev->osdev.dev)) kbase_platform_dvfs_set_level(dvfs_status->kbdev, dvfs_status->step); mutex_unlock(&mali_enable_clock_lock); #endif }
static int mali_governor_get_target_freq(struct devfreq *df, unsigned long *freq) { mali_dvfs_status *dvfs_status; mutex_lock(&mali_enable_clock_lock); dvfs_status = &mali_dvfs_status_current; mali_dvfs_decide_next_level(dvfs_status); mutex_unlock(&mali_enable_clock_lock); *freq = dvfs_status->step; DEBUG_PRINT_INFO("\n[mali_devfreq] get_target_freq:%d", *freq); return 0; }
static void mali_dvfs_event_proc(struct work_struct *w) { #ifdef CONFIG_MALI_DEVFREQ if (mali_devfreq) { mutex_lock(&mali_devfreq->lock); update_devfreq(mali_devfreq); mutex_unlock(&mali_devfreq->lock); } return 0; #else mali_dvfs_status *dvfs_status; mutex_lock(&mali_enable_clock_lock); dvfs_status = &mali_dvfs_status_current; mali_dvfs_decide_next_level(dvfs_status); kbase_platform_dvfs_set_level(dvfs_status->kbdev, dvfs_status->step); mutex_unlock(&mali_enable_clock_lock); #endif }