From: Colin Cross Date: Thu, 25 Mar 2010 05:19:49 +0000 (-0700) Subject: qtouch_obp_ts: Add support for X and Y flip X-Git-Tag: firefly_0821_release~9834^2~925 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=93011209c447d0a373f75e71184cda7752ee188d;p=firefly-linux-kernel-4.4.55.git qtouch_obp_ts: Add support for X and Y flip Change-Id: I463ad7bfc906eedb8f80fededdbd12a24b77ab1a Signed-off-by: Colin Cross --- 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__,