summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Murthy <arun.murthy@stericsson.com>2011-06-22 14:58:53 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 10:59:53 +0200
commitc49247cb8478bce8563ed9985f694da5b07f7f9e (patch)
tree84766ad427dccef5e42aea1c790a8e560421dd43
parentda43309107d9b9fab2ece43fa2bdb3a6d1a4c11c (diff)
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;