aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoji Matsuoka <koji.matsuoka.xm@renesas.com>2019-01-11 15:43:44 +0000
committerRyo Kataoka <ryo.kataoka.wt@renesas.com>2019-03-22 20:50:31 +0900
commit0786087e9766327cc9f741013a3f54de87783bb3 (patch)
treeff8ed4c9eff8b2806636c5a978802ccad922b4d2
parent71bf321b544c72ee6582839f8b7bd36acce577e5 (diff)
downloadrenesas-bsp-0786087e9766327cc9f741013a3f54de87783bb3.tar.gz
media: i2c: adv7482: Fix wait procedure usleep_range from msleep
By Documentation/timers/timers-howto.txt, when waiting 20ms from 10us, it is correct to use usleep_range. this patch corrects it. Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com> (cherry picked from horms/renesas-bsp commit af0cdba377bc ("media: i2c: adv7482: Fix wait procedure usleep_range from msleep")) Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Link: https://patchwork.kernel.org/patch/10758319/ [koji.matsuoka.xm: the part of the patch for kernel v4.14.75 was rebased and imported] Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
-rw-r--r--drivers/media/i2c/adv748x/adv748x-core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index a57ccc47c93d2..947b23448e102 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -1,7 +1,7 @@
/*
* Driver for Analog Devices ADV748X HDMI receiver with AFE
*
- * Copyright (C) 2017 Renesas Electronics Corp.
+ * Copyright (C) 2017-2019 Renesas Electronics Corp.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -273,7 +273,8 @@ static int adv748x_write_regs(struct adv748x_state *state,
while (regs->page != ADV748X_PAGE_EOR) {
if (regs->page == ADV748X_PAGE_WAIT) {
- msleep(regs->value);
+ usleep_range(regs->value * 1000,
+ (regs->value * 1000) + 1000);
} else {
ret = adv748x_write(state, regs->page, regs->reg,
regs->value);