[PATCH v6 3/8] ARM: sunxi: Move the clock protection to machine hooks
Arnd Bergmann
arnd at arndb.de
Wed Apr 23 05:39:02 PDT 2014
On Thursday 17 April 2014, Maxime Ripard wrote:
> Since we start to have a lot of clocks to protect, some of them in a few boards
> only, it becomes difficult to handle the clock protection without having to add
> per machine exceptions.
>
> Move these where they belong, in the machine definition code.
>
> Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
I don't like the fact that these are required to be hardcoded
anywhere in source code.
> +#include <linux/clk.h>
> #include <linux/init.h>
> #include <linux/of_platform.h>
>
> @@ -19,9 +20,17 @@
>
> static void __init sun4i_dt_init(void)
> {
> + struct clk *clk;
> +
> sunxi_setup_restart();
>
> of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
> +
> + /* Make sure the clocks we absolutely need are enabled */
> + /* DDR clock */
> + clk = clk_get(NULL, "pll5_ddr");
> + if (!IS_ERR(clk))
> + clk_prepare_enable(clk);
> }
Isn't there already DT syntax to do the same? If not, should there be?
Arnd
More information about the linux-arm-kernel
mailing list