diff options
author | Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> | 2021-01-19 21:57:41 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-22 21:43:20 +0000 |
commit | a18f2c5716b70874fdce305e97d2684f29f19f99 (patch) | |
tree | 88901822c15badbcf116b6e2d51f02c710f56f10 /board/volteer | |
parent | 3ccae3be744d4084712d7259cd77e0727c81786f (diff) | |
download | chrome-ec-a18f2c5716b70874fdce305e97d2684f29f19f99.tar.gz |
volteer: change mutex for Zephyr
Change mutex structure name so it can be used by both ECOS and Zephyr.
BUG=b:173507858
BRANCH=none
TEST=make buildall -j8
build volteer on zephyr
Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com>
Change-Id: I797bb3335cb481e1d471635e5c9f11d48f2d37f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638911
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/volteer')
-rw-r--r-- | board/volteer/sensors.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/board/volteer/sensors.c b/board/volteer/sensors.c index 1bf5df3a06..78c96b9672 100644 --- a/board/volteer/sensors.c +++ b/board/volteer/sensors.c @@ -19,8 +19,8 @@ /******************************************************************************/ /* Sensors */ -static struct mutex g_lid_accel_mutex; -static struct mutex g_base_mutex; +static mutex_t g_lid_accel_mutex; +static mutex_t g_base_mutex; /* BMA253 private data */ static struct accelgyro_saved_data_t g_bma253_data; @@ -213,6 +213,19 @@ const struct motion_sensor_t *motion_als_sensors[] = { }; BUILD_ASSERT(ARRAY_SIZE(motion_als_sensors) == ALS_COUNT); +#ifdef CONFIG_ZEPHYR +static int init_sensor_mutex(const struct device *dev) +{ + ARG_UNUSED(dev); + + k_mutex_init(&g_lid_accel_mutex); + k_mutex_init(&g_base_mutex); + + return 0; +} +SYS_INIT(init_sensor_mutex, POST_KERNEL, 50); +#endif /* CONFIG_ZEPHYR */ + static void baseboard_sensors_init(void) { /* Note - BMA253 interrupt unused by EC */ |