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>
This commit is contained in:
Nicolas Boichat
2017-10-18 10:05:56 +08:00
committed by chrome-bot
parent 6336a7c751
commit ccfc005fa4
3 changed files with 69 additions and 4 deletions

View File

@@ -65,11 +65,27 @@ 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.
*