From patchwork Fri Jan 11 13:12:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1965951 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id AC46A3FF0F for ; Fri, 11 Jan 2013 13:18:37 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TteRs-00025I-K7; Fri, 11 Jan 2013 13:15:04 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TteQM-0001IB-Gx for linux-arm-kernel@lists.infradead.org; Fri, 11 Jan 2013 13:13:32 +0000 Received: by mail-wi0-f181.google.com with SMTP id hq4so1014387wib.14 for ; Fri, 11 Jan 2013 05:13:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=/zkykPPWGNyQz39HfeZijhrgRTrhQm6hzv39/RB1E1c=; b=ZTZHJxxjzk9dblG26WYRmfO6cGb+l8j4hFkHljwXn2lX3VO8qUiL91OcMMPyNGF+P7 0VzoS7PL01c/Mp1L/p+qyvWPvg289azUSCZ0RtFPuYlHchLlW6J5rlmdvk1cx26f/CTu lIOd40Fae66yC5br6u++MQQdQ2tZVweXqmZ/HNvJ4XYhmrc8+vrMrqPzH/8gOyafZ/fz +T0bp4b5BiyQLXxUUNlEqdK0ZJobsDOEJAsE5M16JE3aGyrjxk2sTEVH9wNecB608vFL gZBOwMEWaoCc/fbm5gyiSA4XUunAcKNfp5CzFBWligLVXiUrv7NfnquJOYQCG8K44CSU JGkw== X-Received: by 10.180.93.3 with SMTP id cq3mr15573177wib.1.1357910009174; Fri, 11 Jan 2013 05:13:29 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id p2sm7204515wic.7.2013.01.11.05.13.27 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jan 2013 05:13:28 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/18] power: ab8500_fg: Replace msleep() with usleep_range() for greater accuracy Date: Fri, 11 Jan 2013 13:12:52 +0000 Message-Id: <1357909986-9262-5-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1357909986-9262-1-git-send-email-lee.jones@linaro.org> References: <1357909986-9262-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQk96A4UzL2glXOlf7SuROBOifOJlm65xOKdoqjRWLDdw66rcEOtfjLEYjMm/fZmAgv1K03v X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130111_081330_796661_685D9EBC X-CRM114-Status: GOOD ( 11.25 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.181 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jonas Aaberg , Lee Jones , linus.walleij@stericsson.com, arnd@arndb.de, cbouatmailru@gmail.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Jonas Aaberg Doing so provides a greater degree of accuracy when dealing with time-frames between 1us and 20ms. msleep() is only accurate for wake-ups greater than 20ms. Signed-off-by: Lee Jones Signed-off-by: Jonas ABERG Reviewed-by: Johan BJORNSTEDT --- drivers/power/ab8500_fg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 828529e..ca3ba88c 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -956,7 +956,7 @@ static int ab8500_fg_load_comp_volt_to_capacity(struct ab8500_fg *di) do { vbat += ab8500_fg_bat_voltage(di); i++; - msleep(5); + usleep_range(5000, 5001); } while (!ab8500_fg_inst_curr_done(di)); ab8500_fg_inst_curr_finalize(di, &di->inst_curr);