mips: loongsoon2ef: remove private clk api

As platforms are moving to COMMON_CLK in general, loongson2ef
stuck out as something that has a private implementation but
does not actually use it except for setting the frequency of
the CPU itself from the loongson2_cpufreq driver.

Change that driver to call the register setting function directly
and remove the rest of the stub implementation.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
This commit is contained in:
Arnd Bergmann
2020-04-09 11:02:28 +02:00
committed by Thomas Bogendoerfer
parent 5ceb89f8a3
commit c02e963044
6 changed files with 8 additions and 164 deletions

View File

@@ -20,7 +20,6 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <asm/clock.h>
#include <asm/idle.h>
#include <asm/mach-loongson2ef/loongson.h>
@@ -58,29 +57,20 @@ static int loongson2_cpufreq_target(struct cpufreq_policy *policy,
loongson2_clockmod_table[index].driver_data) / 8;
/* setting the cpu frequency */
clk_set_rate(policy->clk, freq * 1000);
loongson2_cpu_set_rate(freq);
return 0;
}
static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
struct clk *cpuclk;
int i;
unsigned long rate;
int ret;
cpuclk = clk_get(NULL, "cpu_clk");
if (IS_ERR(cpuclk)) {
pr_err("couldn't get CPU clk\n");
return PTR_ERR(cpuclk);
}
rate = cpu_clock_freq / 1000;
if (!rate) {
clk_put(cpuclk);
if (!rate)
return -EINVAL;
}
/* clock table init */
for (i = 2;
@@ -88,20 +78,16 @@ static int loongson2_cpufreq_cpu_init(struct cpufreq_policy *policy)
i++)
loongson2_clockmod_table[i].frequency = (rate * i) / 8;
ret = clk_set_rate(cpuclk, rate * 1000);
if (ret) {
clk_put(cpuclk);
ret = loongson2_cpu_set_rate(rate);
if (ret)
return ret;
}
policy->clk = cpuclk;
cpufreq_generic_init(policy, &loongson2_clockmod_table[0], 0);
return 0;
}
static int loongson2_cpufreq_exit(struct cpufreq_policy *policy)
{
clk_put(policy->clk);
return 0;
}