power: max17042: do not lose accuracy calculating current_now
MyungJoo Ham
Acked-byPhilip Rakity<[email protected]> Date : 2011-08-13 13:19 (GMT+09:00)
Quoted 6 lines
PROP_CURRENT_NOWvalue is first divided then multiplied up causing a lose of accuracy. Use the same method asPROP_CURRENT_AVGto do the calculation.Signed-off-by Philip Rakity
Quoted 23 lines
---
drivers/power/max17042_battery.c| 3 +--1 files changed, 1 insertions(+), 2 deletions(-)drivers/power/max17042_battery.c +1
-2@@ -153,8 +153,7 @@ static int max17042_get_property(struct power_supply *psy, val->intval++; val->intval *=-1 ; } - val->intval >>=4 ; - val->intval *=1000000 *25 / chip->pdata->r_sns; + val->intval *=1562500 / chip->pdata->r_sns; }else {return -EINVAL ; }Signature · 1 line
1.7.0.4
MyungJoo Ham (함명주)
Mobile Software Platform Lab,
Digital Media and Communications (DMC) Business
Samsung Electronics
cell: +82-10-6714-2858 / office: +82-31-279-8033�淸�{.n�+돴윯돪�+%듚�깁負쪐w��{.n�+돴쪐{깸G쳺��{ay����,j�f"톒쉹��묎�z_溫(�쉸듶줷"얎�m����G쳺�◀?솳鈺�&x�~뤳턨O뺞촾퇉v�^�m����띠�◀?뻀�
Anton Vorontsov
AppliedQuoted 9 lines · MyungJoo Ham
Philip Rakity<[email protected]> Date : 2011-08-13 13:19 (GMT+09:00)
Quoted 6 lines
PROP_CURRENT_NOWvalue is first divided then multiplied up causing a lose of accuracy. Use the same method asPROP_CURRENT_AVGto do the calculation.Signed-off-by Philip RakityAcked-by MyungJoo Ham <[email protected]>
Applied, thanks!
Signature · 2 lines
Anton Vorontsov Email: [email protected]