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: 13977 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 7C13B23E27 for ; Fri, 11 Jan 2013 13:13:31 +0000 (UTC) Received: from mail-vb0-f42.google.com (mail-vb0-f42.google.com [209.85.212.42]) by fiordland.canonical.com (Postfix) with ESMTP id 266AEA18C70 for ; Fri, 11 Jan 2013 13:13:31 +0000 (UTC) Received: by mail-vb0-f42.google.com with SMTP id fa15so1408884vbb.15 for ; Fri, 11 Jan 2013 05:13:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=/zkykPPWGNyQz39HfeZijhrgRTrhQm6hzv39/RB1E1c=; b=NgvI2whBvl87TjmNCqrkZmi+RfvlwVskxQltw+mFinWXtRvuA+1XN4yZZ8ugxrZU5c eQfRT36XiYR77EZByGHC/ZrqcWFXgsLqsBTglnlBIZFU7kWnw+MG1e0NoMedbLPPoMRA i/SsdjChQf4i0CzG8D3G+d7cvJ3IWdWO1CJ9biHjpQ9zEHoTDya6lf+rbWnSbDN41XYG 8jGidwauFr7SV81ShW8lnvrkC/6/6xbYjhjMooWxFsSTe49JXrRiFm9YEFinQGpn8qhW VmTZXxv00/GRJEV31kG6a9hHZzznky07YKDp5OW0EplLpHDnl9HIL9CS9JYYSd814QSY EAAA== X-Received: by 10.52.18.207 with SMTP id y15mr81409212vdd.8.1357910010431; Fri, 11 Jan 2013 05:13:30 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.145.101 with SMTP id st5csp111228veb; Fri, 11 Jan 2013 05:13:29 -0800 (PST) X-Received: by 10.194.240.233 with SMTP id wd9mr2621953wjc.54.1357910009550; Fri, 11 Jan 2013 05:13:29 -0800 (PST) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by mx.google.com with ESMTPS id g18si16391782wiw.13.2013.01.11.05.13.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 11 Jan 2013 05:13:29 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.177; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.177 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f177.google.com with SMTP id hm2so1015387wib.4 for ; Fri, 11 Jan 2013 05:13:29 -0800 (PST) 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 Cc: arnd@arndb.de, linus.walleij@stericsson.com, cbouatmailru@gmail.com, Jonas Aaberg , Lee Jones 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: ALoCoQl0UCUm547BP9Zb5eW+hEQ9bwDJa0vuhrsKvXv8W8qZjlMUwRFgXxqJ1mhpILxyi/akN2Nj 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);