Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1143564pxb; Fri, 22 Jan 2021 08:09:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyaM50R8k7RmZqa+Fv0kU3vFvucZwPTOoV6YfTYkCSvTsEt9zaRWyvHUFoJ7BQPDyW+KRl2 X-Received: by 2002:a50:b742:: with SMTP id g60mr3679865ede.113.1611331770007; Fri, 22 Jan 2021 08:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611331769; cv=none; d=google.com; s=arc-20160816; b=SAIyknFTMZNtVzxEPFoCfdPltxflNP8Z7VQBXRUQYLHGgj3h0gWK3JMWmLiWD3Dold AsDd/I4kCD83C2YqOAe0sxPfCt52+/ElNkbkohvAwukmvCENVsgj0rShlj01BA1sJ+t7 zSkTmX2E35Z+m5MERu46sWnsGU+7sHTDBNxSaTF2pghj5ea13KEpteWW7+CFmQf593Kn OMSj2fdyQVCzoMN34lm2qMqhKPfcL91lIwbEGfwZUBtEdj+uKgPu72KKobyhKgT4Ut/9 JdoA9m6zxb+XXlll5nx43Y533AkT8GLcVVmnTnyPp0FKXMTNA8n4Yl8bq++1d/c8L0Vc kkJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=D/Bl+goCj0kr8gIutkMZEMA61Ub+qD7qtGa2Dh8kkEE=; b=vZQhi8paN4u6K+xC4rzGHlQjFmAg2y8UIE/zRn15XmkYi4b84/emQnI5KgtMpa0NIO c+40icHC9po0yZVvZHdi1eoEn/yVgGznB0tHF0d4Dda0N216BE5+sTidwCAN6NDONZpP GO8azh8Xajj2XZVjEfYvHwHzWBuJzOzSM+Mfo7bPpijbeR12uGA/cp6yF2/yja0RrJSp ++nezF06MOHOrXPujpmDz9Vl9NJfzyFvm9WaUv0Qjz340yPpYRD5rbErxbVKb1pYOLMH 4WQmh01BGVPLg9HaYOcGBfBHY99+24URxi4LiBb5oKMykyBNoNT8Ve4iya8p3ptDNDGG fd/g== ARC-Authentication-Results: i=1; mx.google.com; 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 dk22si3125599ejb.736.2021.01.22.08.09.06; Fri, 22 Jan 2021 08:09:29 -0800 (PST) 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; 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 S1729400AbhAVQC1 (ORCPT + 99 others); Fri, 22 Jan 2021 11:02:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729366AbhAVQAw (ORCPT ); Fri, 22 Jan 2021 11:00:52 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADF47C0613D6 for ; Fri, 22 Jan 2021 08:00:11 -0800 (PST) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2yr1-0001zX-2X; Fri, 22 Jan 2021 17:00:07 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1l2yr0-0000wP-Db; Fri, 22 Jan 2021 17:00:06 +0100 Date: Fri, 22 Jan 2021 17:00:06 +0100 From: Marco Felsch To: Alistair Francis Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, alistair23@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/6] touchscreen/wacom_i2c: Add support for distance and tilt x/y Message-ID: <20210122160006.rh7bzmbr4jvvejzx@pengutronix.de> References: <20210121065643.342-1-alistair@alistair23.me> <20210121065643.342-4-alistair@alistair23.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210121065643.342-4-alistair@alistair23.me> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 16:59:10 up 51 days, 6:05, 28 users, load average: 0.07, 0.08, 0.06 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, thanks for the patch. Please align all your patch-subjects belonging to the driver to: "Input: wacom_i2c - ..." On 21-01-20 22:56, Alistair Francis wrote: > This is based on the out of tree rM2 driver. > > Signed-off-by: Alistair Francis > --- > drivers/input/touchscreen/wacom_i2c.c | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c > index ec6e0aff8deb..5f0b80d52ad5 100644 > --- a/drivers/input/touchscreen/wacom_i2c.c > +++ b/drivers/input/touchscreen/wacom_i2c.c > @@ -22,12 +22,16 @@ > #define WACOM_CMD_QUERY3 0x02 > #define WACOM_CMD_THROW0 0x05 > #define WACOM_CMD_THROW1 0x00 > -#define WACOM_QUERY_SIZE 19 > +#define WACOM_QUERY_SIZE 22 > > struct wacom_features { > int x_max; > int y_max; > int pressure_max; > + int distance_max; > + int distance_physical_max; > + int tilt_x_max; > + int tilt_y_max; > char fw_version; > }; > > @@ -79,6 +83,10 @@ static int wacom_query_device(struct i2c_client *client, > features->y_max = get_unaligned_le16(&data[5]); > features->pressure_max = get_unaligned_le16(&data[11]); > features->fw_version = get_unaligned_le16(&data[13]); > + features->distance_max = data[15]; > + features->distance_physical_max = data[16]; > + features->tilt_x_max = get_unaligned_le16(&data[17]); > + features->tilt_y_max = get_unaligned_le16(&data[19]); > > dev_dbg(&client->dev, > "x_max:%d, y_max:%d, pressure:%d, fw:%d\n", > @@ -95,6 +103,7 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) > u8 *data = wac_i2c->data; > unsigned int x, y, pressure; > unsigned char tsw, f1, f2, ers; > + short tilt_x, tilt_y, distance; > int error; > > error = i2c_master_recv(wac_i2c->client, > @@ -109,6 +118,11 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) > x = le16_to_cpup((__le16 *)&data[4]); > y = le16_to_cpup((__le16 *)&data[6]); > pressure = le16_to_cpup((__le16 *)&data[8]); > + distance = data[10]; > + > + /* Signed */ > + tilt_x = le16_to_cpup((__le16 *)&data[11]); > + tilt_y = le16_to_cpup((__le16 *)&data[13]); > > if (!wac_i2c->prox) > wac_i2c->tool = (data[3] & 0x0c) ? > @@ -123,6 +137,9 @@ static irqreturn_t wacom_i2c_irq(int irq, void *dev_id) > input_report_abs(input, ABS_X, x); > input_report_abs(input, ABS_Y, y); > input_report_abs(input, ABS_PRESSURE, pressure); > + input_report_abs(input, ABS_DISTANCE, distance); > + input_report_abs(input, ABS_TILT_X, tilt_x); > + input_report_abs(input, ABS_TILT_Y, tilt_y); > input_sync(input); > > out: > @@ -195,7 +212,11 @@ static int wacom_i2c_probe(struct i2c_client *client, > 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); > - > + input_set_abs_params(input, ABS_DISTANCE, 0, features.distance_max, 0, 0); > + input_set_abs_params(input, ABS_TILT_X, -features.tilt_x_max, > + features.tilt_x_max, 0, 0); > + input_set_abs_params(input, ABS_TILT_Y, -features.tilt_y_max, > + features.tilt_y_max, 0, 0); > input_set_drvdata(input, wac_i2c); > > error = request_threaded_irq(client->irq, NULL, wacom_i2c_irq, > -- > 2.29.2 > > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |