summaryrefslogtreecommitdiff
path: root/include/driver
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-22 09:56:42 +1300
committerCommit Bot <commit-bot@chromium.org>2021-03-23 01:06:27 +0000
commit1b99ed4133a6ee618345353fe08a695a8806b382 (patch)
treebc36160c2f48b13a3b99d77af3b5d0f80db136b3 /include/driver
parentba60995d16d9098e477044682759f19f6051700c (diff)
downloadchrome-ec-1b99ed4133a6ee618345353fe08a695a8806b382.tar.gz
Create a public header for isl923x
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:183296099 BRANCH=none TEST=make BOARD=lazor -j4 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I54506ef17ecda2683f1c1a933f1978df458e08ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774916 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/isl923x_public.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/driver/charger/isl923x_public.h b/include/driver/charger/isl923x_public.h
new file mode 100644
index 0000000000..df3b0ce057
--- /dev/null
+++ b/include/driver/charger/isl923x_public.h
@@ -0,0 +1,51 @@
+/* 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-9237/38 battery charger public header
+ */
+
+#ifndef __CROS_EC_DRIVER_CHARGER_ISL923X_PUBLIC_H
+#define __CROS_EC_DRIVER_CHARGER_ISL923X_PUBLIC_H
+
+#include "stdbool.h"
+
+#define ISL923X_ADDR_FLAGS (0x09)
+
+extern const struct charger_drv isl923x_drv;
+
+/**
+ * Initialize AC & DC prochot threshold
+ *
+ * @param chgnum: Index into charger chips
+ * @param AC Prochot threshold current in mA:
+ * multiple of 128 up to 6400 mA
+ * DC Prochot 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(int chgnum, uint16_t ma);
+int isl923x_set_dc_prochot(int chgnum, uint16_t ma);
+
+/**
+ * Set the general comparator output polarity when asserted.
+ *
+ * @param chgnum: Index into charger chips
+ * @param invert: Non-zero to invert polarity, zero to non-invert.
+ * @return EC_SUCCESS, error otherwise.
+ */
+int isl923x_set_comparator_inversion(int chgnum, int invert);
+
+/**
+ * Prepare the charger IC for battery ship mode. Battery ship mode sets the
+ * lowest power state for the IC. Battery ship mode can only be entered from
+ * battery only mode.
+ *
+ * @param chgnum index into chg_chips table.
+ */
+void raa489000_hibernate(int chgnum, bool disable_adc);
+enum ec_error_list isl9238c_hibernate(int chgnum);
+enum ec_error_list isl9238c_resume(int chgnum);
+
+#endif /* __CROS_EC_DRIVER_CHARGER_ISL923X_PUBLIC_H */