From 3a0c7c27712c540a42c2854cca273bf0d24f2755 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=99=88=E5=9F=8E?= Date: Wed, 10 Aug 2011 12:34:13 +0800 Subject: [PATCH] gsensor driver: swap x,y. --- arch/arm/mach-rk29/board-rk29sdk.c | 2 +- drivers/input/gsensor/mma8452.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-rk29/board-rk29sdk.c b/arch/arm/mach-rk29/board-rk29sdk.c index 064441f203b5..302d76384b2f 100755 --- a/arch/arm/mach-rk29/board-rk29sdk.c +++ b/arch/arm/mach-rk29/board-rk29sdk.c @@ -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, }; diff --git a/drivers/input/gsensor/mma8452.c b/drivers/input/gsensor/mma8452.c index b842d8a8e9cd..c599446fcac8 100755 --- a/drivers/input/gsensor/mma8452.c +++ b/drivers/input/gsensor/mma8452.c @@ -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); } -- 2.34.1