From a0346556698e62405a04b010c4f4197bdc9fec06 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Wed, 24 Apr 2013 20:40:37 +0300 Subject: [PATCH] Fix touchscreen and compass orientation for Exynos 4210-based tablets Samsung's I9100 Jellybean source release introduced some strange orientation issues for the Tab 7 Plus and Tab 7.7 tablets. This reverts the touchscreen and compass behavior to that of the ICS kernels. Thanks to @daniel_hk on XDA for finding this. Change-Id: I99dfa2869c24f73cc3d7008f346af2b549221b68 --- arch/arm/mach-exynos/mach-px.c | 12 ++++++------ drivers/input/touchscreen/mms152.c | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-exynos/mach-px.c b/arch/arm/mach-exynos/mach-px.c index a655490e7e61..e9481956e12b 100644 --- a/arch/arm/mach-exynos/mach-px.c +++ b/arch/arm/mach-exynos/mach-px.c @@ -3055,8 +3055,8 @@ static struct mpu3050_platform_data mpu3050_pdata = { 1, 0, 0, 0, 0, 1}, #elif defined(CONFIG_MACH_P2) - .orientation = {1, 0, 0, - 0, -1, 0, + .orientation = {0, 1, 0, + 1, 0, 0, 0, 0, -1}, #elif defined(CONFIG_MACH_P4) .orientation = {1 , 0, 0, @@ -3087,8 +3087,8 @@ static struct mpu3050_platform_data mpu3050_pdata = { -1, 0, 0, 0, 0, 1}, #elif defined(CONFIG_MACH_P2) - .orientation = {1, 0, 0, - 0, -1, 0, + .orientation = {0, 1, 0, + 1, 0, 0, 0, 0, -1}, #elif defined(CONFIG_MACH_P4) .orientation = {0, -1, 0, @@ -3111,8 +3111,8 @@ static struct mpu3050_platform_data mpu3050_pdata = { * 90 degrees clockwise from natural orientation. * So X & Y are swapped and Y & Z are negated. */ - .orientation = {1, 0, 0, - 0, 1, 0, + .orientation = {0, -1, 0, + 1, 0, 0, 0, 0, 1}, }, diff --git a/drivers/input/touchscreen/mms152.c b/drivers/input/touchscreen/mms152.c index 1b1f14f98df1..27e226e01eae 100644 --- a/drivers/input/touchscreen/mms152.c +++ b/drivers/input/touchscreen/mms152.c @@ -75,8 +75,8 @@ #define MELFAS_MAX_TOUCH 10 -#define TS_MAX_X_COORD 600 -#define TS_MAX_Y_COORD 1024 +#define TS_MAX_X_COORD 1024 +#define TS_MAX_Y_COORD 600 #define TS_MAX_Z_TOUCH 255 #define TS_MAX_W_TOUCH 30 @@ -1004,9 +1004,8 @@ static void melfas_ts_read_input(struct melfas_ts_data *ts) for (i = 0; i < read_num; i = i+6) { id = (buf[i] & 0x0F)-1; - posX = TS_MAX_X_COORD - - ((u16)(buf[i+1] & 0xF0) << 4 | buf[i+3]); - posY = (u16)(buf[i+1] & 0x0F) << 8 | buf[i+2]; + posX = (u16)(buf[i+1] & 0x0F) << 8 | buf[i+2]; + posY = (u16)(buf[i+1] & 0xF0) << 4 | buf[i+3]; str = buf[i + 4]; width = buf[i+5];