qtouch_obp_ts: Add support for X and Y flip
authorColin Cross <ccross@android.com>
Thu, 25 Mar 2010 05:19:49 +0000 (22:19 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:32:51 +0000 (16:32 -0700)
Change-Id: I463ad7bfc906eedb8f80fededdbd12a24b77ab1a
Signed-off-by: Colin Cross <ccross@android.com>
drivers/input/touchscreen/qtouch_obp_ts.c

index 77a49f7fca128e3c4f04250e62323f84062b16e7..809dec35b1c9617d8a16e0682e799223bcae0ca6 100644 (file)
@@ -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__,