mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
power: supply: rk818-battery: Speed up battery current readout
PMIC does averaging, driver does averaging on top of that averaging, and it's just too much averaging, and the speed suffers. Signed-off-by: Ondrej Jirman <megi@xff.cz>
This commit is contained in:
committed by
Mauro (mdrjr) Ribeiro
parent
ae2c178b23
commit
2fe4f7f800
@@ -903,12 +903,12 @@ int rk818_battery_get_property(struct rk818_battery *di,
|
||||
{
|
||||
switch (psp) {
|
||||
case POWER_SUPPLY_PROP_CURRENT_NOW:
|
||||
val->intval = di->current_avg * 1000;/*uA*/
|
||||
val->intval = rk818_bat_get_avg_current(di) * 1000;/*uA*/
|
||||
if (di->pdata->bat_mode == MODE_VIRTUAL)
|
||||
val->intval = VIRTUAL_CURRENT * 1000;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_VOLTAGE_NOW:
|
||||
val->intval = di->voltage_avg * 1000;/*uV*/
|
||||
val->intval = rk818_bat_get_avg_voltage(di) * 1000;/*uV*/
|
||||
if (di->pdata->bat_mode == MODE_VIRTUAL)
|
||||
val->intval = VIRTUAL_VOLTAGE * 1000;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user