Skip to content

Commit

Permalink
clock: add stmmac clock for ethernet driver
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Miao <[email protected]>
  • Loading branch information
realmz committed Sep 13, 2013
1 parent 206f060 commit 3036dcc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions arch/blackfin/mach-bf609/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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"),
Expand All @@ -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)
Expand Down

0 comments on commit 3036dcc

Please sign in to comment.