adjust gsensor orientation in board
authoryxj <yxj@rock-chips.com>
Sat, 19 Nov 2011 10:39:04 +0000 (18:39 +0800)
committeryxj <yxj@rock-chips.com>
Sat, 19 Nov 2011 10:39:04 +0000 (18:39 +0800)
arch/arm/mach-rk29/board-rk29-k97.c
drivers/input/gsensor/mma8452.c

index 6356dd76144deee279b0b93baa5a2470a50b4ec4..c99bfebec354bac7020b79232737cd386c14f136 100755 (executable)
@@ -948,7 +948,6 @@ struct kxtf9_platform_data kxtf9_pdata = {
 /*MMA8452 gsensor*/
 #if defined (CONFIG_GS_MMA8452)
 #define MMA8452_INT_PIN   RK29_PIN0_PA3
-
 static int mma8452_init_platform_hw(void)
 {
 
@@ -964,7 +963,8 @@ static int mma8452_init_platform_hw(void)
 
 static struct mma8452_platform_data mma8452_info = {
   .model= 8452,
-  .swap_xy = 1,
+  .swap_xyz= 1,
+  .orientation ={-1,0,0,0,1,0,0,0,-1},
   .init_platform_hw= mma8452_init_platform_hw,
 
 };
index 7787869ef5f2fcc22d64fedf3a522c558490ed05..1b2247062026df98d7353f31cf6e51f80bf5324d 100755 (executable)
@@ -345,15 +345,9 @@ static void mma8452_report_value(struct i2c_client *client, struct mma8452_axis
     //struct mma8452_axis *axis = (struct mma8452_axis *)rbuf;
 
        /* Report acceleration sensor information */
-       #ifdef CONFIG_MACH_RK29_K97
-       input_report_abs(mma8452->input_dev, ABS_X, axis->y);
-    input_report_abs(mma8452->input_dev, ABS_Y, axis->x);
-    input_report_abs(mma8452->input_dev, ABS_Z, -axis->z);
-       #else
     input_report_abs(mma8452->input_dev, ABS_X, axis->x);
     input_report_abs(mma8452->input_dev, ABS_Y, axis->y);
     input_report_abs(mma8452->input_dev, ABS_Z, axis->z);
-       #endif
     input_sync(mma8452->input_dev);
     mmaprintkd("Gsensor x==%d  y==%d z==%d\n",axis->x,axis->y,axis->z);
 }