From patchwork Tue May 3 02:23:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 8999971 Return-Path: X-Original-To: patchwork-linux-rockchip@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 A90949F1C1 for ; Tue, 3 May 2016 02:24:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBF772026D for ; Tue, 3 May 2016 02:24:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED46D200FE for ; Tue, 3 May 2016 02:24:42 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1axQ0u-00037m-39; Tue, 03 May 2016 02:24:40 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1axQ0o-00035K-TS; Tue, 03 May 2016 02:24:39 +0000 Received: by mail-pa0-f52.google.com with SMTP id xk12so3209299pac.0; Mon, 02 May 2016 19:24:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Wbl7c1H5EEwYXds3DzHm3yqvhHeIR28g8GdZObgAmjg=; b=WBMYjWre3yWLJvDMxYPIsFQdVfpv0+LGTqVgUq83B1eREMWOZlTiyDa43UDZi7WTEX 5+sfURvd7jo7EvMBYfytz2UR2JyUeBtBG+mTazvVyXDbww/Nt7FXCndJ3iXdtJJnTGfg 1NK+myrp6bud9uZA3ds9Me6cd+1YEGp1eZpH1sG+0D08KYvPXhneprR5rCTs11vVn2UH jaxTgGSo7IH2gchEXYQJIsBNN/+1NnaWIOPEZ9PTLHPgC4ur7ysU4NXCX3T7gzauoOAJ CPOdZVuo3JSFDsTN5Qx2HamDbSoirt5bX/7fjwSLa8tjieqKCHUKSZi/rHG8zQ9NbK+G jTTw== X-Gm-Message-State: AOPr4FVt+K13xlapCrGRHhXTC2HoeJDPy5M6URoAmMv6rYnmEtwU10e27DVar2Klz59vfw== X-Received: by 10.66.2.165 with SMTP id 5mr14885215pav.18.1462242253141; Mon, 02 May 2016 19:24:13 -0700 (PDT) Received: from localhost.localdomain ([104.37.5.149]) by smtp.gmail.com with ESMTPSA id c190sm1035535pfb.33.2016.05.02.19.24.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 02 May 2016 19:24:11 -0700 (PDT) From: Caesar Wang To: edubezval@gmail.com Subject: [PATCH] thermal: rockchip: use the usleep_range instead of udelay Date: Tue, 3 May 2016 10:23:50 +0800 Message-Id: <1462242230-20873-1-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160502_192434_989962_D76BBB70 X-CRM114-Status: UNSURE ( 9.79 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.4 (--) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, heiko@sntech.de, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, rui.zhang@intel.com, linux-arm-kernel@lists.infradead.org, Caesar Wang MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Documentation/timers/timers-howto.txt recommends to use usleep_range on delays > 10usec. The usleep_range indeed reduces CPU load, since the udelay will busy wait for enough loop cycles to achieve the desired delay. Fixes commit b06c52db39fd ("thermal: rockchip: handle the power sequence for tsadc controller"). Cc: Zhang Rui Cc: Eduardo Valentin Cc: Heiko Stuebner Suggested-by: Eduardo Valentin Signed-off-by: Caesar Wang --- drivers/thermal/rockchip_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c index 86a1ab0..5d491f1 100644 --- a/drivers/thermal/rockchip_thermal.c +++ b/drivers/thermal/rockchip_thermal.c @@ -547,10 +547,10 @@ static void rk_tsadcv3_initialize(struct regmap *grf, void __iomem *regs, regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_ON); mdelay(10); regmap_write(grf, GRF_TSADC_TESTBIT_L, GRF_TSADC_TSEN_PD_OFF); - udelay(100); /* The spec note says at least 15 us */ + usleep_range(15, 100); /* The spec note says at least 15 us */ regmap_write(grf, GRF_SARADC_TESTBIT, GRF_SARADC_TESTBIT_ON); regmap_write(grf, GRF_TSADC_TESTBIT_H, GRF_TSADC_TESTBIT_H_ON); - udelay(200); /* The spec note says at least 90 us */ + usleep_range(90, 200); /* The spec note says at least 90 us */ } if (tshut_polarity == TSHUT_HIGH_ACTIVE)