From: root Date: Sat, 16 Jul 2011 06:07:57 +0000 (+0800) Subject: A22:deal with minimum and maximal value of touchscreen specially X-Git-Tag: firefly_0821_release~10128 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=89fda7661710ce1b053ced0a405710ad4c13d461;p=firefly-linux-kernel-4.4.55.git A22:deal with minimum and maximal value of touchscreen specially --- diff --git a/arch/arm/mach-rk29/board-rk29-a22.c b/arch/arm/mach-rk29/board-rk29-a22.c index 7dbe471677a0..19cb1b82fa1e 100755 --- a/arch/arm/mach-rk29/board-rk29-a22.c +++ b/arch/arm/mach-rk29/board-rk29-a22.c @@ -477,9 +477,9 @@ static struct ili2102_platform_data ili2102_info = { .model = 2102, .swap_xy = 0, .x_min = 0, - .x_max = 481, + .x_max = 480, .y_min = 0, - .y_max = 801, + .y_max = 800, .gpio_reset = ili2102_GPIO_RESET, .gpio_reset_active_low = 1, .gpio_pendown = ili2102_GPIO_INT, diff --git a/drivers/input/touchscreen/ili2102_ts.c b/drivers/input/touchscreen/ili2102_ts.c index 8bcf073ecad9..dbd723b95d3f 100755 --- a/drivers/input/touchscreen/ili2102_ts.c +++ b/drivers/input/touchscreen/ili2102_ts.c @@ -304,6 +304,17 @@ static int verify_coord(struct ili2102_ts_data *ts,unsigned int *x,unsigned int if((*y< ts->y_min) || (*y > ts->y_max)) return -1; + /*android do not support min and max value*/ + if(*x == ts->x_min) + *x = ts->x_min + 1; + if(*y == ts->y_min) + *y = ts->y_min + 1; + if(*x == ts->x_max) + *x = ts->x_max - 1; + if(*y == ts->y_max) + *y = ts->y_max - 1; + + return 0; } static int ili2102_init_panel(struct ili2102_ts_data *ts)