@@ -276,8 +276,13 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
if (!timer->io_base)
return -ENXIO;
+ omap_hwmod_setup_one(oh_name);
+
/* After the dmtimer is using hwmod these clocks won't be needed */
- timer->fclk = clk_get(NULL, omap_hwmod_get_main_clk(oh));
+ if (oh->_clk)
+ timer->fclk = oh->_clk;
+ else
+ timer->fclk = clk_get(NULL, omap_hwmod_get_main_clk(oh));
if (IS_ERR(timer->fclk))
return PTR_ERR(timer->fclk);
@@ -297,7 +302,6 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer,
clk_put(src);
- omap_hwmod_setup_one(oh_name);
omap_hwmod_enable(oh);
__omap_dm_timer_init_regs(timer);
Timer failed to init properly with DT clock data, as it still tried to use clock info from hwmod. Changed init order slightly so that timer hwmod is initialized earlier, which also makes sure the timer clock is initialized and can be referenced from the driver. Signed-off-by: Tero Kristo <t-kristo@ti.com> --- arch/arm/mach-omap2/timer.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)