summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Miao <realmz6@gmail.com>2013-07-05 14:36:09 +0800
committerSteven Miao <realmz6@gmail.com>2013-09-13 10:42:32 +0800
commit3036dccf2c2a5186bb50939f412c54c6c74a0fb0 (patch)
tree8c45d555bcacd1bd7ecb63c37e5781107692f970
parent206f060c21503f33f9716710715cabba602355d5 (diff)
downloadlinux-stable-3036dccf2c2a5186bb50939f412c54c6c74a0fb0.tar.gz
linux-stable-3036dccf2c2a5186bb50939f412c54c6c74a0fb0.tar.bz2
linux-stable-3036dccf2c2a5186bb50939f412c54c6c74a0fb0.zip
clock: add stmmac clock for ethernet driver
Signed-off-by: Steven Miao <realmz6@gmail.com>
-rw-r--r--arch/blackfin/mach-bf609/clock.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf609/clock.c b/arch/blackfin/mach-bf609/clock.c
index 437d56c82281..dab8849af884 100644
--- a/arch/blackfin/mach-bf609/clock.c
+++ b/arch/blackfin/mach-bf609/clock.c
@@ -220,6 +220,12 @@ unsigned long sys_clk_get_rate(struct clk *clk)
}
}
+unsigned long dummy_get_rate(struct clk *clk)
+{
+ clk->parent->rate = clk_get_rate(clk->parent);
+ return clk->parent->rate;
+}
+
unsigned long sys_clk_round_rate(struct clk *clk, unsigned long rate)
{
unsigned long max_rate;
@@ -283,6 +289,10 @@ static struct clk_ops sys_clk_ops = {
.round_rate = sys_clk_round_rate,
};
+static struct clk_ops dummy_clk_ops = {
+ .get_rate = dummy_get_rate,
+};
+
static struct clk sys_clkin = {
.name = "SYS_CLKIN",
.rate = CONFIG_CLKIN_HZ,
@@ -364,6 +374,12 @@ static struct clk oclk = {
.parent = &pll_clk,
};
+static struct clk ethclk = {
+ .name = "stmmaceth",
+ .parent = &sclk0,
+ .ops = &dummy_clk_ops,
+};
+
static struct clk_lookup bf609_clks[] = {
CLK(sys_clkin, NULL, "SYS_CLKIN"),
CLK(pll_clk, NULL, "PLLCLK"),
@@ -375,6 +391,7 @@ static struct clk_lookup bf609_clks[] = {
CLK(sclk1, NULL, "SCLK1"),
CLK(dclk, NULL, "DCLK"),
CLK(oclk, NULL, "OCLK"),
+ CLK(ethclk, NULL, "stmmaceth"),
};
int __init clk_init(void)