From patchwork Thu Sep 27 20:08:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11786 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 9F97C24140 for ; Thu, 27 Sep 2012 20:09:38 +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 0D538A1919E for ; Thu, 27 Sep 2012 20:09:37 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so5234855iej.11 for ; Thu, 27 Sep 2012 13:09:37 -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=5ID0nW6+EnYIHlZ0KnOwVOhDw0+mr4Eh8YSci8FU83I=; b=FStYvA9zE+kyV7O6VQIW1BEUdXDHr8A1cyYlGkZo3JV4xT0mdJRksVQJc4Wb1MDakJ 9md4P9fizVQXRYI+csgIlNPvUsNXHxZwlgOex9pA0YmS2DDEYFTo5ZyQfODOUDN1vVlB UzV1PCybaSz4kMvmAvjDEXlTcOQ0Pn0rBTH6M8n0D7NqW0StdKn4//gvKKqTu5MX5s1D kSSpor6L+Fyb48+r4Nnpd774HyZgODoliha5tWhpzoSyJM5aWqyzJQEpFRUekJ3YIv6D rACkROR8QVTO7RPdC/J79wPHst8kqhnm7CFbLiNYHTBWIQM5RSG+ktkbmGMd35UIL6lB /pOQ== Received: by 10.50.195.134 with SMTP id ie6mr4709230igc.28.1348776577821; Thu, 27 Sep 2012 13:09:37 -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 ex8csp436289igc; Thu, 27 Sep 2012 13:09:37 -0700 (PDT) Received: by 10.68.217.67 with SMTP id ow3mr14520016pbc.26.1348776577155; Thu, 27 Sep 2012 13:09:37 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id vn9si8390651pbc.17.2012.09.27.13.09.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of mathieu.poirier@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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-pa0-f50.google.com with SMTP id hz11so1847989pad.37 for ; Thu, 27 Sep 2012 13:09:37 -0700 (PDT) Received: by 10.66.79.166 with SMTP id k6mr12170541pax.44.1348776576923; Thu, 27 Sep 2012 13:09:36 -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.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 27 Sep 2012 13:09:36 -0700 (PDT) From: mathieu.poirier@linaro.org To: patches@linaro.org Subject: [PATCH 13/57] power: ab8500_bm: Ignore false btemp low interrupt Date: Thu, 27 Sep 2012 14:08:30 -0600 Message-Id: <1348776554-10019-14-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: ALoCoQm3vP7BBWWEkCy0RPOMoMzxYMXKgKhotEP4TXeUI2H9AO+h3KdObwQf8UooBZF+Ti1qf4mC From: Hakan Berg Ignore the low btemp interrupts for ab8500 3.0 and 3.3 Signed-off-by: Hakan Berg Signed-off-by: Mathieu Poirier Reviewed-by: Jonas ABERG --- drivers/power/ab8500_btemp.c | 22 +++++++++++----------- include/linux/mfd/abx500/ab8500.h | 5 +++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index 45b10ad..04f9dec 100644 --- a/drivers/power/ab8500_btemp.c +++ b/drivers/power/ab8500_btemp.c @@ -622,9 +622,9 @@ static irqreturn_t ab8500_btemp_templow_handler(int irq, void *_di) { struct ab8500_btemp *di = _di; - if (is_ab8500_2p0_or_earlier(di->parent)) { - dev_dbg(di->dev, "Ignore false btemp low irq" - " for ABB cut 1.0, 1.1 and 2.0\n"); + if (is_ab8500_3p3_or_earlier(di->parent)) { + dev_dbg(di->dev, "Ignore false btemp low irq"); + dev_dbg(di->dev, " for ABB cut 1.0, 1.1, 2.0 and 3.3\n"); } else { dev_crit(di->dev, "Battery temperature lower than -10deg c\n"); @@ -738,30 +738,30 @@ static int ab8500_btemp_get_temp(struct ab8500_btemp *di) int temp = 0; /* - * The BTEMP events are not reliabe on AB8500 cut2.0 + * The BTEMP events are not reliabe on AB8500 cut3.3 * and prior versions */ - if (is_ab8500_2p0_or_earlier(di->parent)) { + if (is_ab8500_3p3_or_earlier(di->parent)) { temp = di->bat_temp * 10; } else { if (di->events.btemp_low) { if (temp > di->btemp_ranges.btemp_low_limit) - temp = di->btemp_ranges.btemp_low_limit; + temp = di->btemp_ranges.btemp_low_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_high) { if (temp < di->btemp_ranges.btemp_high_limit) - temp = di->btemp_ranges.btemp_high_limit; + temp = di->btemp_ranges.btemp_high_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_lowmed) { if (temp > di->btemp_ranges.btemp_med_limit) - temp = di->btemp_ranges.btemp_med_limit; + temp = di->btemp_ranges.btemp_med_limit * 10; else temp = di->bat_temp * 10; } else if (di->events.btemp_medhigh) { if (temp < di->btemp_ranges.btemp_med_limit) - temp = di->btemp_ranges.btemp_med_limit; + temp = di->btemp_ranges.btemp_med_limit * 10; else temp = di->bat_temp * 10; } else @@ -1026,8 +1026,8 @@ static int __devinit ab8500_btemp_probe(struct platform_device *pdev) ab8500_btemp_periodic_work); /* Set BTEMP thermal limits. Low and Med are fixed */ - di->btemp_ranges.btemp_low_limit = BTEMP_THERMAL_LOW_LIMIT; - di->btemp_ranges.btemp_med_limit = BTEMP_THERMAL_MED_LIMIT; + di->btemp_ranges.btemp_low_limit = BTEMP_THERMAL_LOW_LIMIT * 10; + di->btemp_ranges.btemp_med_limit = BTEMP_THERMAL_MED_LIMIT * 10; ret = abx500_get_register_interruptible(di->dev, AB8500_CHARGER, AB8500_BTEMP_HIGH_TH, &val); diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index db8a1e3..087b445 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -340,6 +340,11 @@ static inline int is_ab8500_2p0_or_earlier(struct ab8500 *ab) return (is_ab8500(ab) && (ab->chip_id <= AB8500_CUT2P0)); } +static inline int is_ab8500_3p3_or_earlier(struct ab8500 *ab) +{ + return (is_ab8500(ab) && (ab->chip_id <= AB8500_CUT3P3)); +} + /* exclude also ab8505, ab9540... */ static inline int is_ab8500_2p0(struct ab8500 *ab) {