Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2749164pxb; Sun, 29 Aug 2021 02:21:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz33zjDyyU2FaKAqQUJRc6jcOb3jXT55mpfozlFbNtTwvcayu1XU2BOweeYyHUj5LzG9w3/ X-Received: by 2002:a92:d650:: with SMTP id x16mr12517016ilp.253.1630228903662; Sun, 29 Aug 2021 02:21:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630228903; cv=none; d=google.com; s=arc-20160816; b=w4Qn+pRKurpsIxJukp0IcqT/KMVpH4RMaNrlirccJ7ZgomamIZmQ3NQV+daQbpyIJs w+MU5cwoNaBQtj1Z3z+vtCiaktZgJPrIGFdOAFx3MrH/+FaUrz/tDf6fyBMHXsVlnLbA mUXx0HGMuzOoG1+IQBq8KgDT/NP0yTMDoO0K+n6uQLELTyIklgOgyE21ghIzpasntwZv fjd/hQtxTonzvNZyPiXEHrXoUDiwyZbNVkF/VPIw7H65kOTP4xXeDBcIt0L7V9mh9peZ kHXGUK+yno42FQ8ea8XJxket0ddYjiJedHosj3SrT5JclNIvGOZFpTe0iAIo/Iqmwx/f cHbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=wDxD148pGxNLofDiRuvl3Q1zS4b7Jw1CAMW3y7CSj/k=; b=FjHyDTjoP6C9W8eiD/FhyQCcTcSkwjq76zLABTd3b5UxePwWNl/Mk4hmQzEEDXJePI dWGK31jZsn/M3T9a2lu/Sih6llUKx3ZQsJYR/Rpg/ypFFwyAlUvq7RPxrI2qZ5nCRuEV BxkGrX7zn22KrehJXfzFAmNV49V+HHpgGUlfeXCyKCIQ8zPWv46Wov6KdhdSFTLMAmOy ANkfO1Cln/JlioERHUpES2MY1T8UXkzSPwu5WovR0a7EtIef50P0uVGeb+KkiQqR56fE tlKr+GbFhkab5XNt1QdVQYLfoLJkB6xzzoUcPlxEW96m6bSfMnTJJVCa9Q2NVRByvdC+ 0bNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm2 header.b=hlAKNQvy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=oNlxszp2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h8si11453008jav.8.2021.08.29.02.21.17; Sun, 29 Aug 2021 02:21:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alistair23.me header.s=fm2 header.b=hlAKNQvy; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=oNlxszp2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234968AbhH2JVB (ORCPT + 99 others); Sun, 29 Aug 2021 05:21:01 -0400 Received: from new4-smtp.messagingengine.com ([66.111.4.230]:54021 "EHLO new4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234959AbhH2JU5 (ORCPT ); Sun, 29 Aug 2021 05:20:57 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id AF47D580B0E; Sun, 29 Aug 2021 05:20:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 29 Aug 2021 05:20:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alistair23.me; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=wDxD148pGxNLo fDiRuvl3Q1zS4b7Jw1CAMW3y7CSj/k=; b=hlAKNQvyWLDNHdhlmUFTWqHBYcGCB A76Hh6kui8L1Jf4dmTkXosdjYVgLB2JBbkfxUjlHa2fO9wvNYJj04BmoyCVUtP41 a3c86Fs3ydy7jwVXJBll41uxhls/DSp/DVer8El42yiyux6fZPNNtY1wuNJxo+1N LPFun28K0n8RCz9YwOIWDdTT7SN6Vr2+s9/TJ1bgRIArc8960MS5MT5jCISqzK6v ZtIRBxooNqc91nPuGHSrwAq4zJvstzXfW0Pt1vXFsQ9j4PneMCtLshzwM+3Immrh 8HSMS0TeZl4z+q13WT3BV2e+De2088NegCSgZlb6cn0w6N0EtxiWHc53g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=wDxD148pGxNLofDiRuvl3Q1zS4b7Jw1CAMW3y7CSj/k=; b=oNlxszp2 HbkMqDgKybM+dRY7Ld2OrhL2K8JbBVsvbJXcoeIPkcmBdlZXe5vAojOvISP+wJ2S i6fBqty/763SabfhpiK8h68hu4AR9Zjf/dZVStdev3//2drmUPgZeEcd5QlkpPnz HgiEs6hamkV14GFlQNFGvHMGdHu59TCOKCOpb9AF5ZUDKxdX/SVIX6FwvOfZwAWy PqRI7zY+d49JaS5J21APsWaC/Ae3qoWNrfU9HVnh6Ec20qN8b01FSKeTymKfNtNN rYpYm3Pr6DTDeb4hYg+16ipBSSs+h4HC++7/Zp+QPkFwBm0XBR9h4pJe536Z14iw pxuAMONXcFMV6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddujedguddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomheptehlihhsthgrihhrucfhrhgrnhgtihhsuceorghlihhsthgr ihhrsegrlhhishhtrghirhdvfedrmhgvqeenucggtffrrghtthgvrhhnpeeggedtteejke eggeeugfehueevudegvdetjeeviedugedvtdekffekhedtteduhfenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhishhtrghirhesrghlih hsthgrihhrvdefrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 29 Aug 2021 05:20:00 -0400 (EDT) From: Alistair Francis To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, pinglinux@gmail.com, tatsunosuke.tobita@wacom.com, junkpainting@gmail.com, ping.cheng@wacom.com Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, robh+dt@kernel.org, devicetree@vger.kernel.org, Alistair Francis Subject: [PATCH v10 04/12] Input: wacom_i2c - Add touchscren properties Date: Sun, 29 Aug 2021 19:19:17 +1000 Message-Id: <20210829091925.190-6-alistair@alistair23.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210829091925.190-1-alistair@alistair23.me> References: <20210829091925.190-1-alistair@alistair23.me> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Connect touchscreen properties to the wacom_i2c. Signed-off-by: Alistair Francis --- drivers/input/touchscreen/wacom_i2c.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c index 6053595f2b30..28255c77d426 100644 --- a/drivers/input/touchscreen/wacom_i2c.c +++ b/drivers/input/touchscreen/wacom_i2c.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -33,6 +34,8 @@ struct wacom_features { struct wacom_i2c { struct i2c_client *client; struct input_dev *input; + struct touchscreen_properties props; + struct wacom_features features; u8 data[WACOM_QUERY_SIZE]; bool prox; int tool; @@ -90,6 +93,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) { struct wacom_i2c *wac_i2c = dev_id; struct input_dev *input = wac_i2c->input; + struct wacom_features *features = &wac_i2c->features; u8 *data = wac_i2c->data; unsigned int x, y, pressure; unsigned char tsw, f1, f2, ers; @@ -114,6 +118,8 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) wac_i2c->prox = data[3] & 0x20; + touchscreen_report_pos(input, &wac_i2c->props, features->x_max, + features->y_max, true); input_report_key(input, BTN_TOUCH, tsw || ers); input_report_key(input, wac_i2c->tool, wac_i2c->prox); input_report_key(input, BTN_STYLUS, f1); @@ -151,7 +157,7 @@ static int wacom_i2c_probe(struct i2c_client *client, struct device *dev = &client->dev; struct wacom_i2c *wac_i2c; struct input_dev *input; - struct wacom_features features = { 0 }; + struct wacom_features *features; int error; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { @@ -159,14 +165,15 @@ static int wacom_i2c_probe(struct i2c_client *client, return -EIO; } - error = wacom_query_device(client, &features); - if (error) - return error; - wac_i2c = devm_kzalloc(dev, sizeof(*wac_i2c), GFP_KERNEL); if (!wac_i2c) return -ENOMEM; + features = &wac_i2c->features; + error = wacom_query_device(client, features); + if (error) + return error; + wac_i2c->client = client; input = devm_input_allocate_device(dev); @@ -178,7 +185,7 @@ static int wacom_i2c_probe(struct i2c_client *client, input->name = "Wacom I2C Digitizer"; input->id.bustype = BUS_I2C; input->id.vendor = 0x56a; - input->id.version = features.fw_version; + input->id.version = features->fw_version; input->open = wacom_i2c_open; input->close = wacom_i2c_close; @@ -190,10 +197,11 @@ static int wacom_i2c_probe(struct i2c_client *client, __set_bit(BTN_STYLUS2, input->keybit); __set_bit(BTN_TOUCH, input->keybit); - input_set_abs_params(input, ABS_X, 0, features.x_max, 0, 0); - input_set_abs_params(input, ABS_Y, 0, features.y_max, 0, 0); + touchscreen_parse_properties(input, true, &wac_i2c->props); + input_set_abs_params(input, ABS_X, 0, features->x_max, 0, 0); + input_set_abs_params(input, ABS_Y, 0, features->y_max, 0, 0); input_set_abs_params(input, ABS_PRESSURE, - 0, features.pressure_max, 0, 0); + 0, features->pressure_max, 0, 0); input_set_drvdata(input, wac_i2c); -- 2.31.1