summaryrefslogtreecommitdiff
path: root/driver/charger/sm5803.h
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-19 15:19:16 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-26 21:42:44 +0000
commit9df40ef14c84e6575c3fecd2a5522b077b6f34ca (patch)
treeb271ccdc82834c75c02a73dc110e865665911601 /driver/charger/sm5803.h
parent4c97ac1c9053d26a0ca40f5cca1e461191be0d50 (diff)
downloadchrome-ec-9df40ef14c84e6575c3fecd2a5522b077b6f34ca.tar.gz
SM5803: Improve flow control setting
This change adds a new Vbus sink enable command which will be called on initial sink connection and detach. This will separate out most of the FLOW1 and FLOW2 register control from the set_mode() driver API which is regularly called from the charger task. This means that, if charging on a port fails, the charging will no longer be automatically re-enabled by the charger task. Additionally, this folds the verification that we aren't disabling sourcing into the sink enable so board files no longer need to verify this before calling the sink enable/disable API. It also allows the OTG disable to fully clear the FLOW1 mode since calls to OTG are more targeted than the sink enable/disable, which happens any time another charge port is set. BRANCH=None BUG=b:163511546,b:165677311 TEST=on waddledee and drawlat, confirm expected FLOW1 contents and Vbus level: - sinking C0 or C1 - sourcing C0 or C1 - sourcing both C0 and C1 - sinking C0 while sourcing C1 - sinking C1 while sourcing C0 - battery cutoff with charger in C0 or C1 - no battery boot with charger in C0 or C1 - power role swap with HooToo hub in C0 and C1 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ifdc7786243bdf0a634d8db99b4deb53457232ad3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2372738 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/charger/sm5803.h')
-rw-r--r--driver/charger/sm5803.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/driver/charger/sm5803.h b/driver/charger/sm5803.h
index d16f000323..75e4885cbc 100644
--- a/driver/charger/sm5803.h
+++ b/driver/charger/sm5803.h
@@ -315,6 +315,7 @@ enum ec_error_list sm5803_get_chg_det(int chgnum, int *chg_det);
/* Expose Vbus discharge function */
enum ec_error_list sm5803_set_vbus_disch(int chgnum, int enable);
+enum ec_error_list sm5803_vbus_sink_enable(int chgnum, int enable);
void sm5803_interrupt(int chgnum);