int (*get_max_freq)(char *res_name);
int (*set_max_freq)(char *res_name, int freq);
+ /* Get the minimum/maximum frequency which can be set to resource. */
+ int (*get_available_min_freq)(char *res_name);
+ int (*get_available_max_freq)(char *res_name);
+
/* Get and set the up_threshold to support boosting. */
int (*get_up_threshold)(char *res_name);
int (*set_up_threshold)(char *res_name, int up_threshold);
return dvfs->set_max_freq(res_name, freq);
}
+/* Get the minimum/maximum frequency which can be set to resource. */
+int pass_get_available_min_freq(struct pass_resource *res)
+{
+ struct pass_resource_dvfs_ops *dvfs;
+ char *res_name;
+ int res_type;
+
+ if (!res)
+ return -EINVAL;
+
+ res_name = res->cdata.res_name;
+ res_type = res->cdata.res_type;
+
+ dvfs = get_dvfs(res, res_type);
+ if (!dvfs)
+ return -EINVAL;
+
+ if (!dvfs->get_available_min_freq || !res_name)
+ return -EINVAL;
+
+ return dvfs->get_available_min_freq(res_name);
+}
+
+int pass_get_available_max_freq(struct pass_resource *res)
+{
+ struct pass_resource_dvfs_ops *dvfs;
+ char *res_name;
+ int res_type;
+
+ if (!res)
+ return -EINVAL;
+
+ res_name = res->cdata.res_name;
+ res_type = res->cdata.res_type;
+
+ dvfs = get_dvfs(res, res_type);
+ if (!dvfs)
+ return -EINVAL;
+
+ if (!dvfs->get_available_max_freq || !res_name)
+ return -EINVAL;
+
+ return dvfs->get_available_max_freq(res_name);
+}
+
/* Get and set the up_threshold for DVFS resource. */
int pass_get_up_threshold(struct pass_resource *res)
{
int pass_get_max_freq(struct pass_resource *res);
int pass_set_max_freq(struct pass_resource *res, int freq);
+/* Get the minimum/maximum frequency which can be set to resource. */
+int pass_get_available_min_freq(struct pass_resource *res);
+int pass_get_available_max_freq(struct pass_resource *res);
+
/* Get and set the up_threshold to support boosting. */
int pass_get_up_threshold(struct pass_resource *res);
int pass_set_up_threshold(struct pass_resource *res, int up_threshold);