return val;
}
-static int cpu_dvfs_get_up_threshold(char *res_name)
-{
- char path[PATH_MAX];
- int val, ret;
-
- if (!res_name)
- return -EINVAL;
-
- snprintf(path, PATH_MAX, "%s%s%s",
- CPUFREQ_PATH_PREFIX,
- res_name,
- CPUFREQ_UP_THRESHOLD_PATH_SUFFIX);
-
- ret = sysfs_read_int(path, &val);
- if (ret < 0)
- return ret;
-
- return val;
-}
-
-static int cpu_dvfs_set_up_threshold(char *res_name, int up_threshold)
-{
- char path[PATH_MAX];
- int ret;
-
- if ((!res_name) || (up_threshold < 0))
- return -EINVAL;
-
- snprintf(path, PATH_MAX, "%s%s%s",
- CPUFREQ_PATH_PREFIX,
- res_name,
- CPUFREQ_UP_THRESHOLD_PATH_SUFFIX);
-
- ret = sysfs_write_int(path, up_threshold);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
static struct pass_resource_dvfs_ops cpu_dvfs_ops = {
.get_curr_governor = cpu_dvfs_get_curr_governor,
.set_curr_governor = cpu_dvfs_set_curr_governor,
.set_max_freq = cpu_dvfs_set_max_freq,
.get_available_min_freq = cpu_dvfs_get_available_min_freq,
.get_available_max_freq = cpu_dvfs_get_available_max_freq,
- .get_up_threshold = cpu_dvfs_get_up_threshold,
- .set_up_threshold = cpu_dvfs_set_up_threshold,
-};
-
-static int cpu_hotplug_get_online_state(char *res_name, int cpu)
-{
- char path[PATH_MAX];
- int ret, online;
-
- if ((!res_name))
- return -EINVAL;
-
- snprintf(path, PATH_MAX, "%s%d%s",
- CPU_ONLINE_PATH_PREFIX,
- cpu,
- CPU_ONLINE_PATH_SUFFIX);
-
- ret = sysfs_read_int(path, &online);
- if (ret < 0)
- return ret;
-
- return online;
-}
-
-static int cpu_hotplug_set_online_state(char *res_name, int cpu, int on)
-{
- char path[PATH_MAX];
- int ret;
-
- if ((!res_name))
- return -EINVAL;
- if ((on != CPU_ONLINE_STATE_ON) && (on != CPU_ONLINE_STATE_OFF))
- return -EINVAL;
-
- /*
- * NOTE: Some ARM SoC series cannot turn off the CPU0
- * because of h/w design. To prevent the critical problem,
- * if someone try to turn off the CPU0, just return without any
- * opertaion.
- */
- if (on == 0 && cpu == 0) {
- return 0;
- }
-
- snprintf(path, PATH_MAX, "%s%d%s",
- CPU_ONLINE_PATH_PREFIX,
- cpu,
- CPU_ONLINE_PATH_SUFFIX);
-
- ret = sysfs_write_int(path, on);
- if (ret < 0)
- return ret;
-
- return 0;
-}
-
-static struct pass_resource_hotplug_ops cpu_hotplug_ops = {
- .get_online_state = cpu_hotplug_get_online_state,
- .set_online_state = cpu_hotplug_set_online_state,
- .get_online_min_num = NULL,
- .set_online_min_num = NULL,
- .get_online_max_num = NULL,
- .set_online_max_num = NULL,
+ .get_up_threshold = NULL,
+ .set_up_threshold = NULL,
};
static int cpu_tmu_get_temp(char *res_thermal_name)
/* Initialize each h/w resource */
cpu->dvfs = cpu_dvfs_ops;
- cpu->hotplug = cpu_hotplug_ops;
cpu->tmu = cpu_tmu_ops;
memory->get_fault_around_bytes = memory_get_fault_around_bytes;