summaryrefslogtreecommitdiff
path: root/include/charger.h
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-12-03 01:02:06 -0800
committerCommit Bot <commit-bot@chromium.org>2020-12-10 00:47:27 +0000
commit87c58967cf0fd5f4c7af1f434ba0c112afb71d3c (patch)
treeb0c8b64c61813becfbb249594b296930f920b551 /include/charger.h
parentf871ed9e0d782a1f44a303aa22b55a82874fbeac (diff)
downloadchrome-ec-87c58967cf0fd5f4c7af1f434ba0c112afb71d3c.tar.gz
charger: Add driver method for linear charging
This commit adds a driver method for enabling linear charging. Some charger ICs have the ability to manipulate the BFET in the linear region. This commit just adds that method and an API for use by the rest of the system. BUG=b:174683659 BRANCH=dedede TEST=`make -j buildall` Change-Id: I1660c0598a402b1f3f82300052b7cd72b8154a31 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2570937 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'include/charger.h')
-rw-r--r--include/charger.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/charger.h b/include/charger.h
index bf4db4fed4..d8d62c1e9b 100644
--- a/include/charger.h
+++ b/include/charger.h
@@ -126,6 +126,9 @@ struct charger_drv {
/* Is the input current limit reached? */
enum ec_error_list (*is_icl_reached)(int chgnum, bool *reached);
+
+ /* Enable/disable linear charging */
+ enum ec_error_list (*enable_linear_charge)(int chgnum, bool enable);
};
struct charger_config_t {
@@ -336,6 +339,18 @@ enum ec_error_list charger_set_vsys_compensation(int chgnum,
*/
enum ec_error_list charger_is_icl_reached(int chgnum, bool *reached);
+/**
+ * Enable/disable linear charging
+ *
+ * For charger ICs that support it, this allows the charger IC to operate the
+ * BFET in the linear region.
+ *
+ * @param chgnum: Active charge port
+ * @param enable: Whether to enable or disable linear charging.
+ * @return EC_SUCCESS on success, error otherwise.
+ */
+enum ec_error_list charger_enable_linear_charge(int chgnum, bool enable);
+
/*
* Print all charger info for debugging purposes
* @param chgnum: charger IC index.