From 3e6d5cc590fda1882ab76f9f9c324c6bb49dd461 Mon Sep 17 00:00:00 2001 From: swj Date: Mon, 13 Sep 2010 18:52:04 -0700 Subject: [PATCH] modified touchscreen driver for it50 --- arch/arm/mach-rk2818/board-infoit50.c | 2 +- drivers/input/touchscreen/xpt2046_ts.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-rk2818/board-infoit50.c b/arch/arm/mach-rk2818/board-infoit50.c index 6956c5345393..efa7452b691c 100644 --- a/arch/arm/mach-rk2818/board-infoit50.c +++ b/arch/arm/mach-rk2818/board-infoit50.c @@ -914,7 +914,7 @@ struct rk2818_spi_platform_data rk2818_spi_platdata = { static struct xpt2046_platform_data xpt2046_info = { .model = 2046, .keep_vref_on = 1, - .swap_xy = 0, + .swap_xy = 1, .x_min = 0, .x_max = 800, .y_min = 0, diff --git a/drivers/input/touchscreen/xpt2046_ts.c b/drivers/input/touchscreen/xpt2046_ts.c index d2a6d64c2684..3b2d2b84fc30 100755 --- a/drivers/input/touchscreen/xpt2046_ts.c +++ b/drivers/input/touchscreen/xpt2046_ts.c @@ -56,12 +56,21 @@ #define LCD_MAX_WIDTH 480 #ifdef CONFIG_MACH_RK2818INFO_IT50 +#define PT2046_TOUCH_AD_LEFT 207 +#define PT2046_TOUCH_AD_RIGHT 3940 +#define PT2046_TOUCH_AD_TOP 3624 +#define PT2046_TOUCH_AD_BOTTOM 153 + +#define AD_TO_X(adx) (LCD_MAX_WIDTH * ( PT2046_TOUCH_AD_TOP - adx) / ( PT2046_TOUCH_AD_TOP - PT2046_TOUCH_AD_BOTTOM)) +#define AD_TO_Y(ady) (LCD_MAX_LENGTH * ( ady - PT2046_TOUCH_AD_LEFT ) / (PT2046_TOUCH_AD_RIGHT - PT2046_TOUCH_AD_LEFT)) +/* #define PT2046_TOUCH_AD_LEFT 4000 #define PT2046_TOUCH_AD_RIGHT 110 #define PT2046_TOUCH_AD_TOP 110 #define PT2046_TOUCH_AD_BOTTOM 3800 #define AD_TO_Y(adx) (LCD_MAX_WIDTH * ( PT2046_TOUCH_AD_BOTTOM - adx) / ( PT2046_TOUCH_AD_BOTTOM - PT2046_TOUCH_AD_TOP )) #define AD_TO_X(ady) (LCD_MAX_LENGTH * (PT2046_TOUCH_AD_LEFT - ady) / (PT2046_TOUCH_AD_LEFT - PT2046_TOUCH_AD_RIGHT)) +*/ #else #define PT2046_TOUCH_AD_LEFT 3855 #define PT2046_TOUCH_AD_RIGHT 260 -- 2.34.1