提交 a6e92b49 编写于 作者: E Eric Bénard 提交者: Sascha Hauer

i.MX25: fix get_rate_otg to return the correct value

usb drivers need to get the right value for otg clock so
calculate and return it
Signed-off-by: NEric Bénard <eric@eukrea.com>
Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
上级 648beaf5
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册