diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2017-02-10 10:36:15 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-02-13 21:15:16 -0800 |
commit | d910997f6a87cd63e196c501922f1c323a274592 (patch) | |
tree | 890cec529b7b295e51d52894e3e19a971e215ecf /driver/accel_lis2dh.h | |
parent | 1a736ed9542eb4c94ab0a49dba7696cda7faf864 (diff) | |
download | chrome-ec-d910997f6a87cd63e196c501922f1c323a274592.tar.gz |
lis2dh: code cleanup
Make FIFO a stack variable to save static memory,
Remove auto_inc argument, always set
Remove constant for rate 0.
Force board to declare sensor private data.
Avoid name collision in stm_mems_common
Include stm_mems_common.h in accel_lis2dh.h, caller only need to
include accel_lis2dh.h.
BUG=none
BRANCH=none
TEST=Compile with discovery_stmems board.
Change-Id: Id52b54dd4ec3cf217247c5511ad5a506067ad293
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/441144
Tested-by: mario tesi <mario.tesi@st.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: mario tesi <mario.tesi@st.com>
Diffstat (limited to 'driver/accel_lis2dh.h')
-rw-r--r-- | driver/accel_lis2dh.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/driver/accel_lis2dh.h b/driver/accel_lis2dh.h index eac16d5e20..9872ccabe4 100644 --- a/driver/accel_lis2dh.h +++ b/driver/accel_lis2dh.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2016 The Chromium OS Authors. All rights reserved. +/* Copyright 2016 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. */ @@ -8,6 +8,8 @@ #ifndef __CROS_EC_ACCEL_LIS2DH_H #define __CROS_EC_ACCEL_LIS2DH_H +#include "driver/stm_mems_common.h" + #define LIS2DH_I2C_ADDR(__x) (__x << 1) /* 7-bit address is 000110Xb. Where 'X' is determined @@ -88,7 +90,8 @@ enum lis2dh_fifo_modes { /* Acc data rate */ enum lis2dh_odr { - LIS2DH_ODR_1HZ_VAL = 0x01, + LIS2DH_ODR_0HZ_VAL = 0, + LIS2DH_ODR_1HZ_VAL, LIS2DH_ODR_10HZ_VAL, LIS2DH_ODR_25HZ_VAL, LIS2DH_ODR_50HZ_VAL, @@ -158,4 +161,6 @@ enum lis2dh_fs { extern const struct accelgyro_drv lis2dh_drv; +void lis2dh_interrupt(enum gpio_signal signal); + #endif /* __CROS_EC_ACCEL_LIS2DH_H */ |