summaryrefslogtreecommitdiff
path: root/src/soc/samsung/exynos5420/i2c.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/exynos5420/i2c.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/exynos5420/i2c.c')
-rw-r--r--src/soc/samsung/exynos5420/i2c.c9
1 files changed, 3 insertions, 6 deletions
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(&current);
- end = current;
- mono_time_add_usecs(&end, Hsi2cTimeout * 1000);
- while (mono_time_before(&current, &end)) {
+ stopwatch_init_msecs_expire(&sw, Hsi2cTimeout);
+ while (!stopwatch_expired(&sw)) {
int ret = hsi2c_check_transfer(i2c);
if (ret)
return ret;
- timer_monotonic_get(&current);
}
return 0;
}