From patchwork Fri Feb 15 12:44:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14866 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 8E67423E2E for ; Fri, 15 Feb 2013 12:46:31 +0000 (UTC) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by fiordland.canonical.com (Postfix) with ESMTP id 41431A1828F for ; Fri, 15 Feb 2013 12:46:31 +0000 (UTC) Received: by mail-vc0-f171.google.com with SMTP id p1so2165314vcq.30 for ; Fri, 15 Feb 2013 04:46: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=Vu/8+5oCo67QWTZAv3tL1d1+nIfRLPqNcWWQAIOlols=; b=CN3DHFHR70TRR7sm1JkOe1wFbTuh/bZv1hxVID+SBZAQoF85KN8vXAtJpHqgewQlAx gKhYLcwj7sxzo5WLdNABLkzbZteNdneKoGy42XjEs/Flr+3R3qWgD9oxORVDjIANi6gT OkpGWY314J7wv6Ll4DsTE8OZaj1+hNQhQkpsWZ5sxGdWSAPdWFOGgQXhBj3rnncy4Ay6 EgCrl1adlM2+Am+rlVML1tfU4FzX9HPWAXXQQkGln5SikkngY5bSy1E7FfyWLuoyWVz6 IcvI/NAqurGiLkHb5lA7oZpMrJoF2B/uXnBzQBYhlBo4CWGYr7mySVaxfIWomQ4f6qXA 2udA== X-Received: by 10.58.40.9 with SMTP id t9mr3071791vek.10.1360932390782; Fri, 15 Feb 2013 04:46: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.221.4.5 with SMTP id oa5csp10873vcb; Fri, 15 Feb 2013 04:46:30 -0800 (PST) X-Received: by 10.180.79.37 with SMTP id g5mr5660389wix.24.1360932389472; Fri, 15 Feb 2013 04:46:29 -0800 (PST) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx.google.com with ESMTPS id c7si1034184wix.89.2013.02.15.04.46.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46:29 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.48 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.48 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-wg0-f48.google.com with SMTP id 16so2764568wgi.27 for ; Fri, 15 Feb 2013 04:46:29 -0800 (PST) X-Received: by 10.180.108.3 with SMTP id hg3mr3774192wib.33.1360932388991; Fri, 15 Feb 2013 04:46:28 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id bs6sm5133904wib.4.2013.02.15.04.46.26 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:46: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, sameo@linux.intel.com, Rupesh Kumar , Lee Jones Subject: [PATCH 21/40] ab8500-btemp: Defer btemp filtering while initialising Date: Fri, 15 Feb 2013 12:44:51 +0000 Message-Id: <1360932310-30065-22-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> References: <1360932310-30065-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkVL/p0Slj+dPNjx/omsihItMMOoY66SBrj1yor2Zhch7lTjC8ZSOFNBbNbaeuWkc0Jrmz6 From: Rupesh Kumar Due to btemp filtering enabled during init, temp values reported to charge algorithm driver started from 0. As a result,charge algorithm was going into wrong state and charging was stopped. Signed-off-by: Rupesh Kumar Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Reviewed-by: Martin SJOBLOM Reviewed-by: Philippe LANGLAIS --- drivers/power/ab8500_btemp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index fa60e3a..91ad3ed 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -609,7 +609,6 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) struct ab8500_btemp, btemp_periodic_work.work); if (!di->initialized) { - di->initialized = true; /* Identify the battery */ if (ab8500_btemp_id(di) < 0) dev_warn(di->dev, "failed to identify the battery\n"); @@ -622,8 +621,9 @@ static void ab8500_btemp_periodic_work(struct work_struct *work) * same temperature. Else only allow 1 degree change from previous * reported value in the direction of the new measurement. */ - if (bat_temp == di->prev_bat_temp || !di->initialized) { - if (di->bat_temp != di->prev_bat_temp || !di->initialized) { + if ((bat_temp == di->prev_bat_temp) || !di->initialized) { + if ((di->bat_temp != di->prev_bat_temp) || !di->initialized) { + di->initialized = true; di->bat_temp = bat_temp; power_supply_changed(&di->btemp_psy); }