summaryrefslogtreecommitdiff
path: root/include/charger.h
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2020-08-25 11:13:01 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-27 17:58:10 +0000
commit40a988f3fa4c259dcba1d2d8fa0ef84c6a867c88 (patch)
tree1587cb39f1ee9bf136454bb68123d86b58b422f1 /include/charger.h
parentffbc66137e4033eccd13a339043efbc24a0e8aab (diff)
downloadchrome-ec-40a988f3fa4c259dcba1d2d8fa0ef84c6a867c88.tar.gz
Charger: Add chgnum parameter to OTG set functions
Add the charger number as an input for setting OTG output current and enabling it, both in the charger driver and in charge_set_output_current_limit(). Also add a clarifying note about the intent of CHARGER_SOLO. BRANCH=None BUG=b:147440290 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I7656c19a87d8216f5efc72dcffa6d638064d3e2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376469 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'include/charger.h')
-rw-r--r--include/charger.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/charger.h b/include/charger.h
index 246edec1ab..f097f564a9 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -134,10 +134,17 @@ extern struct charger_config_t chg_chips[];
__override_proto uint8_t board_get_charger_chip_count(void);
#ifdef CONFIG_CHARGER_SINGLE_CHIP
+/*
+ * Note: CHARGER_SOLO should be used anywhere the charger index being called is
+ * only valid for a single-chip system. This will then generate build errors if
+ * the callsite is compliled for a multi-chip system, which needs to re-evaluate
+ * the charger index to act upon.
+ */
enum chg_id {
CHARGER_SOLO,
CHARGER_NUM,
};
+
#endif
/* Get the current charger_params. Failures are reported in .flags */
@@ -193,7 +200,7 @@ enum ec_error_list charger_set_mode(int mode);
* For chargers that are able to supply output power for OTG dongle, this
* function enables or disables power output.
*/
-enum ec_error_list charger_enable_otg_power(int enabled);
+enum ec_error_list charger_enable_otg_power(int chgnum, int enabled);
/**
* Sets OTG current limit and voltage (independent of whether OTG power is
@@ -211,7 +218,8 @@ enum ec_error_list charger_enable_otg_power(int enabled);
*
* @return EC_SUCCESS on success, an error otherwise.
*/
-enum ec_error_list charger_set_otg_current_voltage(int output_current,
+enum ec_error_list charger_set_otg_current_voltage(int chgnum,
+ int output_current,
int output_voltage);
/**