summaryrefslogtreecommitdiff
path: root/driver/charger
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-03-18 14:31:42 -0600
committerCommit Bot <commit-bot@chromium.org>2020-03-21 00:28:11 +0000
commitd68abb5d52c3474aa247a47c23375354d08be600 (patch)
treeff3b183a0a9ee29e6db0d52ed675d6ec14299d33 /driver/charger
parent9ce65e72ce2ad6207fba220e78aab69afc2f6ee9 (diff)
downloadchrome-ec-d68abb5d52c3474aa247a47c23375354d08be600.tar.gz
Charger: Add driver function for sourcing OTG
Fold charger_is_sourcing_otg_power into the charger driver structure. BUG=None BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0526495fff8464539e216d2cf80c34e09af2c418 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110530 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'driver/charger')
-rw-r--r--driver/charger/bq25710.c6
-rw-r--r--driver/charger/rt946x.c3
2 files changed, 2 insertions, 7 deletions
diff --git a/driver/charger/bq25710.c b/driver/charger/bq25710.c
index c258b0d7c6..b9a897d843 100644
--- a/driver/charger/bq25710.c
+++ b/driver/charger/bq25710.c
@@ -335,12 +335,6 @@ static enum ec_error_list bq25710_set_otg_current_voltage(int chgum,
return EC_ERROR_UNIMPLEMENTED;
}
-int charger_is_sourcing_otg_power(int port)
-{
- /* Add when needed. */
- return EC_ERROR_UNIMPLEMENTED;
-}
-
static enum ec_error_list bq25710_get_current(int chgnum, int *current)
{
int rv, reg;
diff --git a/driver/charger/rt946x.c b/driver/charger/rt946x.c
index 9dcae413a3..57cb1aef3d 100644
--- a/driver/charger/rt946x.c
+++ b/driver/charger/rt946x.c
@@ -672,7 +672,7 @@ static enum ec_error_list rt946x_enable_otg_power(int chgnum, int enabled)
(chgnum, RT946X_REG_CHGCTRL1, RT946X_MASK_OPA_MODE);
}
-int charger_is_sourcing_otg_power(int port)
+static int rt946x_is_sourcing_otg_power(int chgnum, int port)
{
int val;
@@ -1880,6 +1880,7 @@ const struct charger_drv rt946x_drv = {
.get_status = &rt946x_get_status,
.set_mode = &rt946x_set_mode,
.enable_otg_power = &rt946x_enable_otg_power,
+ .is_sourcing_otg_power = &rt946x_is_sourcing_otg_power,
.get_current = &rt946x_get_current,
.set_current = &rt946x_set_current,
.get_voltage = &rt946x_get_voltage,