Skip to content

Commit

Permalink
power: supply: bq25890: Enable charging on boards where we skip reset
Browse files Browse the repository at this point in the history
On boards where the "linux,skip-reset" boolean property is set we don't
reset the charger; and on some boards where the fw takes care of
initalizition F_CHG_CFG is set to 0 before handing control over to the OS.

Explicitly set F_CHG_CFG to 1 on boards where we don't reset the charger,
so that charging is always enabled on these boards, like it is always
enabled on boards where we do reset the charger.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
  • Loading branch information
Hans de Goede authored and Sebastian Reichel committed Feb 1, 2022
1 parent 40428bd commit 06c7509
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/power/supply/bq25890_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,17 @@ static int bq25890_hw_init(struct bq25890_device *bq)
dev_dbg(bq->dev, "Reset failed %d\n", ret);
return ret;
}
} else {
/*
* Ensure charging is enabled, on some boards where the fw
* takes care of initalizition F_CHG_CFG is set to 0 before
* handing control over to the OS.
*/
ret = bq25890_field_write(bq, F_CHG_CFG, 1);
if (ret < 0) {
dev_dbg(bq->dev, "Enabling charging failed %d\n", ret);
return ret;
}
}

/* disable watchdog */
Expand Down

0 comments on commit 06c7509

Please sign in to comment.