bq2589x: update driver

Update the BQ2589x charger driver to configure properly the boost
used as a VBUS 5V source.
Define the bits used for I2C registers configuration.
Return success in unused charger callbacks to avoid blocking the
charge state machine.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:38603
TEST=On Ryu P4 reworked with BQ25892, plug a C-A receptacle adapter and
see the 5V VBUS coming up, un-plug it and see VBUS going away,
try several PD/type-C charger and check the selected current limit.

Change-Id: I24b832b6d130ff6dfda1ce47f5e445d65279fa7d
Reviewed-on: https://chromium-review.googlesource.com/266063
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2015-04-16 11:12:01 -07:00
committed by ChromeOS Commit Bot
parent e4f8b16a62
commit 94baa433bc
3 changed files with 58 additions and 9 deletions

View File

@@ -248,6 +248,13 @@
#undef CONFIG_CHARGER_BQ25895
#undef CONFIG_CHARGER_TPS65090 /* Note: does not use CONFIG_CHARGER */
/*
* BQ2589x 5V boost current limit and voltage.
* Should be the combination of BQ2589X_BOOSTV_MV(voltage) and
* BQ2589X_BOOST_LIM_xxxMA.
*/
#undef CONFIG_CHARGER_BQ2589X_BOOST
/*
* Board specific charging current limit, in mA. If defined, the charge state
* machine will not allow the battery to request more current than this.