From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Cc: Koji Matsuoka <koji.matsuoka.xm@renesas.com>,
Steve Longerbeam <steve_longerbeam@mentor.com>
Subject: [PATCH 1/2] media: i2c: adv7482: Fix wait procedure usleep_range from msleep
Date: Fri, 11 Jan 2019 15:43:44 +0000 [thread overview]
Message-ID: <20190111154345.29145-1-kieran.bingham+renesas@ideasonboard.com> (raw)
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
next reply other threads:[~2019-01-11 15:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 15:43 Kieran Bingham [this message]
2019-01-11 16:05 ` [PATCH 1/2] media: i2c: adv7482: Fix wait procedure usleep_range from msleep Kieran Bingham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190111154345.29145-1-kieran.bingham+renesas@ideasonboard.com \
--to=kieran.bingham+renesas@ideasonboard.com \
--cc=koji.matsuoka.xm@renesas.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=steve_longerbeam@mentor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).