From patchwork Fri Jan 11 15:43:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10758313 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8643717D2 for ; Fri, 11 Jan 2019 15:44:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7334729748 for ; Fri, 11 Jan 2019 15:44:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 677EC29D58; Fri, 11 Jan 2019 15:44:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F0A429748 for ; Fri, 11 Jan 2019 15:44:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731856AbfAKPod (ORCPT ); Fri, 11 Jan 2019 10:44:33 -0500 Received: from perceval.ideasonboard.com ([213.167.242.64]:59984 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730291AbfAKPod (ORCPT ); Fri, 11 Jan 2019 10:44:33 -0500 Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 832C553E; Fri, 11 Jan 2019 16:44:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1547221471; bh=4s+Ws+SAkl0QGeTpZNiLBCVce3enPIAmdzkV3LkC86Q=; h=From:To:Cc:Subject:Date:From; b=HOie09frxRd5hCkaUTd3XXsl0l7V08wd6ev7Wf5pnMCEIQBQ724ex5kvA/Ov4KR8h W2xppSoTqWnd7eJsAAJOjoPfcoy8UiK9i+1lGHew/JeKiOd+xKJJh6Yzf8BRMIzeY5 8EKP62BxMfpfZPRoGC+0Fr1cP8XsrJb1j5MTTeBg= From: Kieran Bingham To: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Kieran Bingham Cc: Koji Matsuoka , Steve Longerbeam Subject: [PATCH 1/2] media: i2c: adv7482: Fix wait procedure usleep_range from msleep Date: Fri, 11 Jan 2019 15:43:44 +0000 Message-Id: <20190111154345.29145-1-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.17.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Koji Matsuoka 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 (cherry picked from horms/renesas-bsp commit af0cdba377bc8a784cdae6a77fb7a822cebc7083) Signed-off-by: Steve Longerbeam --- 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);