Skip to content

Commit

Permalink
i.MX25: fix get_rate_otg to return the correct value
Browse files Browse the repository at this point in the history
usb drivers need to get the right value for otg clock so
calculate and return it

Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Eric Bénard authored and Sascha Hauer committed Jul 26, 2010
1 parent 648beaf commit a6e92b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm/mach-mx25/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ static unsigned long get_rate_lcdc(struct clk *clk)

static unsigned long get_rate_otg(struct clk *clk)
{
return 48000000; /* FIXME */
unsigned long cctl = readl(CRM_BASE + CCM_CCTL);
unsigned long rate = get_rate_upll();

return (cctl & (1 << 23)) ? 0 : rate / ((0x3F & (cctl >> 16)) + 1);
}

static int clk_cgcr_enable(struct clk *clk)
Expand Down

0 comments on commit a6e92b4

Please sign in to comment.