linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] media: i2c: adv7482: Fix wait procedure usleep_range from msleep
@ 2019-01-11 15:43 Kieran Bingham
  2019-01-11 16:05 ` Kieran Bingham
  0 siblings, 1 reply; 2+ messages in thread
From: Kieran Bingham @ 2019-01-11 15:43 UTC (permalink / raw)
  To: linux-media, linux-renesas-soc, Kieran Bingham
  Cc: Koji Matsuoka, Steve Longerbeam

From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>

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 af0cdba377bc8a784cdae6a77fb7a822cebc7083)
Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
 drivers/media/i2c/adv748x/adv748x-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index 64eb1bfda581..097e5c3a8e7e 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -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);
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-11 16:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11 15:43 [PATCH 1/2] media: i2c: adv7482: Fix wait procedure usleep_range from msleep Kieran Bingham
2019-01-11 16:05 ` Kieran Bingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).