提交 53041f02 编写于 作者: M Magnus Damm 提交者: Paul Mundt

sh: switch legacy clocks to clkdev

This patch converts the legacy clocks to register
using clkdev. Also the clock name is removed.
Signed-off-by: NMagnus Damm <damm@opensource.se>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 914ebf0b
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include <linux/compiler.h> #include <linux/compiler.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/clkdev.h>
#include <asm/clock.h> #include <asm/clock.h>
static int sh_clk_mstp32_enable(struct clk *clk) static int sh_clk_mstp32_enable(struct clk *clk)
...@@ -299,25 +300,21 @@ int __init sh_clk_div4_reparent_register(struct clk *clks, int nr, ...@@ -299,25 +300,21 @@ int __init sh_clk_div4_reparent_register(struct clk *clks, int nr,
#ifdef CONFIG_SH_CLK_CPG_LEGACY #ifdef CONFIG_SH_CLK_CPG_LEGACY
static struct clk master_clk = { static struct clk master_clk = {
.name = "master_clk",
.flags = CLK_ENABLE_ON_INIT, .flags = CLK_ENABLE_ON_INIT,
.rate = CONFIG_SH_PCLK_FREQ, .rate = CONFIG_SH_PCLK_FREQ,
}; };
static struct clk peripheral_clk = { static struct clk peripheral_clk = {
.name = "peripheral_clk",
.parent = &master_clk, .parent = &master_clk,
.flags = CLK_ENABLE_ON_INIT, .flags = CLK_ENABLE_ON_INIT,
}; };
static struct clk bus_clk = { static struct clk bus_clk = {
.name = "bus_clk",
.parent = &master_clk, .parent = &master_clk,
.flags = CLK_ENABLE_ON_INIT, .flags = CLK_ENABLE_ON_INIT,
}; };
static struct clk cpu_clk = { static struct clk cpu_clk = {
.name = "cpu_clk",
.parent = &master_clk, .parent = &master_clk,
.flags = CLK_ENABLE_ON_INIT, .flags = CLK_ENABLE_ON_INIT,
}; };
...@@ -332,6 +329,16 @@ static struct clk *onchip_clocks[] = { ...@@ -332,6 +329,16 @@ static struct clk *onchip_clocks[] = {
&cpu_clk, &cpu_clk,
}; };
#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
static struct clk_lookup lookups[] = {
/* main clocks */
CLKDEV_CON_ID("master_clk", &master_clk),
CLKDEV_CON_ID("peripheral_clk", &peripheral_clk),
CLKDEV_CON_ID("bus_clk", &bus_clk),
CLKDEV_CON_ID("cpu_clk", &cpu_clk),
};
int __init __deprecated cpg_clk_init(void) int __init __deprecated cpg_clk_init(void)
{ {
int i, ret = 0; int i, ret = 0;
...@@ -343,6 +350,8 @@ int __init __deprecated cpg_clk_init(void) ...@@ -343,6 +350,8 @@ int __init __deprecated cpg_clk_init(void)
ret |= clk_register(clk); ret |= clk_register(clk);
} }
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL);
clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册