aboutsummaryrefslogtreecommitdiff
path: root/src/soc/samsung/exynos5250/fb.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/fb.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/fb.c')
-rw-r--r--src/soc/samsung/exynos5250/fb.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/soc/samsung/exynos5250/fb.c b/src/soc/samsung/exynos5250/fb.c
index e0355fc715..48295a5f09 100644
--- a/src/soc/samsung/exynos5250/fb.c
+++ b/src/soc/samsung/exynos5250/fb.c
@@ -181,7 +181,7 @@ static int s5p_dp_config_video(struct s5p_dp_device *dp,
{
int timeout = 0;
struct exynos5_dp *base = dp->base;
- struct mono_time start, current, end;
+ struct stopwatch sw;
s5p_dp_config_video_slave_mode(dp, video_info);
s5p_dp_set_video_color_format(dp, video_info->color_depth,
@@ -194,20 +194,17 @@ static int s5p_dp_config_video(struct s5p_dp_device *dp,
return -ERR_PLL_NOT_UNLOCKED;
}
- timer_monotonic_get(&start);
- end = current = start;
- mono_time_add_usecs(&end, STREAM_ON_TIMEOUT * USECS_PER_MSEC);
+ stopwatch_init_msecs_expire(&sw, STREAM_ON_TIMEOUT);
do {
if (s5p_dp_is_slave_video_stream_clock_on(dp) == 0) {
timeout++;
break;
}
- timer_monotonic_get(&current);
- } while (mono_time_before(&current, &end));
+ } while (!stopwatch_expired(&sw));
if (!timeout) {
printk(BIOS_ERR, "Video Clock Not ok after %ldus.\n",
- mono_time_diff_microseconds(&start, &end));
+ stopwatch_duration_usecs(&sw));
return -ERR_VIDEO_CLOCK_BAD;
}
@@ -402,23 +399,20 @@ static int s5p_dp_hw_link_training(struct s5p_dp_device *dp,
int pll_is_locked = 0;
u32 data;
int lane;
- struct mono_time current, end;
+ struct stopwatch sw;
struct exynos5_dp *base = dp->base;
/* Stop Video */
clrbits_le32(&base->video_ctl_1, VIDEO_EN);
- timer_monotonic_get(&current);
- end = current;
- mono_time_add_msecs(&end, PLL_LOCK_TIMEOUT);
+ stopwatch_init_msecs_expire(&sw, PLL_LOCK_TIMEOUT);
while ((pll_is_locked = s5p_dp_get_pll_lock_status(dp)) == PLL_UNLOCKED) {
- if (mono_time_after(&current, &end)) {
+ if (stopwatch_expired(&sw)) {
/* Ignore this error, and try to continue */
printk(BIOS_ERR, "PLL is not locked yet.\n");
break;
}
- timer_monotonic_get(&current);
}
printk(BIOS_SPEW, "PLL is %slocked\n",
pll_is_locked == PLL_LOCKED ? "": "not ");