ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85)
PATCH 1/1 ltc2941-battery-gauge: Fix typo in conversion formula (58 instead of 85)
The driver reported 30% less than actually measured. This turned out to be caused by a simple typo in the formula to calculate the LSB quantity.
Signed-off-by Mike Looijmans <[email protected]>
--- drivers/power/ltc2941-battery-gauge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/ltc2941-battery-gauge.c +1 -1
@@ -439,7 +439,7 @@ static int ltc294x_i2c_probe(struct i2c_client *client, }else {if (prescaler_exp >LTC2941_MAX_PRESCALER_EXP ) prescaler_exp =LTC2941_MAX_PRESCALER_EXP ; - info->Qlsb = ((58 *50000 ) / r_sense) / + info->Qlsb = ((85 *50000 ) / r_sense) / (128 / (1 << prescaler_exp)); }
Signature · 1 line
1.9.1
Hi,
Quoted 2 lines · Mike Looijmans
The driver reported 30% less than actually measured. This turned out to be caused by a simple typo in the formula to calculate the LSB quantity.
This is in my for-next queue since some time already and will be send to Torvalds in my 4.0-rc pull request.
-- Sebastian