[PATCH] ARM: mx28: Clear CLKGATE bit prior to changing DIV field
Shawn Guo
shawn.guo at linaro.org
Wed Jan 18 23:20:49 EST 2012
On Thu, Jan 19, 2012 at 01:57:45AM -0200, Fabio Estevam wrote:
> 2012/1/19 Shawn Guo <shawn.guo at linaro.org>:
>
> > My proposal is we need to clk_prepare_enable before clk_set_rate a clock
> > if the clock is gated, and then clk_disable_unprepare the clock after
> > clk_set_rate is done. This applies whatever codes that want to
> > clk_set_rate a mxs clock.
>
> So something like:
>
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -809,6 +809,8 @@ int __init mx28_clocks_init(void)
> clk_prepare_enable(&xbus_clk);
> clk_prepare_enable(&emi_clk);
> clk_prepare_enable(&uart_clk);
> + clk_prepare_enable(&saif0_clk);
> + clk_prepare_enable(&saif1_clk);
>
> clk_set_parent(&lcdif_clk, &ref_pix_clk);
> clk_set_parent(&saif0_clk, &pll0_clk);
> @@ -822,6 +824,8 @@ int __init mx28_clocks_init(void)
> */
> clk_set_rate(&saif0_clk, 24000000);
> clk_set_rate(&saif1_clk, 24000000);
> + clk_disable_unprepare(&saif0_clk);
> + clk_disable_unprepare(&saif1_clk);
>
> clkdev_add_table(lookups, ARRAY_SIZE(lookups));
> ---
>
> didn't work on my tests (probe of mxs-saif fails with the same timeout message).
>
As far as I know, mxs-saif driver also has one clk_set_rate() being
called with the clock gated.
--
Regards,
Shawn
More information about the linux-arm-kernel
mailing list