pm_qos_max = (unsigned long)pm_qos_request(gov_data->pm_qos_class_max);
#endif
if (devfreq->str_freq)
- policy_update_call_to_DM(dm_type, devfreq->str_freq,
- devfreq->str_freq);
+ policy_update_with_DM_CALL(dm_type, devfreq->str_freq,
+ devfreq->str_freq, &freq);
else
- policy_update_call_to_DM(dm_type, freq, pm_qos_max);
- DM_CALL(dm_type, &freq);
+ policy_update_with_DM_CALL(dm_type, freq, pm_qos_max, &freq);
#else
/*
* Adjust the frequency with user freq and QoS.
#define POLICY_REQ 4
-int policy_update_call_to_DM(int dm_type, u32 min_freq, u32 max_freq)
+static int __policy_update_call_to_DM(int dm_type, u32 min_freq, u32 max_freq)
{
struct exynos_dm_data *dm;
struct timeval pre, before, after;
dbg_snapshot_dm((int)dm_type, min_freq, max_freq, pre_time, time);
#endif
do_gettimeofday(&pre);
- mutex_lock(&exynos_dm->lock);
do_gettimeofday(&before);
min_freq = min(min_freq, max_freq);
out:
do_gettimeofday(&after);
- mutex_unlock(&exynos_dm->lock);
pre_time = (before.tv_sec - pre.tv_sec) * USEC_PER_SEC +
(before.tv_usec - pre.tv_usec);
/*
* DM CALL
*/
-int DM_CALL(int dm_type, unsigned long *target_freq)
+static int __DM_CALL(int dm_type, unsigned long *target_freq)
{
struct exynos_dm_data *dm;
int i;
dbg_snapshot_dm((int)dm_type, *target_freq, 1, pre_time, time);
#endif
do_gettimeofday(&pre);
- mutex_lock(&exynos_dm->lock);
do_gettimeofday(&before);
dm = &exynos_dm->dm_data[dm_type];
ret = dm_data_updater(dm_type);
if (ret) {
pr_err("Failed to update DM DATA!\n");
- mutex_unlock(&exynos_dm->lock);
return -EAGAIN;
}
}
do_gettimeofday(&after);
- mutex_unlock(&exynos_dm->lock);
pre_time = (before.tv_sec - pre.tv_sec) * USEC_PER_SEC +
(before.tv_usec - pre.tv_usec);
return 0;
}
+
+int policy_update_call_to_DM(int dm_type, u32 min_freq, u32 max_freq)
+{
+ int ret = 0;
+
+ mutex_lock(&exynos_dm->lock);
+ ret = __policy_update_call_to_DM(dm_type, min_freq, max_freq);
+ mutex_unlock(&exynos_dm->lock);
+
+ return ret;
+}
+
+int DM_CALL(int dm_type, unsigned long *target_freq)
+{
+ int ret = 0;
+
+ mutex_lock(&exynos_dm->lock);
+ ret = __DM_CALL(dm_type, target_freq);
+ mutex_unlock(&exynos_dm->lock);
+
+ return ret;
+}
+
+int policy_update_with_DM_CALL(int dm_type, u32 min_freq, u32 max_freq, unsigned long *target_freq)
+{
+ int ret = 0;
+
+ mutex_lock(&exynos_dm->lock);
+ __policy_update_call_to_DM(dm_type, min_freq, max_freq);
+ ret = __DM_CALL(dm_type, target_freq);
+ mutex_unlock(&exynos_dm->lock);
+
+ return ret;
+}
+
static int constraint_data_updater(int dm_type, int cnt)
{
struct exynos_dm_data *dm;
int unregister_exynos_dm_freq_scaler(int dm_type);
int policy_update_call_to_DM(int dm_type, u32 min_freq, u32 max_freq);
int DM_CALL(int dm_type, unsigned long *target_freq);
+int policy_update_with_DM_CALL(int dm_type, u32 min_freq, u32 max_freq, unsigned long *target_freq);
#else
static inline
int exynos_dm_data_init(int dm_type, void *data,
{
return 0;
}
+static inline
+int policy_update_with_DM_CALL(int dm_type, u32 min_freq, u32 max_freq, unsigned long *target_freq)
+{
+ return 0;
+}
#endif
#endif /* __EXYNOS_DM_H */