Skip to content

Commit

Permalink
rx51_battery: Fix reporting temperature
Browse files Browse the repository at this point in the history
This patch fixing units (1/10 °C) in which is temperature reported.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
  • Loading branch information
Pali Rohár authored and Anton Vorontsov committed Apr 17, 2013
1 parent 0bbb06e commit 5958485
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/power/rx51_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)

/* First check for temperature in first direct table */
if (raw < ARRAY_SIZE(rx51_temp_table1))
return rx51_temp_table1[raw] * 100;
return rx51_temp_table1[raw] * 10;

/* Binary search RAW value in second inverse table */
while (max - min > 1) {
Expand All @@ -132,7 +132,7 @@ static int rx51_battery_read_temperature(struct rx51_device_info *di)
break;
}

return (rx51_temp_table2_first - min) * 100;
return (rx51_temp_table2_first - min) * 10;
}

/*
Expand Down

0 comments on commit 5958485

Please sign in to comment.