Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3596849imu; Tue, 18 Dec 2018 00:41:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/VNKoKKrSyPxo+1+3G9S/y0jVFGvEBqvLqNJgYZkxXTfOo2W4LOBnYvbv+qtbVC6F6NbtKl X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr15953608plb.253.1545122486491; Tue, 18 Dec 2018 00:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545122486; cv=none; d=google.com; s=arc-20160816; b=zHcphdVcU3ly02rQ6sujBmuxOJGZA9xrKiCuWRtI2DJrv11eWQ1ZKv+CSKxCq0ZQls PntuogYV1e1DXvuLbqvsN76xiLgGOSDcZYiCyCQYUSmW1JuaYN1qRl0hAnvsQtHSHrLN tX9j1ocgB//T75gXZCt9+AIFHbXQp9U1b0w5P8+cfQTvgZbwHrcRruZQEFkS5J1bYKJr qh5eJVhCjVGK1vSTbO37c9vMPswkTvTgS8mPu+XYvuZ9Xs0BPmVnwfvtzlnVvAkT5qA1 gLtuxc1RugbIgSFKAo50bAoZcWQkVvJMEVcMXN7BrikKcYWXXqP4mJLcBWECmoxvUuqC nKqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=QOksDmBMP4TIG82WQC4amHcWxNR7oSJJTC3mOE0mZ70=; b=ZWvRvOvg5aL2eGXATAn9EExxxhDu19fYAXWMdvJz+Uo7TKNsQnQyWM+zLMMBcXCjfa kfkJszr07RyW45SqWXOIICs7UAfNAoMx8tzygtip42mJSHt+lTJ3DcHKezKRsoowbNM0 8vzjDIYB3V/eAU0a1BEo5D69CnvNNh+FBfNh2mpIRHol+iLlCHV7Hvn9jsJNiE76xHde Y+ugKoKaSe3WWeMcLtKtwI23zalD0p1w92/GTzOdnJ4DQav/vzEN9i+OSxKOm06Jj2tD dJNjndrTc+jXOl1dAtUHXFcEQL39eS45sCOvyJ1kYI0LERWML0qMmr6glNVtM5ZX+tur s3VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y20si12710013pgi.50.2018.12.18.00.41.11; Tue, 18 Dec 2018 00:41:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726734AbeLRIjz (ORCPT + 99 others); Tue, 18 Dec 2018 03:39:55 -0500 Received: from mail2.skidata.com ([91.230.2.91]:58407 "EHLO mail2.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726386AbeLRIjy (ORCPT ); Tue, 18 Dec 2018 03:39:54 -0500 X-IronPort-AV: E=Sophos;i="5.56,367,1539640800"; d="scan'208";a="1873962" From: Richard Leitner To: , CC: , , , , Subject: [RESEND PATCH v2 7/8] Input: sx8654 - use common of_touchscreen functions Date: Tue, 18 Dec 2018 09:39:46 +0100 Message-ID: <20181218083946.13823-1-richard.leitner@skidata.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181218083606.25795-1-richard.leitner@skidata.com> References: <20181218083606.25795-1-richard.leitner@skidata.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.111.252] X-ClientProxiedBy: sdex3srv.skidata.net (192.168.111.81) To sdex5srv.skidata.net (192.168.111.83) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org of_touchscreen.c provides a common interface for a axis invertion and swapping of touchscreens. Therefore use it in the sx8654 driver. Signed-off-by: Richard Leitner --- drivers/input/touchscreen/sx8654.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index 4939863efbef..b7b263ed52af 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c @@ -35,6 +35,7 @@ #include #include #include +#include /* register addresses */ #define I2C_REG_TOUCH0 0x00 @@ -101,6 +102,7 @@ struct sx8654 { spinlock_t lock; /* for input reporting from irq/timer */ struct timer_list timer; + struct touchscreen_properties props; const struct sx865x_data *data; }; @@ -178,8 +180,7 @@ static irqreturn_t sx8650_irq(int irq, void *handle) chdata); } - input_report_abs(ts->input, ABS_X, x); - input_report_abs(ts->input, ABS_Y, y); + touchscreen_report_pos(ts->input, &ts->props, x, y, false); input_report_key(ts->input, BTN_TOUCH, 1); input_sync(ts->input); dev_dbg(dev, "point(%4d,%4d)\n", x, y); @@ -226,8 +227,8 @@ static irqreturn_t sx8654_irq(int irq, void *handle) x = ((data[0] & 0xf) << 8) | (data[1]); y = ((data[2] & 0xf) << 8) | (data[3]); - input_report_abs(sx8654->input, ABS_X, x); - input_report_abs(sx8654->input, ABS_Y, y); + touchscreen_report_pos(sx8654->input, &sx8654->props, x, y, + false); input_report_key(sx8654->input, BTN_TOUCH, 1); input_sync(sx8654->input); @@ -377,6 +378,8 @@ static int sx8654_probe(struct i2c_client *client, input_set_abs_params(input, ABS_X, 0, MAX_12BIT, 0, 0); input_set_abs_params(input, ABS_Y, 0, MAX_12BIT, 0, 0); + touchscreen_parse_properties(input, false, &sx8654->props); + sx8654->client = client; sx8654->input = input; -- 2.11.0