From c6457dcf9a6932a391447b4649c3afc04f7bb249 Mon Sep 17 00:00:00 2001 From: wuhao Date: Wed, 7 Nov 2012 17:05:33 +0800 Subject: [PATCH] revert v86 sitronix_ts of commit cb6f8a8f312c9ee1420a1b1afeb4b550b958f1ac and Re touchscreen control for v86 --- arch/arm/mach-rk2928/board-rk2926-sdk.c | 12 ++++++++++- arch/arm/mach-rk2928/include/mach/board.h | 1 + drivers/input/touchscreen/sitronix_ts_a720.c | 21 ++++++++++++++------ 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-rk2928/board-rk2926-sdk.c b/arch/arm/mach-rk2928/board-rk2926-sdk.c index 1ee12f2d20d8..04b777ffb3c8 100755 --- a/arch/arm/mach-rk2928/board-rk2926-sdk.c +++ b/arch/arm/mach-rk2928/board-rk2926-sdk.c @@ -470,10 +470,20 @@ int ft5306_init_platform_hw(void) return 0; } - +#if defined(V86_VERSION_1_1) +int sitronix_direction_otation( int *x,int *y ) +{ + *x = *x ; + *y = 480 - *y ; + return 1 ; +} +#endif struct ft5x0x_platform_data sitronix_info = { .model = 5007, .init_platform_hw= ft5306_init_platform_hw, + #if defined(V86_VERSION_1_1) + .direction_otation = sitronix_direction_otation , + #endif }; #endif diff --git a/arch/arm/mach-rk2928/include/mach/board.h b/arch/arm/mach-rk2928/include/mach/board.h index 6ab45c5ddb0e..303eeb0f0b9e 100755 --- a/arch/arm/mach-rk2928/include/mach/board.h +++ b/arch/arm/mach-rk2928/include/mach/board.h @@ -73,6 +73,7 @@ struct ft5x0x_platform_data{ int (*ft5x0x_platform_sleep)(void); int (*ft5x0x_platform_wakeup)(void); void (*exit_platform_hw)(void); + int (*direction_otation)(int *x ,int *y ); }; #endif diff --git a/drivers/input/touchscreen/sitronix_ts_a720.c b/drivers/input/touchscreen/sitronix_ts_a720.c index a11912f4e25c..5ed48608d74d 100755 --- a/drivers/input/touchscreen/sitronix_ts_a720.c +++ b/drivers/input/touchscreen/sitronix_ts_a720.c @@ -754,6 +754,8 @@ static void sitronix_ts_work_func(struct work_struct *work) uint8_t PixelCount = 0; static uint8_t all_clear = 1; + struct ft5x0x_platform_data *pdata=ts->client->dev.platform_data; + DbgMsg("%s\n", __FUNCTION__); if(ts->suspend_state){ goto exit_invalid_data; @@ -824,12 +826,19 @@ static void sitronix_ts_work_func(struct work_struct *work) input_mt_slot(ts->input_dev, i); input_report_abs(ts->input_dev, ABS_MT_TRACKING_ID, i); input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, 200); - input_report_abs(ts->input_dev, ABS_MT_POSITION_X, MTDStructure[i].Pixel_X); - #if defined(CONFIG_MACH_RK2926_V86_VERSION_1_1) - input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, 480 - MTDStructure[i].Pixel_Y); - #else - input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, MTDStructure[i].Pixel_Y); - #endif + + if(pdata->direction_otation) + { + int temp_x , temp_y ; + temp_x = MTDStructure[i].Pixel_X ; + temp_y = MTDStructure[i].Pixel_Y ; + pdata->direction_otation(&temp_x,&temp_y); + input_report_abs(ts->input_dev, ABS_MT_POSITION_X, temp_x); + input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, temp_y); + }else{ + input_report_abs(ts->input_dev, ABS_MT_POSITION_X, MTDStructure[i].Pixel_X); + input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, MTDStructure[i].Pixel_Y); + } input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, 100); DbgMsg("lr[%d](%d, %d)+\n", i, MTDStructure[i].Pixel_X, MTDStructure[i].Pixel_Y); }else if(MTDStructure[i].Current_Pressed_area == AREA_NONE){ -- 2.34.1