From patchwork Thu Dec 13 15:21:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 13545 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 9182623E2A for ; Thu, 13 Dec 2012 15:22:11 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0118EA185E5 for ; Thu, 13 Dec 2012 15:22:10 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so2037420iag.11 for ; Thu, 13 Dec 2012 07:22:10 -0800 (PST) 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:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=tJ7N2Y/1ulBOaLyWrsGDTM41GfNHq5/i+JuHDp7yWbM=; b=h0lmbtdLPH2/2Y+8APas2O5o25WKIvCjAqhN/sW9lg/wDHfI9BHw+DCwTH0Yr995th tON1l9sRlje4mC4N8X/n9EU9+x9az/en8Rs2hmgsyyy9YzPIQMxKZ+G/vYfyN02Id5w6 EYKMcm/IA28LfWR9Rq1bhmQ+iUXrvvCyawCG4UbyCo6triTWredrZ80/cDfTstEjvMHn Yq6F5oSOrhl7nLSy5xxmyUiYMPtgv+t8Q5SLrSSMatZJXj60haHR8/nK851/8XDADPgD evsFghdnk/cuZSoUn/yfNr/ScW9wa/dWqLKnPDUpMYWniPSVmXTFbzETmOCJYwl1+NGy ip3w== Received: by 10.43.125.133 with SMTP id gs5mr1691023icc.54.1355412130435; Thu, 13 Dec 2012 07:22:10 -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.50.67.148 with SMTP id n20csp16260igt; Thu, 13 Dec 2012 07:22:09 -0800 (PST) Received: by 10.194.119.33 with SMTP id kr1mr9085340wjb.4.1355412129504; Thu, 13 Dec 2012 07:22:09 -0800 (PST) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by mx.google.com with ESMTPS id w4si10328681wiy.2.2012.12.13.07.22.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 07:22:09 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.53 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.53 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-f53.google.com with SMTP id ei8so859777wgb.32 for ; Thu, 13 Dec 2012 07:22:09 -0800 (PST) Received: by 10.194.10.74 with SMTP id g10mr9111516wjb.21.1355412129019; Thu, 13 Dec 2012 07:22:09 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id i6sm8200894wix.5.2012.12.13.07.22.07 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 13 Dec 2012 07:22:08 -0800 (PST) From: Lee Jones To: linux-kernel@vger.kernel.org Cc: cbou@mail.ru, Hakan Berg , Lee Jones Subject: [PATCH 09/18] power: ab8500_btemp: Ignore false btemp low interrupt Date: Thu, 13 Dec 2012 15:21:32 +0000 Message-Id: <1355412102-14265-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355412102-14265-1-git-send-email-lee.jones@linaro.org> References: <1355412102-14265-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkNrEbcWX/37ILcV924kUEJwRh6bXJg+jK6yupCcAkvtrdnPTEclIeiDnH3isrkx4zR81bO From: Hakan Berg Ignore the low btemp interrupts for ab8500 3.0 and 3.3 Signed-off-by: Lee Jones Signed-off-by: Hakan Berg Reviewed-by: Jonas ABERG Tested-by: Marcus COOPER --- drivers/power/ab8500_btemp.c | 20 ++++++++++---------- include/linux/mfd/abx500/ab8500.h | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c index efeb6dd..6f6a715 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)) { + if (is_ab8500_3p3_or_earlier(di->parent)) { dev_dbg(di->dev, "Ignore false btemp low irq" - " for ABB cut 1.0, 1.1 and 2.0\n"); + " 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 @@ -1030,8 +1030,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 1491044..46f5f62 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -335,6 +335,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) {