CONFIG_INPUT_MISC=y
CONFIG_INPUT_KEYCHORD=y
CONFIG_INPUT_UINPUT=y
-CONFIG_MAG_SENSORS=y
CONFIG_COMPASS_AK8975=y
-CONFIG_G_SENSOR_DEVICE=y
CONFIG_GS_LIS3DH=y
-CONFIG_GYRO_SENSOR_DEVICE=y
CONFIG_GYRO_L3G4200D=y
-CONFIG_LIGHT_SENSOR_DEVICE=y
CONFIG_LS_CM3217=y
+CONFIG_SENSOR_DEVICE=y
+CONFIG_GSENSOR_DEVICE=y
+CONFIG_COMPASS_DEVICE=y
+CONFIG_GYROSCOPE_DEVICE=y
+CONFIG_LIGHT_DEVICE=y
# CONFIG_SERIO is not set
# CONFIG_CONSOLE_TRANSLATIONS is not set
# CONFIG_LEGACY_PTYS is not set
return 0;
}
-static struct gsensor_platform_data lis3dh_info = {
- .model = 8452,
- .swap_xy = 0,
- .swap_xyz = 1,
+static struct sensor_platform_data lis3dh_info = {
+ .type = SENSOR_TYPE_ACCEL,
+ .irq_enable = 1,
+ .poll_delay_ms = 30,
.init_platform_hw = lis3dh_init_platform_hw,
- .orientation = {0, 0, 1, 0, 1, 0, 1, 0, 0},
+ .orientation = {0, 1, 0, 0, 0, 1, -1, 0, 0},
};
#endif
#if defined (CONFIG_COMPASS_AK8975)
#endif
#if defined (CONFIG_GS_LIS3DH)
{
- .type = "lis3dh",
+ .type = "gs_lis3dh",
.addr = 0x19, //0x19(SA0-->VCC), 0x18(SA0-->GND)
.flags = 0,
.irq = LIS3DH_INT_PIN,
#define LIS3DH_RANGE 2000000\r
\r
/* LIS3DH */\r
-#define LIS3DH_PRECISION 12\r
+#define LIS3DH_PRECISION 16\r
#define LIS3DH_BOUNDARY (0x1 << (LIS3DH_PRECISION - 1))\r
#define LIS3DH_GRAVITY_STEP (LIS3DH_RANGE / LIS3DH_BOUNDARY)\r
\r
+#define ODR1 0x10 /* 1Hz output data rate */\r
+#define ODR10 0x20 /* 10Hz output data rate */\r
+#define ODR25 0x30 /* 25Hz output data rate */\r
+#define ODR50 0x40 /* 50Hz output data rate */\r
+#define ODR100 0x50 /* 100Hz output data rate */\r
+#define ODR200 0x60 /* 200Hz output data rate */\r
+#define ODR400 0x70 /* 400Hz output data rate */\r
+#define ODR1250 0x90 /* 1250Hz output data rate */\r
+\r
+\r
\r
struct sensor_reg_data {\r
char reg;\r
int status = 0;\r
\r
sensor->ops->ctrl_data = sensor_read_reg(client, sensor->ops->ctrl_reg);\r
+\r
+ sensor->ops->ctrl_data |= ODR100; //100HZ,if 0 then power down\r
\r
//register setting according to chip datasheet \r
if(!enable)\r