From patchwork Wed Jan 27 18:25:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 8137031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 415B39F38B for ; Wed, 27 Jan 2016 18:29:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 867D52020F for ; Wed, 27 Jan 2016 18:29:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D82FE2011D for ; Wed, 27 Jan 2016 18:29:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOUov-00053b-Ey; Wed, 27 Jan 2016 18:27:57 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOUn9-0003a7-7n for linux-arm-kernel@lists.infradead.org; Wed, 27 Jan 2016 18:26:08 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C0A2F3719AD; Wed, 27 Jan 2016 18:25:48 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-5-57.ams2.redhat.com [10.36.5.57]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0RIPR2u007021; Wed, 27 Jan 2016 13:25:45 -0500 From: Hans de Goede To: Dmitry Torokhov , Rob Herring Subject: [PATCH resend 4/4] touchscreen: pixcir_ts: Add support for axis inversion / swapping Date: Wed, 27 Jan 2016 19:25:24 +0100 Message-Id: <1453919124-3840-5-git-send-email-hdegoede@redhat.com> In-Reply-To: <1453919124-3840-1-git-send-email-hdegoede@redhat.com> References: <1453919124-3840-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160127_102607_448012_FAC390C1 X-CRM114-Status: GOOD ( 12.95 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree , Hans de Goede , Chen-Yu Tsai , linux-input@vger.kernel.org, Maxime Ripard , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add support for axis inversion / swapping using the new touchscreen_parse_properties and touchscreen_apply_prop_to_x_y functionality. Signed-off-by: Hans de Goede --- Changes in v2: -Add a fix which actually makes this patch compile, which accidentally ended up in a later commit in my tree --- drivers/input/touchscreen/pixcir_i2c_ts.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index f58784d..0321be3 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -41,13 +41,14 @@ struct pixcir_i2c_ts_data { struct gpio_desc *gpio_enable; struct gpio_desc *gpio_wake; const struct pixcir_i2c_chip_data *chip; + struct touchscreen_properties prop; int max_fingers; /* Max fingers supported in this instance */ bool running; }; struct pixcir_touch { - int x; - int y; + s16 x; + s16 y; int id; }; @@ -100,6 +101,9 @@ static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata, for (i = 0; i < touch; i++) { report->touches[i].x = (bufptr[1] << 8) | bufptr[0]; report->touches[i].y = (bufptr[3] << 8) | bufptr[2]; + touchscreen_apply_prop_to_x_y(&tsdata->prop, + &report->touches[i].x, + &report->touches[i].y); if (chip->has_hw_ids) { report->touches[i].id = bufptr[4]; @@ -515,7 +519,7 @@ static int pixcir_i2c_ts_probe(struct i2c_client *client, } else { input_set_capability(input, EV_ABS, ABS_MT_POSITION_X); input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y); - touchscreen_parse_properties(input, true, NULL); + touchscreen_parse_properties(input, true, &tsdata->prop); if (!input_abs_get_max(input, ABS_MT_POSITION_X) || !input_abs_get_max(input, ABS_MT_POSITION_Y)) { dev_err(dev, "Touchscreen size is not specified\n");