Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp841703imm; Wed, 17 Oct 2018 09:06:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV60NQh8NkRvdyVvmxg0IMXU2kvRNCDjd+Km7R9hNo+awVmbNECgOXF5l3WYSaG7MqjMXfIGa X-Received: by 2002:a63:5f05:: with SMTP id t5-v6mr24454727pgb.352.1539792408318; Wed, 17 Oct 2018 09:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539792408; cv=none; d=google.com; s=arc-20160816; b=JC+JDiqrHNq6mV1g6TPHwoBkjkiEEBhitDV1AeJXV1dGBxq2tisnYDe5g53sBCwoix aoSs2qVKTw8zTKZQ2F+0wM4i7rDcF6ky9M2NIx0ev16UWeeTMRVVjRuNf9cCswZ8XTzS 3b9n8BbnDUm+4Ip94Oj02Yb054Dk6dMwCHpw9ITYV9+jGHYx7cpfHOwkAhJjL8sLA1kt tpXCxQwiw2NYX6/xJMOxsnQbf+O4IRmkyM7dmMlyrJB6JtJxoYsYaazu9vJgpp3P6xfY VSClnGEdVLvEOjnWWxI6WKhCUSCAzg77dHvjmpwRcbM+v+YZp+ZssihHHwn9VmMog+wq IijQ== 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=BLiM4ijfxOxR3VLfK38bpkXzejwO+yaPeSZr+Yk0isSLcgEPGXpDkvWCTTKc3E4l7d Wm/vpyko6d1F5jFBRrghgK6CSN5xE6X6bU0Y3dcXsBe8qSDn2kPGBHlahbnUweJJnn0D jSs7icfXNBWuKQLW4sqkQLWSD88eMyqevNaQ8XOGRT8Ep9SOQL21Kc+afo7qdCrlOHa5 pGantHGlG1GFmsLxgQtnXqXXZx+o7H9NyzM36vZwGqitQajtR9R7h0NtIW8s4JA06byt 0oeOrGKIaZs0WRfaaV+EjykuLBE6nDQ4r9F1oJ5fmffhsMmuU5SXIDViEoN8Owwx7SSJ dzrQ== 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 j7-v6si17572985pgj.532.2018.10.17.09.06.26; Wed, 17 Oct 2018 09:06:48 -0700 (PDT) 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 S1727832AbeJRAAe (ORCPT + 99 others); Wed, 17 Oct 2018 20:00:34 -0400 Received: from mail2.skidata.com ([91.230.2.91]:49383 "EHLO mail2.skidata.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727048AbeJRAAe (ORCPT ); Wed, 17 Oct 2018 20:00:34 -0400 X-IronPort-AV: E=Sophos;i="5.54,393,1534802400"; d="scan'208";a="1732779" From: Richard Leitner To: , , CC: , , , Richard Leitner Subject: [PATCH v2 7/8] Input: sx8654 - use common of_touchscreen functions Date: Wed, 17 Oct 2018 14:51:15 +0200 Message-ID: <20181017125116.20077-8-richard.leitner@skidata.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181017125116.20077-1-richard.leitner@skidata.com> References: <20181017125116.20077-1-richard.leitner@skidata.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [192.168.111.252] X-ClientProxiedBy: sdex5srv.skidata.net (192.168.111.83) 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