gsensor driver: swap x,y.
author陈城 <cc@rock-chips.com>
Wed, 10 Aug 2011 04:34:13 +0000 (12:34 +0800)
committer陈城 <cc@rock-chips.com>
Wed, 10 Aug 2011 04:35:24 +0000 (12:35 +0800)
arch/arm/mach-rk29/board-rk29sdk.c
drivers/input/gsensor/mma8452.c

index 064441f203b5d02617f223d077fe1c06143bb7da..302d76384b2f53b65900f0e52157eb97b73bf645 100755 (executable)
@@ -497,7 +497,7 @@ static int mma8452_init_platform_hw(void)
 
 static struct mma8452_platform_data mma8452_info = {
   .model= 8452,
-  .swap_xy = 0,
+  .swap_xy = 1,
   .init_platform_hw= mma8452_init_platform_hw,
 
 };
index b842d8a8e9cd24a7390e482c9172feef46d3804b..c599446fcac8b4eabc22499568af9f58377fc61c 100755 (executable)
@@ -387,10 +387,10 @@ static int mma8452_get_data(struct i2c_client *client)
                axis.y = y;     
                axis.z = z;
        }
-       
+
        if(pdata->swap_xy)
        {
-               axis.y = -axis.y;
+               axis.x = -axis.x;
                swap(axis.x,axis.y);            
        }