summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-30 17:07:50 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-07 04:13:16 +0000
commit6f626a65226c68ec8ffd3de0445af614adc82afb (patch)
tree0feaa5f2d322f2578f05b7a770970f9921dd5d14 /include/driver
parentf171bb5d3b0749d63e5fa49d0e16faa518fb0347 (diff)
downloadchrome-ec-6f626a65226c68ec8ffd3de0445af614adc82afb.tar.gz
Create a public header for isl9241
Add a separate public header for this chip so we can include it from Zephyr. Update the charger file to use that header, so it builds on Zephyr. BUG=b:175434113 BRANCH=none TEST=make BOARD=volteer -j30 With a zephyr-chrome CL, build volteer on zephyr Change-Id: I562177e2259931730b7dae4d8e43edd5ea96deb7 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2611893 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/driver')
-rw-r--r--include/driver/charger/isl9241_public.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/driver/charger/isl9241_public.h b/include/driver/charger/isl9241_public.h
new file mode 100644
index 0000000000..14eb0db5ec
--- /dev/null
+++ b/include/driver/charger/isl9241_public.h
@@ -0,0 +1,38 @@
+/* Copyright 2021 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ *
+ * Renesas (Intersil) ISL-9241 battery charger public header
+ */
+
+#ifndef __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H
+#define __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H
+
+#define ISL9241_ADDR_FLAGS 0x09
+
+extern const struct charger_drv isl9241_drv;
+
+/**
+ * Set AC prochot threshold
+ *
+ * @param chgnum: Index into charger chips
+ * @param ma: AC prochot threshold current in mA, multiple of 128mA
+ * @return EC_SUCCESS or error
+ */
+int isl9241_set_ac_prochot(int chgnum, int ma);
+
+/**
+ * Set DC prochot threshold
+ *
+ * @param chgnum: Index into charger chips
+ * @param ma: DC prochot threshold current in mA, multiple of 256mA
+ * @return EC_SUCCESS or error
+ */
+int isl9241_set_dc_prochot(int chgnum, int ma);
+
+#define ISL9241_AC_PROCHOT_CURRENT_MIN 128 /* mA */
+#define ISL9241_AC_PROCHOT_CURRENT_MAX 6400 /* mA */
+#define ISL9241_DC_PROCHOT_CURRENT_MIN 256 /* mA */
+#define ISL9241_DC_PROCHOT_CURRENT_MAX 12800 /* mA */
+
+#endif /* __CROS_EC_DRIVER_CHARGER_ISL9241_PUBLIC_H */