aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-06-22 14:58:53 +0530
committersaid m bagheri <ebgheri@steludxu2848.(none)>2011-06-29 10:30:36 +0200
commitd4670dfc833c9c211cce8e60b5f68a93da8800c0 (patch)
tree1fc9536d88483d417a319ff4aef62b7eb944630e
parent13e4349a253dd45b06b185d64dbd5deeb95c61e7 (diff)
downloadlinux-2.6.38-lt-ux500-d4670dfc833c9c211cce8e60b5f68a93da8800c0.tar.gz
power: ab5500-btemp: do not measure temp if battery is unknown
Since the battery is unknown, do not measure the battery temp it might provide some value maybe too high or low leading to system reboot ST-Ericsson Linux next: Not Tested ST-Ericsson ID: WP332221 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: I70b4cc959bfd2792a25379cc17a25dada4b1c051 Signed-off-by: Arun Murthy <arun.murthy@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25661 Reviewed-by: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
-rw-r--r--drivers/power/ab5500_btemp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/power/ab5500_btemp.c b/drivers/power/ab5500_btemp.c
index 8b6ff82a86b..04ad6bbb7ac 100644
--- a/drivers/power/ab5500_btemp.c
+++ b/drivers/power/ab5500_btemp.c
@@ -536,7 +536,15 @@ static int ab5500_btemp_get_property(struct power_supply *psy,
val->intval = di->bat->bat_type[di->bat->batt_id].name;
break;
case POWER_SUPPLY_PROP_TEMP:
- val->intval = di->bat_temp * 10;
+ if (di->bat->batt_id == BATTERY_UNKNOWN)
+ /*
+ * In case the battery is not identified, its assumed that
+ * we are using the power supply and since no monitoring is
+ * done for the same, a nominal temp is hardocded.
+ */
+ val->intval = 250;
+ else
+ val->intval = di->bat_temp * 10;
break;
default:
return -EINVAL;