summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2022-03-09 18:16:08 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-21 17:34:45 +0000
commit4b672f3e938678ec184735fa05958e68de20ed2f (patch)
treee20f32f57daca1cdc534c94276c5c819ab423fd2 /include
parentb8bd278b08f566d1e6347953c42c93f48290511b (diff)
downloadchrome-ec-4b672f3e938678ec184735fa05958e68de20ed2f.tar.gz
chgstv2: Add bypass mode for ISL9241
This patch adds bypass mode support to the charger interface and implement it for ISL9241. The bypass mode routes the input current from AC directly to the system power rail for efficiency. Enabling or disabling is done by the charger task. BUG=b:214057333, b:216206104 BRANCH=None TEST=On Agah. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I951393b0e0026de795ce930e8fdeb9018d57b84e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3519879 Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/charger.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/charger.h b/include/charger.h
index bc2b66eac2..66130ce3a5 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -136,6 +136,14 @@ struct charger_drv {
/* Enable/disable linear charging */
enum ec_error_list (*enable_linear_charge)(int chgnum, bool enable);
+ /*
+ * Enable/disable bypass mode
+ *
+ * Callers are responsible for checking required conditions beforehand.
+ * (e.g supplier == CHARGE_SUPPLIER_DEDICATED, 20 V < input_voltage)
+ */
+ enum ec_error_list (*enable_bypass_mode)(int chgnum, bool enable);
+
/* Dumps charger registers */
void (*dump_registers)(int chgnum);
};
@@ -364,6 +372,18 @@ enum ec_error_list charger_is_icl_reached(int chgnum, bool *reached);
*/
enum ec_error_list charger_enable_linear_charge(int chgnum, bool enable);
+/**
+ * Enable/disable bypass mode
+ *
+ * Bypass mode allows AC power to be supplied directly to the system rail
+ * instead of going through the charger.
+ *
+ * @param chgnum: Active charge port
+ * @param enable: Whether to enable or disable bypass mode.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+enum ec_error_list charger_enable_bypass_mode(int chgnum, int enable);
+
/*
* Print all charger info for debugging purposes
* @param chgnum: charger IC index.