From patchwork Fri Nov 20 13:24:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 7667721 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 79A15BF90C for ; Fri, 20 Nov 2015 13:25:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AA1CF20439 for ; Fri, 20 Nov 2015 13:25:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0B8920429 for ; Fri, 20 Nov 2015 13:25:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162240AbbKTNZZ (ORCPT ); Fri, 20 Nov 2015 08:25:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162006AbbKTNZY (ORCPT ); Fri, 20 Nov 2015 08:25:24 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id C4086C0AE699; Fri, 20 Nov 2015 13:25:24 +0000 (UTC) Received: from shalem.localdomain.com (vpn1-6-140.ams2.redhat.com [10.36.6.140]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAKDOtbN005112; Fri, 20 Nov 2015 08:25:20 -0500 From: Hans de Goede To: Dmitry Torokhov , Maxime Ripard Cc: Sander Vermin , linux-input@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree , linux-sunxi@googlegroups.com, Hans de Goede Subject: [PATCH v2 5/7] touchscreen: pixcir_ts: Add support for axis inversion / swapping Date: Fri, 20 Nov 2015 14:24:50 +0100 Message-Id: <1448025892-20899-6-git-send-email-hdegoede@redhat.com> In-Reply-To: <1448025892-20899-1-git-send-email-hdegoede@redhat.com> References: <1448025892-20899-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 b75ef65..c553c68 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");