input: mpu3050: Add HTC version of MPU3050 sensor
HTC kernel version: evitaul-jb-crc-3.4.10-ec474a3
Change-Id: I53903035d40fe4eae1b4240068765c3e32a31ddd
diff --git a/include/linux/mpu.h b/include/linux/mpu.h
new file mode 100644
index 0000000..0a2ec64
--- /dev/null
+++ b/include/linux/mpu.h
@@ -0,0 +1,391 @@
+/*
+ $License:
+ Copyright (C) 2010 InvenSense Corporation, All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ $
+ */
+
+#ifndef __MPU_H_
+#define __MPU_H_
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#endif
+
+#ifdef M_HW
+#include "mpu6000.h"
+#else
+#include "mpu3050.h"
+#endif
+
+#define GYRO_NUM_AXES (3)
+#define ACCEL_NUM_AXES (3)
+#define COMPASS_NUM_AXES (3)
+
+#define MPU_SET_MPU_CONFIG (0x00)
+#define MPU_SET_INT_CONFIG (0x01)
+#define MPU_SET_EXT_SYNC (0x02)
+#define MPU_SET_FULL_SCALE (0x03)
+#define MPU_SET_LPF (0x04)
+#define MPU_SET_CLK_SRC (0x05)
+#define MPU_SET_DIVIDER (0x06)
+#define MPU_SET_LEVEL_SHIFTER (0x07)
+#define MPU_SET_DMP_ENABLE (0x08)
+#define MPU_SET_FIFO_ENABLE (0x09)
+#define MPU_SET_DMP_CFG1 (0x0a)
+#define MPU_SET_DMP_CFG2 (0x0b)
+#define MPU_SET_OFFSET_TC (0x0c)
+#define MPU_SET_RAM (0x0d)
+
+#define MPU_SET_PLATFORM_DATA (0x0e)
+
+#define MPU_GET_MPU_CONFIG (0x80)
+#define MPU_GET_INT_CONFIG (0x81)
+#define MPU_GET_EXT_SYNC (0x82)
+#define MPU_GET_FULL_SCALE (0x83)
+#define MPU_GET_LPF (0x84)
+#define MPU_GET_CLK_SRC (0x85)
+#define MPU_GET_DIVIDER (0x86)
+#define MPU_GET_LEVEL_SHIFTER (0x87)
+#define MPU_GET_DMP_ENABLE (0x88)
+#define MPU_GET_FIFO_ENABLE (0x89)
+#define MPU_GET_DMP_CFG1 (0x8a)
+#define MPU_GET_DMP_CFG2 (0x8b)
+#define MPU_GET_OFFSET_TC (0x8c)
+#define MPU_GET_RAM (0x8d)
+
+#define MPU_READ_REGISTER (0x40)
+#define MPU_WRITE_REGISTER (0x41)
+#define MPU_READ_MEMORY (0x42)
+#define MPU_WRITE_MEMORY (0x43)
+
+#define MPU_SUSPEND (0x44)
+#define MPU_RESUME (0x45)
+#define MPU_READ_COMPASS (0x46)
+#define MPU_READ_ACCEL (0x47)
+#define MPU_READ_PRESSURE (0x48)
+
+#define MPU_CONFIG_ACCEL (0x20)
+#define MPU_CONFIG_COMPASS (0x21)
+#define MPU_CONFIG_PRESSURE (0x22)
+
+#define MPU_GET_CONFIG_ACCEL (0x28)
+#define MPU_GET_CONFIG_COMPASS (0x29)
+#define MPU_GET_CONFIG_PRESSURE (0x2a)
+
+#define HTC_READ_CAL_DATA
+#ifdef HTC_READ_CAL_DATA
+#define MPU_READ_CAL_DATA (0xef)
+extern unsigned char gyro_gsensor_kvalue[37];
+#endif
+
+struct mpu_read_write {
+ unsigned short address;
+ unsigned short length;
+ unsigned char *data;
+};
+
+struct mpuirq_data {
+ int interruptcount;
+ unsigned long long irqtime;
+ int data_type;
+ int data_size;
+ void *data;
+};
+enum ext_slave_config_key {
+ MPU_SLAVE_CONFIG_ODR_SUSPEND,
+ MPU_SLAVE_CONFIG_ODR_RESUME,
+ MPU_SLAVE_CONFIG_FSR_SUSPEND,
+ MPU_SLAVE_CONFIG_FSR_RESUME,
+ MPU_SLAVE_CONFIG_MOT_THS,
+ MPU_SLAVE_CONFIG_NMOT_THS,
+ MPU_SLAVE_CONFIG_MOT_DUR,
+ MPU_SLAVE_CONFIG_NMOT_DUR,
+ MPU_SLAVE_CONFIG_IRQ_SUSPEND,
+ MPU_SLAVE_CONFIG_IRQ_RESUME,
+ MPU_SLAVE_WRITE_REGISTERS,
+ MPU_SLAVE_READ_REGISTERS,
+ MPU_SLAVE_CONFIG_NUM_CONFIG_KEYS,
+};
+
+enum ext_slave_config_irq_type {
+ MPU_SLAVE_IRQ_TYPE_NONE,
+ MPU_SLAVE_IRQ_TYPE_MOTION,
+ MPU_SLAVE_IRQ_TYPE_DATA_READY,
+};
+
+struct ext_slave_config {
+ int key;
+ int len;
+ int apply;
+ void *data;
+};
+
+enum ext_slave_type {
+ EXT_SLAVE_TYPE_GYROSCOPE,
+ EXT_SLAVE_TYPE_ACCELEROMETER,
+ EXT_SLAVE_TYPE_COMPASS,
+ EXT_SLAVE_TYPE_PRESSURE,
+
+};
+
+enum ext_slave_id {
+ ID_INVALID = 0,
+
+ ACCEL_ID_LIS331,
+ ACCEL_ID_LSM303,
+ ACCEL_ID_KXSD9,
+ ACCEL_ID_KXTF9,
+ ACCEL_ID_BMA150,
+ ACCEL_ID_BMA222,
+ ACCEL_ID_ADI346,
+ ACCEL_ID_MMA8450,
+ ACCEL_ID_MMA845X,
+ ACCEL_ID_MPU6000,
+ ACCEL_ID_LIS3DH,
+
+ COMPASS_ID_AKM,
+ COMPASS_ID_AKM8963,
+ COMPASS_ID_AMI30X,
+ COMPASS_ID_YAS529,
+ COMPASS_ID_HMC5883,
+ COMPASS_ID_LSM303,
+ COMPASS_ID_MMC314X,
+ COMPASS_ID_HSCDTD002B,
+ COMPASS_ID_HSCDTD004A,
+
+ PRESSURE_ID_BMA085,
+ ACCEL_ID_BMA250,
+};
+
+enum ext_slave_endian {
+ EXT_SLAVE_BIG_ENDIAN,
+ EXT_SLAVE_LITTLE_ENDIAN,
+ EXT_SLAVE_FS8_BIG_ENDIAN,
+ EXT_SLAVE_FS16_BIG_ENDIAN,
+};
+
+enum ext_slave_bus {
+ EXT_SLAVE_BUS_INVALID = -1,
+ EXT_SLAVE_BUS_PRIMARY = 0,
+ EXT_SLAVE_BUS_SECONDARY = 1
+};
+
+
+struct ext_slave_platform_data {
+ struct ext_slave_descr *(*get_slave_descr) (void);
+ int irq;
+ int adapt_num;
+ int bus;
+ unsigned char address;
+ signed char orientation[9];
+ void *irq_data;
+ void *private_data;
+};
+
+
+struct tFixPntRange {
+ long mantissa;
+ long fraction;
+};
+
+struct ext_slave_descr {
+ int (*init) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata);
+ int (*exit) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata);
+ int (*suspend) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata);
+ int (*resume) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata);
+ int (*read) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata,
+ unsigned char *data);
+ int (*config) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata,
+ struct ext_slave_config *config);
+ int (*get_config) (void *mlsl_handle,
+ struct ext_slave_descr *slave,
+ struct ext_slave_platform_data *pdata,
+ struct ext_slave_config *config);
+
+ char *name;
+ unsigned char type;
+ unsigned char id;
+ unsigned char reg;
+ unsigned int len;
+ unsigned char endian;
+ struct tFixPntRange range;
+};
+
+struct mpu3050_platform_data {
+ unsigned char int_config;
+ signed char orientation[MPU_NUM_AXES * MPU_NUM_AXES];
+ unsigned char level_shifter;
+ struct ext_slave_platform_data accel;
+ struct ext_slave_platform_data compass;
+ struct ext_slave_platform_data pressure;
+ int (*g_sensors_reset)(void);
+ int (*power_LPM)(int on);
+};
+
+
+#define get_accel_slave_descr NULL
+
+#ifdef CONFIG_MPU_SENSORS_ADXL346
+struct ext_slave_descr *adxl346_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr adxl346_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_BMA150
+struct ext_slave_descr *bma150_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr bma150_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_BMA250
+struct ext_slave_descr *bma250_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr bma250_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_BMA222
+struct ext_slave_descr *bma222_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr bma222_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_KXSD9
+struct ext_slave_descr *kxsd9_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr kxsd9_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_KXTF9
+struct ext_slave_descr *kxtf9_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr kxtf9_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_LIS331DLH
+struct ext_slave_descr *lis331dlh_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr lis331dlh_get_slave_descr
+#endif
+
+
+#ifdef CONFIG_MPU_SENSORS_LIS3DH
+struct ext_slave_descr *lis3dh_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr lis3dh_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_LSM303DLHA
+struct ext_slave_descr *lsm303dlha_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr lsm303dlha_get_slave_descr
+#endif
+
+#if defined(CONFIG_MPU_SENSORS_MPU6000) || \
+ defined(CONFIG_MPU_SENSORS_MPU6000_MODULE)
+struct ext_slave_descr *mantis_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr mantis_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_MMA8450
+struct ext_slave_descr *mma8450_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr mma8450_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_MMA845X
+struct ext_slave_descr *mma845x_get_slave_descr(void);
+#undef get_accel_slave_descr
+#define get_accel_slave_descr mma845x_get_slave_descr
+#endif
+
+
+#define get_compass_slave_descr NULL
+
+#ifdef CONFIG_MPU_SENSORS_AK8975
+struct ext_slave_descr *ak8975_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr ak8975_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_AK8963
+struct ext_slave_descr *ak8963_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr ak8963_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_AMI30X
+struct ext_slave_descr *ami30x_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr ami30x_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_HMC5883
+struct ext_slave_descr *hmc5883_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr hmc5883_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_MMC314X
+struct ext_slave_descr *mmc314x_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr mmc314x_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_LSM303DLHM
+struct ext_slave_descr *lsm303dlhm_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr lsm303dlhm_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_YAS529
+struct ext_slave_descr *yas529_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr yas529_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_HSCDTD002B
+struct ext_slave_descr *hscdtd002b_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr hscdtd002b_get_slave_descr
+#endif
+
+#ifdef CONFIG_MPU_SENSORS_HSCDTD004A
+struct ext_slave_descr *hscdtd004a_get_slave_descr(void);
+#undef get_compass_slave_descr
+#define get_compass_slave_descr hscdtd004a_get_slave_descr
+#endif
+#define get_pressure_slave_descr NULL
+
+#ifdef CONFIG_MPU_SENSORS_BMA085
+struct ext_slave_descr *bma085_get_slave_descr(void);
+#undef get_pressure_slave_descr
+#define get_pressure_slave_descr bma085_get_slave_descr
+#endif
+
+#endif
diff --git a/include/linux/mpu3050.h b/include/linux/mpu3050.h
new file mode 100644
index 0000000..936d136
--- /dev/null
+++ b/include/linux/mpu3050.h
@@ -0,0 +1,240 @@
+/*
+ $License:
+ Copyright (C) 2010 InvenSense Corporation, All Rights Reserved.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ $
+ */
+
+#ifndef __MPU3050_H_
+#define __MPU3050_H_
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#endif
+
+#ifdef M_HW
+#error MPU6000 build including MPU3050 header
+#endif
+
+#define MPU_NAME "mpu3050"
+#define DEFAULT_MPU_SLAVEADDR 0x68
+
+enum mpu_register {
+ MPUREG_WHO_AM_I = 0,
+ MPUREG_PRODUCT_ID,
+ MPUREG_02_RSVD,
+ MPUREG_03_RSVD,
+ MPUREG_04_RSVD,
+ MPUREG_XG_OFFS_TC,
+ MPUREG_06_RSVD,
+ MPUREG_07_RSVD,
+ MPUREG_YG_OFFS_TC,
+ MPUREG_09_RSVD,
+ MPUREG_0A_RSVD,
+ MPUREG_ZG_OFFS_TC,
+ MPUREG_X_OFFS_USRH,
+ MPUREG_X_OFFS_USRL,
+ MPUREG_Y_OFFS_USRH,
+ MPUREG_Y_OFFS_USRL,
+ MPUREG_Z_OFFS_USRH,
+ MPUREG_Z_OFFS_USRL,
+ MPUREG_FIFO_EN1,
+ MPUREG_FIFO_EN2,
+ MPUREG_AUX_SLV_ADDR,
+ MPUREG_SMPLRT_DIV,
+ MPUREG_DLPF_FS_SYNC,
+ MPUREG_INT_CFG,
+ MPUREG_ACCEL_BURST_ADDR,
+ MPUREG_19_RSVD,
+ MPUREG_INT_STATUS,
+ MPUREG_TEMP_OUT_H,
+ MPUREG_TEMP_OUT_L,
+ MPUREG_GYRO_XOUT_H,
+ MPUREG_GYRO_XOUT_L,
+ MPUREG_GYRO_YOUT_H,
+ MPUREG_GYRO_YOUT_L,
+ MPUREG_GYRO_ZOUT_H,
+ MPUREG_GYRO_ZOUT_L,
+ MPUREG_23_RSVD,
+ MPUREG_24_RSVD,
+ MPUREG_25_RSVD,
+ MPUREG_26_RSVD,
+ MPUREG_27_RSVD,
+ MPUREG_28_RSVD,
+ MPUREG_29_RSVD,
+ MPUREG_2A_RSVD,
+ MPUREG_2B_RSVD,
+ MPUREG_2C_RSVD,
+ MPUREG_2D_RSVD,
+ MPUREG_2E_RSVD,
+ MPUREG_2F_RSVD,
+ MPUREG_30_RSVD,
+ MPUREG_31_RSVD,
+ MPUREG_32_RSVD,
+ MPUREG_33_RSVD,
+ MPUREG_34_RSVD,
+ MPUREG_DMP_CFG_1,
+ MPUREG_DMP_CFG_2,
+ MPUREG_BANK_SEL,
+ MPUREG_MEM_START_ADDR,
+ MPUREG_MEM_R_W,
+ MPUREG_FIFO_COUNTH,
+ MPUREG_FIFO_COUNTL,
+ MPUREG_FIFO_R_W,
+ MPUREG_USER_CTRL,
+ MPUREG_PWR_MGM,
+ MPUREG_3F_RSVD,
+ NUM_OF_MPU_REGISTERS
+};
+
+
+#define BIT_TEMP_OUT 0x80
+#define BIT_GYRO_XOUT 0x40
+#define BIT_GYRO_YOUT 0x20
+#define BIT_GYRO_ZOUT 0x10
+#define BIT_ACCEL_XOUT 0x08
+#define BIT_ACCEL_YOUT 0x04
+#define BIT_ACCEL_ZOUT 0x02
+#define BIT_AUX_1OUT 0x01
+#define BIT_AUX_2OUT 0x02
+#define BIT_AUX_3OUT 0x01
+#define BITS_EXT_SYNC_NONE 0x00
+#define BITS_EXT_SYNC_TEMP 0x20
+#define BITS_EXT_SYNC_GYROX 0x40
+#define BITS_EXT_SYNC_GYROY 0x60
+#define BITS_EXT_SYNC_GYROZ 0x80
+#define BITS_EXT_SYNC_ACCELX 0xA0
+#define BITS_EXT_SYNC_ACCELY 0xC0
+#define BITS_EXT_SYNC_ACCELZ 0xE0
+#define BITS_EXT_SYNC_MASK 0xE0
+#define BITS_FS_250DPS 0x00
+#define BITS_FS_500DPS 0x08
+#define BITS_FS_1000DPS 0x10
+#define BITS_FS_2000DPS 0x18
+#define BITS_FS_MASK 0x18
+#define BITS_DLPF_CFG_256HZ_NOLPF2 0x00
+#define BITS_DLPF_CFG_188HZ 0x01
+#define BITS_DLPF_CFG_98HZ 0x02
+#define BITS_DLPF_CFG_42HZ 0x03
+#define BITS_DLPF_CFG_20HZ 0x04
+#define BITS_DLPF_CFG_10HZ 0x05
+#define BITS_DLPF_CFG_5HZ 0x06
+#define BITS_DLPF_CFG_2100HZ_NOLPF 0x07
+#define BITS_DLPF_CFG_MASK 0x07
+#define BIT_ACTL 0x80
+#define BIT_ACTL_LOW 0x80
+#define BIT_ACTL_HIGH 0x00
+#define BIT_OPEN 0x40
+#define BIT_OPEN_DRAIN 0x40
+#define BIT_PUSH_PULL 0x00
+#define BIT_LATCH_INT_EN 0x20
+#define BIT_LATCH_INT_EN 0x20
+#define BIT_INT_PULSE_WIDTH_50US 0x00
+#define BIT_INT_ANYRD_2CLEAR 0x10
+#define BIT_INT_STAT_READ_2CLEAR 0x00
+#define BIT_MPU_RDY_EN 0x04
+#define BIT_DMP_INT_EN 0x02
+#define BIT_RAW_RDY_EN 0x01
+#define BIT_INT_STATUS_FIFO_OVERLOW 0x80
+#define BIT_MPU_RDY 0x04
+#define BIT_DMP_INT 0x02
+#define BIT_RAW_RDY 0x01
+#define BIT_PRFTCH_EN 0x20
+#define BIT_CFG_USER_BANK 0x10
+#define BITS_MEM_SEL 0x0f
+#define BIT_DMP_EN 0x80
+#define BIT_FIFO_EN 0x40
+#define BIT_AUX_IF_EN 0x20
+#define BIT_AUX_RD_LENG 0x10
+#define BIT_AUX_IF_RST 0x08
+#define BIT_DMP_RST 0x04
+#define BIT_FIFO_RST 0x02
+#define BIT_GYRO_RST 0x01
+#define BIT_H_RESET 0x80
+#define BIT_SLEEP 0x40
+#define BIT_STBY_XG 0x20
+#define BIT_STBY_YG 0x10
+#define BIT_STBY_ZG 0x08
+#define BITS_CLKSEL 0x07
+
+#define MPU_SILICON_REV_A4 1
+#define MPU_SILICON_REV_B1 2
+#define MPU_SILICON_REV_B4 3
+#define MPU_SILICON_REV_B6 4
+
+#define MPU_MEM_BANK_SIZE (256)
+#define FIFO_HW_SIZE (512)
+
+enum MPU_MEMORY_BANKS {
+ MPU_MEM_RAM_BANK_0 = 0,
+ MPU_MEM_RAM_BANK_1,
+ MPU_MEM_RAM_BANK_2,
+ MPU_MEM_RAM_BANK_3,
+ MPU_MEM_NUM_RAM_BANKS,
+ MPU_MEM_OTP_BANK_0 = MPU_MEM_NUM_RAM_BANKS,
+
+ MPU_MEM_NUM_BANKS
+};
+
+#define MPU_NUM_AXES (3)
+
+enum mpu_filter {
+ MPU_FILTER_256HZ_NOLPF2 = 0,
+ MPU_FILTER_188HZ,
+ MPU_FILTER_98HZ,
+ MPU_FILTER_42HZ,
+ MPU_FILTER_20HZ,
+ MPU_FILTER_10HZ,
+ MPU_FILTER_5HZ,
+ MPU_FILTER_2100HZ_NOLPF,
+ NUM_MPU_FILTER
+};
+
+enum mpu_fullscale {
+ MPU_FS_250DPS = 0,
+ MPU_FS_500DPS,
+ MPU_FS_1000DPS,
+ MPU_FS_2000DPS,
+ NUM_MPU_FS
+};
+
+enum mpu_clock_sel {
+ MPU_CLK_SEL_INTERNAL = 0,
+ MPU_CLK_SEL_PLLGYROX,
+ MPU_CLK_SEL_PLLGYROY,
+ MPU_CLK_SEL_PLLGYROZ,
+ MPU_CLK_SEL_PLLEXT32K,
+ MPU_CLK_SEL_PLLEXT19M,
+ MPU_CLK_SEL_RESERVED,
+ MPU_CLK_SEL_STOP,
+ NUM_CLK_SEL
+};
+
+enum mpu_ext_sync {
+ MPU_EXT_SYNC_NONE = 0,
+ MPU_EXT_SYNC_TEMP,
+ MPU_EXT_SYNC_GYROX,
+ MPU_EXT_SYNC_GYROY,
+ MPU_EXT_SYNC_GYROZ,
+ MPU_EXT_SYNC_ACCELX,
+ MPU_EXT_SYNC_ACCELY,
+ MPU_EXT_SYNC_ACCELZ,
+ NUM_MPU_EXT_SYNC
+};
+
+#define DLPF_FS_SYNC_VALUE(ext_sync, full_scale, lpf) \
+ ((ext_sync << 5) | (full_scale << 3) | lpf)
+
+#endif