From 93011209c447d0a373f75e71184cda7752ee188d Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 24 Mar 2010 22:19:49 -0700 Subject: [PATCH] qtouch_obp_ts: Add support for X and Y flip Change-Id: I463ad7bfc906eedb8f80fededdbd12a24b77ab1a Signed-off-by: Colin Cross --- drivers/input/touchscreen/qtouch_obp_ts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/qtouch_obp_ts.c b/drivers/input/touchscreen/qtouch_obp_ts.c index 77a49f7fca12..809dec35b1c9 100644 --- a/drivers/input/touchscreen/qtouch_obp_ts.c +++ b/drivers/input/touchscreen/qtouch_obp_ts.c @@ -566,7 +566,6 @@ static int do_touch_multi_msg(struct qtouch_ts_data *ts, struct qtm_object *obj, finger = msg->report_id - obj->report_id_min; if (finger >= ts->pdata->multi_touch_cfg.num_touch) return 0; - /* x/y are 10bit values, with bottom 2 bits inside the xypos_lsb */ x = (msg->xpos_msb << 2) | ((msg->xypos_lsb >> 6) & 0x3); y = (msg->ypos_msb << 2) | ((msg->xypos_lsb >> 2) & 0x3); @@ -575,6 +574,10 @@ static int do_touch_multi_msg(struct qtouch_ts_data *ts, struct qtm_object *obj, if (ts->pdata->flags & QTOUCH_SWAP_XY) swap(x, y); + if (ts->pdata->flags & QTOUCH_FLIP_X) + x = ts->pdata->abs_max_x - x; + if (ts->pdata->flags & QTOUCH_FLIP_Y) + y = ts->pdata->abs_max_y - y; if (qtouch_tsdebug & 2) pr_info("%s: stat=%02x, f=%d x=%d y=%d p=%d w=%d\n", __func__, -- 2.34.1