From patchwork Fri Jan 15 11:35:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiubo Li X-Patchwork-Id: 8039871 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 5ECB89F6FA for ; Fri, 15 Jan 2016 11:35:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F458203F4 for ; Fri, 15 Jan 2016 11:35:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 32445203E1 for ; Fri, 15 Jan 2016 11:35:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 98C24265E06; Fri, 15 Jan 2016 12:35:12 +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 4D2582605F4; 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 8AED6260616; Fri, 15 Jan 2016 12:35:02 +0100 (CET) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by alsa0.perex.cz (Postfix) with ESMTP id 5D32A26058E for ; Fri, 15 Jan 2016 12:34:53 +0100 (CET) Received: from spf.mail.chinamobile.com (unknown[172.16.121.11]) by rmmx-syy-dmz-app01-12001 (RichMail) with SMTP id 2ee15698d94fbf3-537ac; Fri, 15 Jan 2016 19:34:40 +0800 (CST) X-RM-TRANSID: 2ee15698d94fbf3-537ac X-RM-SPAM-FLAG: 00000000 Received: from localhost (unknown[223.68.205.132]) by rmsmtp-syy-appsvr06-12006 (RichMail) with SMTP id 2ee65698d94fd1a-4c20b; Fri, 15 Jan 2016 19:34:40 +0800 (CST) X-RM-TRANSID: 2ee65698d94fd1a-4c20b From: Xiubo Li To: broonie@kernel.org Date: Fri, 15 Jan 2016 19:35:24 +0800 Message-Id: <1452857725-32414-2-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 1/2] ASoC: fsl_sai: 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/fsl_sai.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index fef264d..0754df7 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -919,7 +920,7 @@ static int fsl_sai_resume(struct device *dev) regcache_cache_only(sai->regmap, false); regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR); regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR); - msleep(1); + usleep_range(1000, 2000); regmap_write(sai->regmap, FSL_SAI_TCSR, 0); regmap_write(sai->regmap, FSL_SAI_RCSR, 0); return regcache_sync(sai->regmap);