Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350655
b: refs/heads/master
c: 5dc3443
h: refs/heads/master
i:
  350653: f74c641
  350651: ceb13d7
  350647: ae6e8ee
  350639: fc43f52
  350623: fd53bfc
  350591: 850b27c
v: v3
  • Loading branch information
Pali Rohár authored and Anton Vorontsov committed Feb 3, 2013
1 parent ae21824 commit 2094e5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 60a1c4d41b3af91366bcb2a52b30b2050a48273e
refs/heads/master: 5dc3443eb0d9d3688a6e5a3b4ebb9000d81ff6ba
10 changes: 5 additions & 5 deletions trunk/drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static int bq27x00_battery_read_energy(struct bq27x00_device_info *di)
}

/*
* Return the battery temperature in tenths of degree Celsius
* Return the battery temperature in tenths of degree Kelvin
* Or < 0 if something fails.
*/
static int bq27x00_battery_read_temperature(struct bq27x00_device_info *di)
Expand All @@ -312,10 +312,8 @@ static int bq27x00_battery_read_temperature(struct bq27x00_device_info *di)
return temp;
}

if (bq27xxx_is_chip_version_higher(di))
temp -= 2731;
else
temp = ((temp * 5) - 5463) / 2;
if (!bq27xxx_is_chip_version_higher(di))
temp = 5 * temp / 2;

return temp;
}
Expand Down Expand Up @@ -641,6 +639,8 @@ static int bq27x00_battery_get_property(struct power_supply *psy,
break;
case POWER_SUPPLY_PROP_TEMP:
ret = bq27x00_simple_value(di->cache.temperature, val);
if (ret == 0)
val->intval -= 2731;
break;
case POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW:
ret = bq27x00_simple_value(di->cache.time_to_empty, val);
Expand Down

0 comments on commit 2094e5c

Please sign in to comment.