mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-18 11:54:37 +08:00
power: supply: sbs-battery: fix idle battery status
A battery, that is neither charged, nor discharged is not always Full. If the charger is disabled for other reasons it might simply be idle and should be marked accordingly. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
This commit is contained in:
parent
6f72a07aa6
commit
f0318bc99c
@ -354,9 +354,9 @@ static int sbs_status_correct(struct i2c_client *client, int *intval)
|
||||
|
||||
ret = (s16)ret;
|
||||
|
||||
/* Not drawing current means full (cannot be not charging) */
|
||||
if (ret == 0)
|
||||
*intval = POWER_SUPPLY_STATUS_FULL;
|
||||
/* Not drawing current -> not charging (i.e. idle) */
|
||||
if (*intval != POWER_SUPPLY_STATUS_FULL && ret == 0)
|
||||
*intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
|
||||
|
||||
if (*intval == POWER_SUPPLY_STATUS_FULL) {
|
||||
/* Drawing or providing current when full */
|
||||
|
Loading…
Reference in New Issue
Block a user