aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorJohan Palsson <johan.palsson@stericsson.com>2011-03-16 10:05:14 +0100
committerJonas ABERG <jonas.aberg@stericsson.com>2011-03-16 13:17:09 +0100
commitb0f0e9c93cabc87975b0ce0d039707edda5cb6b8 (patch)
treec0c3ffcfb47db8ca08e4db9a6700cd159cd40a7c /drivers/power
parent501c770ec50b2843cf6f7101a010b2d0199f22ce (diff)
power: ab8500_bm: Filter spurious temp irqs on AB8500 cut 3.0
We have the same problems with spurious temperature IRQs on AB8500 cut 3.0 just as on previous versions. These will have to be ignored ST-Ericsson Linux next: - ST-Ericsson ID: - ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I29a94aadb34d27bf3a1d1ab0460d514fe9dd8798 Signed-off-by: Johan Palsson <johan.palsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18413 Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com> Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ab8500_btemp.c82
1 files changed, 62 insertions, 20 deletions
diff --git a/drivers/power/ab8500_btemp.c b/drivers/power/ab8500_btemp.c
index ac6b4a2e19f..c1ba6ed129a 100644
--- a/drivers/power/ab8500_btemp.c
+++ b/drivers/power/ab8500_btemp.c
@@ -558,8 +558,9 @@ static irqreturn_t ab8500_btemp_templow_handler(int irq, void *_di)
case AB8500_CUT1P0:
case AB8500_CUT1P1:
case AB8500_CUT2P0:
+ case AB8500_CUT3P0:
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.0\n");
break;
default:
@@ -587,14 +588,26 @@ static irqreturn_t ab8500_btemp_templow_handler(int irq, void *_di)
static irqreturn_t ab8500_btemp_temphigh_handler(int irq, void *_di)
{
struct ab8500_btemp *di = _di;
+ switch (di->chip_id) {
+ case AB8500_CUT1P0:
+ case AB8500_CUT1P1:
+ case AB8500_CUT2P0:
+ case AB8500_CUT3P0:
+ dev_dbg(di->dev, "Ignore false btemp high irq"
+ " for ABB cut 1.0, 1.1, 2.0 and 3.0\n");
- dev_crit(di->dev, "Battery temperature is higher than MAX temp\n");
+ break;
+ default:
+ dev_crit(di->dev, "Battery temperature higher than MAX\n");
- di->events.btemp_high = true;
- di->events.btemp_medhigh = false;
- di->events.btemp_lowmed = false;
- di->events.btemp_low = false;
- power_supply_changed(&di->btemp_psy);
+ di->events.btemp_high = true;
+ di->events.btemp_medhigh = false;
+ di->events.btemp_lowmed = false;
+ di->events.btemp_low = false;
+ power_supply_changed(&di->btemp_psy);
+
+ break;
+ }
return IRQ_HANDLED;
}
@@ -609,14 +622,27 @@ static irqreturn_t ab8500_btemp_temphigh_handler(int irq, void *_di)
static irqreturn_t ab8500_btemp_lowmed_handler(int irq, void *_di)
{
struct ab8500_btemp *di = _di;
+ switch (di->chip_id) {
+ case AB8500_CUT1P0:
+ case AB8500_CUT1P1:
+ case AB8500_CUT2P0:
+ case AB8500_CUT3P0:
+ dev_dbg(di->dev, "Ignore false btemp low/med irq"
+ " for ABB cut 1.0, 1.1, 2.0 and 3.0\n");
- dev_dbg(di->dev, "Battery temperature is between low and medium\n");
+ break;
+ default:
+ dev_dbg(di->dev,
+ "Battery temperature is between low and medium\n");
- di->events.btemp_lowmed = true;
- di->events.btemp_medhigh = false;
- di->events.btemp_high = false;
- di->events.btemp_low = false;
- power_supply_changed(&di->btemp_psy);
+ di->events.btemp_lowmed = true;
+ di->events.btemp_medhigh = false;
+ di->events.btemp_high = false;
+ di->events.btemp_low = false;
+ power_supply_changed(&di->btemp_psy);
+
+ break;
+ }
return IRQ_HANDLED;
}
@@ -631,14 +657,28 @@ static irqreturn_t ab8500_btemp_lowmed_handler(int irq, void *_di)
static irqreturn_t ab8500_btemp_medhigh_handler(int irq, void *_di)
{
struct ab8500_btemp *di = _di;
+ switch (di->chip_id) {
+ case AB8500_CUT1P0:
+ case AB8500_CUT1P1:
+ case AB8500_CUT2P0:
+ case AB8500_CUT3P0:
+ dev_dbg(di->dev, "Ignore false btemp med/high irq"
+ " for ABB cut 1.0, 1.1, 2.0 and 3.0\n");
+
+ break;
+ default:
- dev_dbg(di->dev, "Battery temperature is between medium and high\n");
+ dev_dbg(di->dev,
+ "Battery temperature is between medium and high\n");
- di->events.btemp_medhigh = true;
- di->events.btemp_lowmed = false;
- di->events.btemp_high = false;
- di->events.btemp_low = false;
- power_supply_changed(&di->btemp_psy);
+ di->events.btemp_medhigh = true;
+ di->events.btemp_lowmed = false;
+ di->events.btemp_high = false;
+ di->events.btemp_low = false;
+ power_supply_changed(&di->btemp_psy);
+
+ break;
+ }
return IRQ_HANDLED;
}
@@ -674,13 +714,15 @@ 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.0
* and prior versions
*/
switch (di->chip_id) {
case AB8500_CUT1P0:
case AB8500_CUT1P1:
case AB8500_CUT2P0:
+ case AB8500_CUT3P0:
+
temp = di->bat_temp * 10;
break;