summaryrefslogtreecommitdiff
path: root/include/charger.h
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2017-10-18 10:05:56 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-10-20 06:08:58 -0700
commitccfc005fa414a6faa45a4168e27669b62abe1d5d (patch)
treeeb69eb883b846d0aac0dd0e94c5402fa968961d6 /include/charger.h
parent6336a7c7515867dc50a4a813e99324741630e455 (diff)
downloadchrome-ec-ccfc005fa414a6faa45a4168e27669b62abe1d5d.tar.gz
isl9238: Add support for providing power using OTG
BRANCH=none BUG=b:66575472 TEST=Flash lux and wand, wand can provide power to lux. Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Change-Id: I59091c509b78bacf9f382550ab380a77fbf68ba9 Reviewed-on: https://chromium-review.googlesource.com/725122 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/charger.h')
-rw-r--r--include/charger.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/charger.h b/include/charger.h
index a9f4f41fbd..16f7c3cbd0 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -65,12 +65,28 @@ int charger_get_status(int *status);
int charger_set_mode(int mode);
/**
- * For chargers that are able to supply 5V output power for OTG dongle, this
- * function enables or disables 5V power output.
+ * For chargers that are able to supply output power for OTG dongle, this
+ * function enables or disables power output.
*/
int charger_enable_otg_power(int enabled);
/**
+ * Sets OTG current limit and voltage (independent of whether OTG power is
+ * currently enabled).
+ *
+ * Depending on the charger and use case, one needs to be careful about
+ * changing the current/voltage while OTG power is enabled, and it might be wise
+ * to reset the value before enabling OTG power to ensure one does not provide
+ * excessive voltage to a device.
+ *
+ * @param output_current Requested current limit in mA.
+ * @param output_voltage Requested voltage in mV.
+ *
+ * @return EC_SUCCESS on success, an error otherwise.
+ */
+int charger_set_otg_current_voltage(int output_current, int output_voltage);
+
+/**
* Return the closest match the charger can supply to the requested current.
*
* @param current Requested current in mA.