]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: omap-timer: Update clock rate only if not populated
authorLokesh Vutla <lokeshvutla@ti.com>
Thu, 16 Aug 2018 12:56:55 +0000 (18:26 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 11 Sep 2018 00:48:19 +0000 (20:48 -0400)
timer_pre_probe() tries to populate the clock rate from DT. omap
timer driver tries to overwrite this value irrespective of the value
populated fro DT. So update this value only when DT doesn't populate
the clock rate.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
drivers/timer/omap-timer.c

index 138783b69fa0e6806524aaba86007720888273a7..f10df69092a4500f1951705df5960e9dbfd65f2b 100644 (file)
@@ -61,7 +61,8 @@ static int omap_timer_probe(struct udevice *dev)
        struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev);
        struct omap_timer_priv *priv = dev_get_priv(dev);
 
-       uc_priv->clock_rate = TIMER_CLOCK;
+       if (!uc_priv->clock_rate)
+               uc_priv->clock_rate = TIMER_CLOCK;
 
        /* start the counter ticking up, reload value on overflow */
        writel(0, &priv->regs->tldr);