From patchwork Thu Sep 27 20:08:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11804 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 9917C24140 for ; Thu, 27 Sep 2012 20:10:00 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3B747A18B18 for ; Thu, 27 Sep 2012 20:10:00 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234855iej.11 for ; Thu, 27 Sep 2012 13:10:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tk+gq89brcxtcljXSCUvV1QrWIeS6P8RKuWfN4fl1RY=; b=HBKmFwwBNCJreXyUdNLN0NVuMfJTQeP3s2MWazTz9wDeyNPnzfSlemBh8K5nNKfJHu JvChRjlfOm3D+xrTvXdBqfhFPBsJwGES/fMKPp+5LYe8HZbSW8o47FIYwJ1XnGlcbex+ cuhMVBXxKi3BlxLoYctBeSnQp1t1q6BCDNTTXjDGNfHBPCDJ8T8HMpNtK4tKNrxwNnIr uJn70XJvRpo+TTJ5skA50lOlnF5Hx5V/EoA59Oep0qeFK0mTbLxalttqUgX5Jp7sa3Ag booqANxO3b58jmO6sVvVufMO0myiKlQY1EDxVvXqoAIqCLKiPbB8S155MecevFHpj3b1 osPw== Received: by 10.50.0.193 with SMTP id 1mr4747674igg.0.1348776599895; Thu, 27 Sep 2012 13:09:59 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp436334igc; Thu, 27 Sep 2012 13:09:59 -0700 (PDT) Received: by 10.68.237.3 with SMTP id uy3mr14506718pbc.30.1348776599337; Thu, 27 Sep 2012 13:09:59 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pi9si5467641pbb.12.2012.09.27.13.09.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) smtp.mail=mathieu.poirier@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md4so1686045pbc.37 for ; Thu, 27 Sep 2012 13:09:59 -0700 (PDT) Received: by 10.68.203.195 with SMTP id ks3mr14486144pbc.79.1348776598996; Thu, 27 Sep 2012 13:09:58 -0700 (PDT) Received: from localhost.localdomain (S0106002369de4dac.cg.shawcable.net. [70.73.24.112]) by mx.google.com with ESMTPS id sa2sm1587890pbc.4.2012.09.27.13.09.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:58 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 31/57] power: ab8500_fg: fix to use correct battery charge full design Date: Thu, 27 Sep 2012 14:08:48 -0600 Message-Id: <1348776554-10019-32-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> References: <1348776554-10019-1-git-send-email-mathieu.poirier@linaro.org> X-Gm-Message-State: ALoCoQkEHv+Mp3N7UoD8h5hsgjtfNsTYT+tvh67PI+NRFbNDbLqUd3KjQUtckdT2p/331k3624Br From: Rajkumar Kasirajan If battery is not identified while fg probe, mah_max_design gets initialized with unknown battery's charge full design. Reinitialize mah_max_design if battery is identified after fg probe. Signed-off-by: Rajkumar Kasirajan Signed-off-by: Mathieu Poirier Reviewed-by: Jonas ABERG Reviewed-by: Vijaya Kumar K-1 Reviewed-by: Marcus COOPER Reviewed-by: Olivier CLERGEAUD Reviewed-by: Arun MURTHY Reviewed-by: Rupesh KUMAR Reviewed-by: Rabin VINCENT --- drivers/power/ab8500_fg.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/ab8500_fg.c b/drivers/power/ab8500_fg.c index 0e71e7e..5e4a46b 100644 --- a/drivers/power/ab8500_fg.c +++ b/drivers/power/ab8500_fg.c @@ -2258,9 +2258,9 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) case POWER_SUPPLY_PROP_TECHNOLOGY: switch (ext->type) { case POWER_SUPPLY_TYPE_BATTERY: - if (!di->flags.batt_id_received) { + if (!di->flags.batt_id_received && + di->bat->batt_id != BATTERY_UNKNOWN) { const struct abx500_battery_type *b; - b = &(di->bat->bat_type[di->bat->batt_id]); di->flags.batt_id_received = true;