From: Eric Bénard Date: Tue, 8 Jun 2010 09:02:57 +0000 (+0200) Subject: i.MX25: fix get_rate_otg to return the correct value X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6e92b49ae5ef48e1791e5df8368af1fe8b3bd9a;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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: Eric Bénard Signed-off-by: Sascha Hauer --- diff --git a/arch/arm/mach-mx25/clock.c b/arch/arm/mach-mx25/clock.c index f44d65765b9..84f0f1efea4 100644 --- a/arch/arm/mach-mx25/clock.c +++ b/arch/arm/mach-mx25/clock.c @@ -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)