ab8500_btemp: Ignore false btemp low interrupt
authorHakan Berg <hakan.berg@stericsson.com>
Fri, 11 Jan 2013 13:12:57 +0000 (13:12 +0000)
committerAnton Vorontsov <anton@enomsg.org>
Wed, 16 Jan 2013 01:44:30 +0000 (17:44 -0800)
Ignore the low btemp interrupts for ab8500 3.0 and 3.3

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hakan Berg <hakan.berg@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
drivers/power/ab8500_btemp.c
include/linux/mfd/abx500/ab8500.h

index adebf6c6d1466a8a95b1c5824d89ad232e4453aa..b3f6467da7f3aa53b53493999748f8c926163c41 100644 (file)
@@ -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,10 +738,10 @@ 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) {
index 1cb5698b4d76a6bfe0b0a36d1c90a2f10101f9f6..9dd9b99099dfa4d32b7d834b1e21e8452acdf920 100644 (file)
@@ -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)
 {