diff options
Diffstat (limited to 'src/soc/samsung/exynos5420')
-rw-r--r-- | src/soc/samsung/exynos5420/clock.c | 9 | ||||
-rw-r--r-- | src/soc/samsung/exynos5420/i2c.c | 9 |
2 files changed, 6 insertions, 12 deletions
diff --git a/src/soc/samsung/exynos5420/clock.c b/src/soc/samsung/exynos5420/clock.c index 5cf3583c87..91e61cb2d1 100644 --- a/src/soc/samsung/exynos5420/clock.c +++ b/src/soc/samsung/exynos5420/clock.c @@ -561,7 +561,7 @@ int clock_epll_set_rate(unsigned long rate) unsigned int epll_con, epll_con_k; unsigned int i; unsigned int lockcnt; - struct mono_time current, end; + struct stopwatch sw; epll_con = readl(&exynos_clock->epll_con0); epll_con &= ~((EPLL_CON0_LOCK_DET_EN_MASK << @@ -595,17 +595,14 @@ int clock_epll_set_rate(unsigned long rate) writel(epll_con, &exynos_clock->epll_con0); writel(epll_con_k, &exynos_clock->epll_con1); - timer_monotonic_get(¤t); - end = current; - mono_time_add_msecs(&end, TIMEOUT_EPLL_LOCK); + stopwatch_init_msecs_expire(&sw, TIMEOUT_EPLL_LOCK); while (!(readl(&exynos_clock->epll_con0) & (0x1 << EXYNOS5_EPLLCON0_LOCKED_SHIFT))) { - if (mono_time_after(¤t, &end)) { + if (stopwatch_expired(&sw)) { printk(BIOS_DEBUG, "%s: Timeout waiting for EPLL lock\n", __func__); return -1; } - timer_monotonic_get(¤t); } return 0; diff --git a/src/soc/samsung/exynos5420/i2c.c b/src/soc/samsung/exynos5420/i2c.c index 49875d79ed..8c6c361140 100644 --- a/src/soc/samsung/exynos5420/i2c.c +++ b/src/soc/samsung/exynos5420/i2c.c @@ -415,16 +415,13 @@ static int hsi2c_check_transfer(struct hsi2c_regs *regs) */ static int hsi2c_wait_for_transfer(struct hsi2c_regs *i2c) { - struct mono_time current, end; + struct stopwatch sw; - timer_monotonic_get(¤t); - end = current; - mono_time_add_usecs(&end, Hsi2cTimeout * 1000); - while (mono_time_before(¤t, &end)) { + stopwatch_init_msecs_expire(&sw, Hsi2cTimeout); + while (!stopwatch_expired(&sw)) { int ret = hsi2c_check_transfer(i2c); if (ret) return ret; - timer_monotonic_get(¤t); } return 0; } |