Skip to content

Commit

Permalink
powerpc/512x: add clock structure for Video-IN (VIU) unit
Browse files Browse the repository at this point in the history
Allows using clk_get()/clk_enable()/clk_disable() for VIU
clock in the v4l2 video driver.

Signed-off-by: Hongjun Chen <hong-jun.chen@freescale.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Anatolij Gustschin authored and Grant Likely committed Aug 1, 2010
1 parent 12fb0eb commit 9e2089c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/powerpc/platforms/512x/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ static void diu_clk_calc(struct clk *clk)
clk->rate = rate;
}

static void viu_clk_calc(struct clk *clk)
{
unsigned long rate;

rate = sys_clk.rate;
rate /= 2;
clk->rate = rate;
}

static void half_clk_calc(struct clk *clk)
{
clk->rate = clk->parent->rate / 2;
Expand Down Expand Up @@ -412,6 +421,14 @@ static struct clk diu_clk = {
.calc = diu_clk_calc,
};

static struct clk viu_clk = {
.name = "viu_clk",
.flags = CLK_HAS_CTRL,
.reg = 1,
.bit = 18,
.calc = viu_clk_calc,
};

static struct clk axe_clk = {
.name = "axe_clk",
.flags = CLK_HAS_CTRL,
Expand Down Expand Up @@ -535,6 +552,7 @@ struct clk *rate_clks[] = {
&ref_clk,
&sys_clk,
&diu_clk,
&viu_clk,
&csb_clk,
&e300_clk,
&ips_clk,
Expand Down

0 comments on commit 9e2089c

Please sign in to comment.