summaryrefslogtreecommitdiff
path: root/board/fennel/board.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/fennel/board.c')
-rw-r--r--board/fennel/board.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/board/fennel/board.c b/board/fennel/board.c
index 1c4470bfe4..335a1bb486 100644
--- a/board/fennel/board.c
+++ b/board/fennel/board.c
@@ -14,7 +14,7 @@
#include "chipset.h"
#include "common.h"
#include "console.h"
-#include "driver/accel_kionix.h"
+#include "driver/accel_lis2dw12.h"
#include "driver/accelgyro_bmi160.h"
#include "driver/battery/max17055.h"
#include "driver/bc12/pi3usb9201.h"
@@ -315,35 +315,43 @@ static struct mutex g_base_mutex;
/* Rotation matrixes */
static const mat33_fp_t base_standard_ref = {
- {FLOAT_TO_FP(1), 0, 0},
{0, FLOAT_TO_FP(1), 0},
+ {FLOAT_TO_FP(-1), 0, 0},
{0, 0, FLOAT_TO_FP(1)}
};
+static const mat33_fp_t lid_standard_ref = {
+ {FLOAT_TO_FP(-1), 0, 0},
+ {0, FLOAT_TO_FP(1), 0},
+ {0, 0, FLOAT_TO_FP(-1) }
+};
+
/* sensor private data */
-static struct kionix_accel_data g_kx022_data;
+static struct stprivate_data g_lis2dwl_data;
static struct bmi160_drv_data_t g_bmi160_data;
struct motion_sensor_t motion_sensors[] = {
[LID_ACCEL] = {
.name = "Lid Accel",
.active_mask = SENSOR_ACTIVE_S0_S3,
- .chip = MOTIONSENSE_CHIP_KX022,
+ .chip = MOTIONSENSE_CHIP_LIS2DWL,
.type = MOTIONSENSE_TYPE_ACCEL,
.location = MOTIONSENSE_LOC_LID,
- .drv = &kionix_accel_drv,
+ .drv = &lis2dw12_drv,
.mutex = &g_lid_mutex,
- .drv_data = &g_kx022_data,
+ .drv_data = &g_lis2dwl_data,
.port = I2C_PORT_SENSORS,
- .i2c_spi_addr_flags = KX022_ADDR1_FLAGS,
- .rot_standard_ref = NULL, /* Identity matrix. */
- .default_range = 2, /* g, to meet CDD 7.3.1/C-1-4 reqs */
+ .i2c_spi_addr_flags = LIS2DWL_ADDR1_FLAGS,
+ .rot_standard_ref = &lid_standard_ref,
+ .default_range = 2, /* g */
+ .min_frequency = LIS2DW12_ODR_MIN_VAL,
+ .max_frequency = LIS2DW12_ODR_MAX_VAL,
.config = {
/* EC use accel for angle detection */
[SENSOR_CONFIG_EC_S0] = {
- .odr = 10000 | ROUND_UP_FLAG,
+ .odr = 12500 | ROUND_UP_FLAG,
},
- /* Sensor on for lid angle detection */
+ /* Sensor on for lid angle detection */
[SENSOR_CONFIG_EC_S3] = {
.odr = 10000 | ROUND_UP_FLAG,
},