diff options
author | Arun Murthy <arun.murthy@stericsson.com> | 2011-06-22 14:58:53 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@linaro.org> | 2011-07-22 15:52:16 +0200 |
commit | 59a2773e7158e9e787a80a51aa19783f8088e5f3 (patch) | |
tree | 009e4eef5beebccf93a23ac4f22cd8732c3ad223 | |
parent | 011e976793efa374f16957af9f1630609480ec76 (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.c | 10 |
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; |