Skip to content

Commit f0318bc

Browse files
committed
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 <[email protected]>
1 parent 6f72a07 commit f0318bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/power/supply/sbs-battery.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,9 @@ static int sbs_status_correct(struct i2c_client *client, int *intval)
354354

355355
ret = (s16)ret;
356356

357-
/* Not drawing current means full (cannot be not charging) */
358-
if (ret == 0)
359-
*intval = POWER_SUPPLY_STATUS_FULL;
357+
/* Not drawing current -> not charging (i.e. idle) */
358+
if (*intval != POWER_SUPPLY_STATUS_FULL && ret == 0)
359+
*intval = POWER_SUPPLY_STATUS_NOT_CHARGING;
360360

361361
if (*intval == POWER_SUPPLY_STATUS_FULL) {
362362
/* Drawing or providing current when full */

0 commit comments

Comments
 (0)