summaryrefslogtreecommitdiff
path: root/driver/charger/isl923x.h
diff options
context:
space:
mode:
authorKo <ko_ko@compal.corp-partner.google.com>2019-07-25 11:18:34 +0800
committerCommit Bot <commit-bot@chromium.org>2019-07-26 20:21:27 +0000
commit9ff89625dc098838a60ace547b2db4ebb27dee41 (patch)
tree1e03410dc09c0b78f29d94449b9e26c0ac22e47d /driver/charger/isl923x.h
parent95ff1a1b6af7183160b8de1f480d32430afc1b97 (diff)
downloadchrome-ec-9ff89625dc098838a60ace547b2db4ebb27dee41.tar.gz
isl923x: Check max current in isl923x_set_dc_prochot
The DCProchot register takes a value in multiple of 128 up to 12800 mA. This patch makes isl923x_set_dc_prochot return error when a value exceeding the max is passed. Signed-off-by: Ko Ko <ko_ko@compal.corp-partner.google.com> BUG=b/130387567 BRANCH=Nami TEST=buildall Change-Id: If2155d7fc74c1491bf7c0a742ba8356c268a94a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1716673 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'driver/charger/isl923x.h')
-rw-r--r--driver/charger/isl923x.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/driver/charger/isl923x.h b/driver/charger/isl923x.h
index 89595a60fa..8076b72e38 100644
--- a/driver/charger/isl923x.h
+++ b/driver/charger/isl923x.h
@@ -300,12 +300,17 @@ enum isl9237_fsm_state {
#endif /* __CROS_EC_ISL923X_H */
/**
- * Initialize AC prochot threshold
+ * Initialize AC & DC prochot threshold
*
- * @param Porchot threshold current in mA: multiple of 128 up to 6400 mA
+ * @param AC Porchot threshold current in mA:
+ * multiple of 128 up to 6400 mA
+ * DC Porchot threshold current in mA:
+ * multiple of 128 up to 12800 mA
* Bits below 128mA are truncated (ignored).
* @return enum ec_error_list
*/
int isl923x_set_ac_prochot(uint16_t ma);
+int isl923x_set_dc_prochot(uint16_t ma);
#define ISL923X_AC_PROCHOT_CURRENT_MAX 6400 /* mA */
+#define ISL923X_DC_PROCHOT_CURRENT_MAX 12800 /* mA */