* before DVFS driver registration to DVFS framework.
* Initialize sequence Step.1
*/
-int exynos_dm_data_init(enum exynos_dm_type dm_type,
+int exynos_dm_data_init(enum exynos_dm_type dm_type, void *data,
u32 min_freq, u32 max_freq, u32 cur_freq)
{
int ret = 0;
if (!exynos_dm->dm_data[dm_type].max_freq)
exynos_dm->dm_data[dm_type].max_freq = max_freq;
+ exynos_dm->dm_data[dm_type].devdata = data;
+
out:
mutex_unlock(&exynos_dm->lock);
* Initialize sequence Step.3
*/
int register_exynos_dm_freq_scaler(enum exynos_dm_type dm_type,
- int (*scaler_func)(enum exynos_dm_type dm_type, u32 target_freq, unsigned int relation))
+ int (*scaler_func)(enum exynos_dm_type dm_type, void *devdata, u32 target_freq, unsigned int relation))
{
int ret = 0;
dm = &exynos_dm->dm_data[min_order[i]];
if (dm->constraint_checked) {
if (dm->freq_scaler) {
- dm->freq_scaler(dm->dm_type, dm->target_freq, relation);
+ dm->freq_scaler(dm->dm_type, dm->devdata, dm->target_freq, relation);
dm->cur_freq = dm->target_freq;
}
dm->constraint_checked = 0;
dm = &exynos_dm->dm_data[max_order[i]];
if (dm->constraint_checked) {
if (dm->freq_scaler) {
- dm->freq_scaler(dm->dm_type, dm->target_freq, relation);
+ dm->freq_scaler(dm->dm_type, dm->devdata, dm->target_freq, relation);
dm->cur_freq = dm->target_freq;
}
dm->constraint_checked = 0;
dm = &exynos_dm->dm_data[min_order[i]];
if (dm->constraint_checked) {
if (dm->freq_scaler) {
- dm->freq_scaler(dm->dm_type, dm->target_freq, relation);
+ dm->freq_scaler(dm->dm_type, dm->devdata, dm->target_freq, relation);
dm->cur_freq = dm->target_freq;
}
dm->constraint_checked = 0;
dm = &exynos_dm->dm_data[max_order[i]];
if (dm->constraint_checked) {
if (dm->freq_scaler) {
- dm->freq_scaler(dm->dm_type, dm->target_freq, relation);
+ dm->freq_scaler(dm->dm_type, dm->devdata, dm->target_freq, relation);
dm->cur_freq = dm->target_freq;
}
dm->constraint_checked = 0;
dm = &exynos_dm->dm_data[min_order[i]];
if (dm->constraint_checked) {
if (dm->freq_scaler) {
- dm->freq_scaler(dm->dm_type, dm->target_freq, relation);
+ dm->freq_scaler(dm->dm_type, dm->devdata, dm->target_freq, relation);
dm->cur_freq = dm->target_freq;
}
dm->constraint_checked = 0;
u32 policy_min_freq;
u32 policy_max_freq;
- int (*freq_scaler) (enum exynos_dm_type dm_type, u32 target_freq, unsigned int relation);
+ int (*freq_scaler)(enum exynos_dm_type dm_type, void *devdata, u32 target_freq, unsigned int relation);
struct list_head min_clist;
struct list_head max_clist;
#ifdef CONFIG_EXYNOS_ACPM
u32 cal_id;
#endif
+
+ void *devdata;
};
struct exynos_dm_device {
/* External Function call */
#if defined(CONFIG_EXYNOS_DVFS_MANAGER)
-int exynos_dm_data_init(enum exynos_dm_type dm_type,
+int exynos_dm_data_init(enum exynos_dm_type dm_type, void *data,
u32 min_freq, u32 max_freq, u32 cur_freq);
int register_exynos_dm_constraint_table(enum exynos_dm_type dm_type,
struct exynos_dm_constraint *constraint);
int unregister_exynos_dm_constraint_table(enum exynos_dm_type dm_type,
struct exynos_dm_constraint *constraint);
int register_exynos_dm_freq_scaler(enum exynos_dm_type dm_type,
- int (*scaler_func)(enum exynos_dm_type dm_type, u32 target_freq, unsigned int relation));
+ int (*scaler_func)(enum exynos_dm_type dm_type, void *devdata, u32 target_freq, unsigned int relation));
int unregister_exynos_dm_freq_scaler(enum exynos_dm_type dm_type);
int policy_update_call_to_DM(enum exynos_dm_type dm_type, u32 min_freq, u32 max_freq);
int DM_CALL(enum exynos_dm_type dm_type, unsigned long *target_freq);
#else
static inline
-int exynos_dm_data_init(enum exynos_dm_type dm_type,
+int exynos_dm_data_init(enum exynos_dm_type dm_type, void *data,
u32 min_freq, u32 max_freq, u32 cur_freq)
{
return 0;
}
static inline
int register_exynos_dm_freq_scaler(enum exynos_dm_type dm_type,
- int (*scaler_func)(enum exynos_dm_type dm_type, u32 target_freq, unsigned int relation))
+ int (*scaler_func)(enum exynos_dm_type dm_type, void *devdata, u32 target_freq, unsigned int relation))
{
return 0;
}