Commit db78539f authored by Jonathan Neuschäfer's avatar Jonathan Neuschäfer Committed by Daniel Lezcano

clocksource/drivers/timer-npcm7xx: Enable timer 1 clock before use

In the WPCM450 SoC, the clocks for each timer can be gated individually.
To prevent the timer 1 clock from being gated, enable it explicitly.
Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20221104161850.2889894-3-j.neuschaefer@gmx.netSigned-off-by: default avatarDaniel Lezcano <daniel.lezcano@kernel.org>
parent aa3f72ea
...@@ -188,6 +188,7 @@ static void __init npcm7xx_clocksource_init(void) ...@@ -188,6 +188,7 @@ static void __init npcm7xx_clocksource_init(void)
static int __init npcm7xx_timer_init(struct device_node *np) static int __init npcm7xx_timer_init(struct device_node *np)
{ {
struct clk *clk;
int ret; int ret;
ret = timer_of_init(np, &npcm7xx_to); ret = timer_of_init(np, &npcm7xx_to);
...@@ -199,6 +200,15 @@ static int __init npcm7xx_timer_init(struct device_node *np) ...@@ -199,6 +200,15 @@ static int __init npcm7xx_timer_init(struct device_node *np)
npcm7xx_to.of_clk.rate = npcm7xx_to.of_clk.rate / npcm7xx_to.of_clk.rate = npcm7xx_to.of_clk.rate /
(NPCM7XX_Tx_MIN_PRESCALE + 1); (NPCM7XX_Tx_MIN_PRESCALE + 1);
/* Enable the clock for timer1, if it exists */
clk = of_clk_get(np, 1);
if (clk) {
if (!IS_ERR(clk))
clk_prepare_enable(clk);
else
pr_warn("%pOF: Failed to get clock for timer1: %pe", np, clk);
}
npcm7xx_clocksource_init(); npcm7xx_clocksource_init();
npcm7xx_clockevents_init(); npcm7xx_clockevents_init();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment