提交 afbc74fd 编写于 作者: G Grazvydas Ignotas 提交者: Anton Vorontsov

power_supply: bq27x00: fix voltage and current units

The chip returns voltage and current in mV and mA, but
power supply class uses uV and uA, so add missing conversion.
Signed-off-by: NGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: NAnton Vorontsov <cbouatmailru@gmail.com>
上级 4e924a81
...@@ -125,7 +125,7 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di) ...@@ -125,7 +125,7 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di)
return ret; return ret;
} }
return volt; return volt * 1000;
} }
/* /*
...@@ -156,11 +156,11 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di) ...@@ -156,11 +156,11 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di)
} }
if (flags & BQ27000_FLAG_CHGS) { if (flags & BQ27000_FLAG_CHGS) {
dev_dbg(di->dev, "negative current!\n"); dev_dbg(di->dev, "negative current!\n");
return -curr; curr = -curr;
} }
} }
return curr; return curr * 1000;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册