summaryrefslogtreecommitdiff
path: root/driver/charger/isl9241.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-14 11:59:49 -0700
committerCommit Bot <commit-bot@chromium.org>2020-12-17 22:53:31 +0000
commit53af9d188fb7e714623d4ebd4e78e83090c09e74 (patch)
treee32623bdf34488ae14f26991247004f0c6550d46 /driver/charger/isl9241.c
parentb5d83cde1dea30d19d3416f6c0e9ba703cffdbf9 (diff)
downloadchrome-ec-53af9d188fb7e714623d4ebd4e78e83090c09e74.tar.gz
zephyr: Enable isl9241 for Volteer
Add configs and build rules to enable this driver. A few issues are left to clean up later. BUG=b:175248556 BRANCH=none TEST=build for volteer Change-Id: If2c5427d016ae8cddcc25926668011aa11673091 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2589562 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'driver/charger/isl9241.c')
-rw-r--r--driver/charger/isl9241.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/driver/charger/isl9241.c b/driver/charger/isl9241.c
index d0a8127b21..ae2867a139 100644
--- a/driver/charger/isl9241.c
+++ b/driver/charger/isl9241.c
@@ -5,7 +5,10 @@
* Renesas (Intersil) ISL-9241 battery charger driver.
*/
+/* TODO(b/175881324) */
+#ifndef CONFIG_ZEPHYR
#include "adc.h"
+#endif
#include "battery.h"
#include "battery_smart.h"
#include "charger.h"
@@ -42,7 +45,7 @@
static int learn_mode;
/* Mutex for CONTROL1 register, that can be updated from multiple tasks. */
-static struct mutex control1_mutex;
+static mutex_t control1_mutex;
/* Charger parameters */
static const struct charger_info isl9241_charger_info = {
@@ -371,6 +374,9 @@ static void isl9241_init(int chgnum)
{
const struct battery_info *bi = battery_get_info();
+ /* Init the mutex for ZephyrOS (nop for non-Zephyr builds) */
+ (void)k_mutex_init(&control1_mutex);
+
/*
* Set the MaxSystemVoltage to battery maximum,
* 0x00=disables switching charger states