From patchwork Fri Feb 15 12:44:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14850 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 E6ED423E2E for ; Fri, 15 Feb 2013 12:45:55 +0000 (UTC) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by fiordland.canonical.com (Postfix) with ESMTP id 950E5A197CC for ; Fri, 15 Feb 2013 12:45:55 +0000 (UTC) Received: by mail-ve0-f182.google.com with SMTP id ox1so3026780veb.41 for ; Fri, 15 Feb 2013 04:45:55 -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=LGB3C41UjXUAvLlavLU4AFI4jxa88npOW9n6Czmq3Yg=; b=PKnufG5nYamb8NAi0r5ZvK2VKUYegZbHt4yeSLcILcCpc2jzW4vqRY1ySNLG2XsQ0M Xk3Xr/p1KEo1kw2sCoIAihoEF6zAN6lVA174JrLunMFg6xNSx/heoPEHRrg+uC+orMEY JRT/kqUVTWqQNf4eAwo5WKKu1TZ/n37CHgMRYW3ptb++4+YqNmxfxeGCWAKY0pnhAgY2 FfKPfmNFdbpCnSUTUhnpKY1a/YmTcGycn+ZsJSFIYE8VoHXvPN8E0wb/N2bMm7CPSIlT nOC79kSe54sSWIjQSVGruxe619S4cMZMcm4sb1wA2ufNFiyKgIbT9WKVOO3rGfu7wrig Wd/w== X-Received: by 10.52.69.74 with SMTP id c10mr2625036vdu.3.1360932355083; Fri, 15 Feb 2013 04:45:55 -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 oa5csp10813vcb; Fri, 15 Feb 2013 04:45:54 -0800 (PST) X-Received: by 10.195.13.11 with SMTP id eu11mr3942968wjd.39.1360932354154; Fri, 15 Feb 2013 04:45:54 -0800 (PST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id cu8si1046041wib.27.2013.02.15.04.45.53 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 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-f172.google.com with SMTP id ez12so1099018wid.5 for ; Fri, 15 Feb 2013 04:45:53 -0800 (PST) X-Received: by 10.180.79.65 with SMTP id h1mr5792150wix.15.1360932351195; Fri, 15 Feb 2013 04:45:51 -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.45.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:45:50 -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, Martin Bergstrom , Lee Jones Subject: [PATCH 05/40] ab8500-fg: Report unscaled capacity Date: Fri, 15 Feb 2013 12:44:35 +0000 Message-Id: <1360932310-30065-6-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: ALoCoQlMXpEosy4FXacRH/z5AlavrD2dXSiuaRBpCgMubrhBeMgrrghJSPr9d47/Ym/gog5YzzNq From: Martin Bergstrom Unscaled capacity should be reported for POWER_SUPPLY_PROP_CAPACITY. Signed-off-by: Martin Bergstrom Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Tested-by: Jonas ABERG --- drivers/power/ab8500_fg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 9d33546..44d8faa 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -2153,9 +2153,7 @@ static int ab8500_fg_get_property(struct power_supply *psy, val->intval = di->bat_cap.prev_mah; break; case POWER_SUPPLY_PROP_CAPACITY: - if (di->bm->capacity_scaling) - val->intval = di->bat_cap.cap_scale.scaled_cap; - else if (di->flags.batt_unknown && !di->bm->chg_unknown_bat && + if (di->flags.batt_unknown && !di->bm->chg_unknown_bat && di->flags.batt_id_received) val->intval = 100; else