aboutsummaryrefslogtreecommitdiff
path: root/src/soc/samsung/exynos5250/dp-reg.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-09-24 10:27:29 -0500
committerPatrick Georgi <pgeorgi@google.com>2015-03-21 17:01:04 +0100
commit43933466e74dbdeb38ba8f5882ae8ed2372e3e4b (patch)
tree974e6ffcb763b1bc0b1731aa76f1ae53796dd7b1 /src/soc/samsung/exynos5250/dp-reg.c
parent515bd135d2f175d7eaad91e9d39834eda44fd1c7 (diff)
exynos: convert to stopwatch API
Instead of open coding monotonic timer usage, use the stopwatch API. BUG=None BRANCH=None TEST=None Change-Id: I1c541c1c9f3fde0dec9163ad6cc94322538ac7f7 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Original-Commit-Id: 46ede0897687da6bcf730a8904f25e5a4485d6cd Original-Change-Id: Ia63a05850a1b6afdc42c2422332f77af516d27e3 Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/219716 Original-Reviewed-by: Julius Werner <jwerner@chromium.org> Original-Reviewed-by: David Hendricks <dhendrix@chromium.org> Original-Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: http://review.coreboot.org/8825 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/samsung/exynos5250/dp-reg.c')
-rw-r--r--src/soc/samsung/exynos5250/dp-reg.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/soc/samsung/exynos5250/dp-reg.c b/src/soc/samsung/exynos5250/dp-reg.c
index 1cc70887ce..018633e899 100644
--- a/src/soc/samsung/exynos5250/dp-reg.c
+++ b/src/soc/samsung/exynos5250/dp-reg.c
@@ -120,7 +120,7 @@ unsigned int s5p_dp_get_pll_lock_status(struct s5p_dp_device *dp)
int s5p_dp_init_analog_func(struct s5p_dp_device *dp)
{
u32 reg;
- struct mono_time current, end;
+ struct stopwatch sw;
struct exynos5_dp *base = dp->base;
writel(0x00, &base->dp_phy_pd);
@@ -135,17 +135,14 @@ int s5p_dp_init_analog_func(struct s5p_dp_device *dp)
clrbits_le32(&base->dp_pll_ctl, DP_PLL_PD);
- timer_monotonic_get(&current);
- end = current;
- mono_time_add_msecs(&end, PLL_LOCK_TIMEOUT);
+ stopwatch_init_msecs_expire(&sw, PLL_LOCK_TIMEOUT);
while (s5p_dp_get_pll_lock_status(dp) == PLL_UNLOCKED) {
- if (mono_time_after(&current, &end)) {
+ if (stopwatch_expired(&sw)) {
printk(BIOS_ERR, "%s: PLL is not locked\n",
__func__);
return -1;
}
- timer_monotonic_get(&current);
}
}
@@ -435,13 +432,11 @@ void s5p_dp_enable_video_master(struct s5p_dp_device *dp)
int s5p_dp_is_video_stream_on(struct s5p_dp_device *dp)
{
u32 reg, i = 0;
- struct mono_time current, end;
+ struct stopwatch sw;
struct exynos5_dp *base = dp->base;
/* Wait for 4 VSYNC_DET interrupts */
- timer_monotonic_get(&current);
- end = current;
- mono_time_add_msecs(&end, STREAM_ON_TIMEOUT);
+ stopwatch_init_msecs_expire(&sw, STREAM_ON_TIMEOUT);
do {
reg = readl(&base->common_int_sta_1);
@@ -451,8 +446,7 @@ int s5p_dp_is_video_stream_on(struct s5p_dp_device *dp)
}
if (i == 4)
break;
- timer_monotonic_get(&current);
- } while (mono_time_before(&current, &end));
+ } while (!stopwatch_expired(&sw));
if (i != 4) {
printk(BIOS_DEBUG, "s5p_dp_is_video_stream_on timeout\n");