From patchwork Tue Jan 15 14:09:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1979001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8F38EDF264 for ; Tue, 15 Jan 2013 14:12:40 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tv7Cf-00024j-4a; Tue, 15 Jan 2013 14:09:25 +0000 Received: from mail-bk0-f50.google.com ([209.85.214.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tv7Ca-00023Z-Qr for linux-arm-kernel@lists.infradead.org; Tue, 15 Jan 2013 14:09:21 +0000 Received: by mail-bk0-f50.google.com with SMTP id jf3so87066bkc.37 for ; Tue, 15 Jan 2013 06:09:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:x-gm-message-state; bh=NUZ3IpgB+Cvoj8Yym6GK3VG08cccc+hXDpuJdXhccZY=; b=J3zvDLgc/Iq/lxd352Ec0/fSiOLL95D/8GvpGRBYxrDZauyFYRX8VFc7lCF2ecaIqS jf0IHvWT3Og/kQI6Cv2k0eFjg7iTYyI8JqVrpfXYVG1acD+8OoHSfD6TWxDBMV03O7pg 80peuec+k9SiNCiIHgI7g1p7ki8KbYQ8juqWxV7VaIJx4XaoB4GZtABFPWr8seuBDwtS Ix1c4s5UZrrnJyyYaor/3Ih729Yofo/AxKM4EpbueKT64pi/ragfxbgPW9yGPFwpiwrc cuosD9pK+2DUHzGg57oH2IEt3+2fUocGfeO75XmCKMxGLQeLnNpAI23yaCSmSfyui/WS 4+jw== X-Received: by 10.204.4.133 with SMTP id 5mr41683272bkr.21.1358258958499; Tue, 15 Jan 2013 06:09:18 -0800 (PST) Received: from gmail.com (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id c10sm12838518bkw.1.2013.01.15.06.09.16 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 15 Jan 2013 06:09:17 -0800 (PST) Date: Tue, 15 Jan 2013 14:09:13 +0000 From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/18] power: ab8500_fg: Replace msleep() with usleep_range() for greater accuracy Message-ID: <20130115140913.GC9379@gmail.com> References: <1357909986-9262-1-git-send-email-lee.jones@linaro.org> <1357909986-9262-5-git-send-email-lee.jones@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1357909986-9262-5-git-send-email-lee.jones@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnaAMM/4d33J/TAjBDcgdDLcji0+E33fPaQfvSuZCy9mGr7Fxy+3AMc/s73hCJl8EWVF04h X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130115_090921_021850_EE0A11F7 X-CRM114-Status: GOOD ( 11.92 ) 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.214.50 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Jonas Aaberg , 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: , 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..78124587 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, 6000); } while (!ab8500_fg_inst_curr_done(di)); ab8500_fg_inst_curr_finalize(di, &di->inst_curr);