From patchwork Fri Jan 15 11:35:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 8039881 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 167DD9F859 for ; Fri, 15 Jan 2016 11:35:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FDA620444 for ; Fri, 15 Jan 2016 11:35:45 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F38C9203E5 for ; Fri, 15 Jan 2016 11:35:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2EBC0266085; Fri, 15 Jan 2016 12:35:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id AAC7426064C; Fri, 15 Jan 2016 12:35:04 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 214DE260612; Fri, 15 Jan 2016 12:35:03 +0100 (CET) Received: from cmccmta3.chinamobile.com (cmccmta3.chinamobile.com [221.176.66.81]) by alsa0.perex.cz (Postfix) with ESMTP id DA6672605F4 for ; Fri, 15 Jan 2016 12:34:54 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app12-12012 (RichMail) with SMTP id 2eec5698d950958-c0c80; Fri, 15 Jan 2016 19:34:41 +0800 (CST) X-RM-TRANSID: 2eec5698d950958-c0c80 X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.68.205.132]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65698d950d1c-4c20d; Fri, 15 Jan 2016 19:34:41 +0800 (CST) X-RM-TRANSID: 2ee65698d950d1c-4c20d From: Xiubo Li To: broonie@kernel.org Date: Fri, 15 Jan 2016 19:35:25 +0800 Message-Id: <1452857725-32414-3-git-send-email-lixiubo@cmss.chinamobile.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1452857725-32414-1-git-send-email-lixiubo@cmss.chinamobile.com> References: <1452857725-32414-1-git-send-email-lixiubo@cmss.chinamobile.com> Cc: alsa-devel@alsa-project.org, Xiubo Li , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH 2/2] ASoC: fsl-mpc5200: Use usleep_range() instead of msleep() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Since msleep() will sleep longer than intended time for values less than 20ms, this patch allows the use of usleep_range for just 1ms. usleep_range is a finer precision implementation of msleep and is designed to be a drop-in replacement for udelay where a precise sleep/busy-wait is unnecessary. More details see Documentation/timers/timers-howto.txt. Signed-off-by: Xiubo Li --- sound/soc/fsl/mpc5200_psc_ac97.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 0bab760..243700c 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -127,7 +128,7 @@ static void psc_ac97_cold_reset(struct snd_ac97 *ac97) mutex_unlock(&psc_dma->mutex); - msleep(1); + usleep_range(1000, 2000); psc_ac97_warm_reset(ac97); }