pass-hal: rpi: Remove unsupportd backend functions 70/253270/1 accepted/tizen/unified/20210208.134728 submit/tizen/20210208.080602
authorChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Feb 2021 06:26:32 +0000 (15:26 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 8 Feb 2021 06:26:35 +0000 (15:26 +0900)
Remove unsupportd backend functions as following:
- remove hotplug_ops because rpi4 has been supported the dynamic CPU hotplug
- remove the up_threshold and down_threshold of ondemand governor
because rpi4 uses the schedutil cpufreq governor.

Change-Id: I1fe1a3f8eebae12608779d64bfbc554a9f024ee5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-backend-power.c

index 403f790d83fbb72a19b2ff8ee9bc4dc85c828461..00a4dd88969861a94afcc68829031e26a3407da6 100644 (file)
@@ -240,46 +240,6 @@ static int cpu_dvfs_get_available_max_freq(char *res_name)
        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,
@@ -290,69 +250,8 @@ static struct pass_resource_dvfs_ops cpu_dvfs_ops =  {
        .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)
@@ -471,7 +370,6 @@ static int power_rpi4_init(void **data)
 
        /* 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;