Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp655730lqt; Thu, 6 Jun 2024 14:30:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKxC9eI5OwAgt2WQIhcDMLHDDQvpDKv3ULWE1/cMg0eTWPjWWllpmHGVnDp0nLNJGJ2+jzKWjVuDZGsdZHgQWB6IrdcLXOKSkHs++now== X-Google-Smtp-Source: AGHT+IFmwFoxdQlzydxPdI98omf98VBmbbXIHuJ1WiwBqY1GzVhZmm6ZXsgXx/KrwQCtZnMu0V9D X-Received: by 2002:a17:90a:cc5:b0:2c0:33a7:2afb with SMTP id 98e67ed59e1d1-2c2bcad0f9fmr787931a91.10.1717709417794; Thu, 06 Jun 2024 14:30:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717709417; cv=pass; d=google.com; s=arc-20160816; b=cd0bQc7+/F4Iru11+Qrk8WFsW6uWEqkTmDYkuLLLZKbDs6WYU7ly2e+9YsOfGEuOHF XKs6Cf/dNbSKQBpC02unH4ew+zqVCdHuDjYmak6yHAIhaH3OmzTUUPRB+oTLa1WNK7AW 1epx2SshbwFbBnah0TlTTik2Arku1yqRAflvnHemMhgNGD/bb0uLuKBb33rogX5ARgx9 caHkC/k6b0+WEeM54338s2W0ugj9PyHFvvQN2EwaLluxOzLU0p8moDJP0LmcxGn7aIHI 0pHra0cMSLqtsaixY8T5T29cDa6EEpZgdvincLFfa7p/+ZvHydElZJM1ORvh5w0qIo0L +b0w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6/wrurbfyUySx6z2OKVYQ/vZalRqibSuFmNRlySgbic=; fh=hc5s7WNZcOnKiRZeA3a4F/UMBd7rYWsXavES/uZtwdU=; b=n2Lx6Ls9Tm24nHp7Z825Dh40hMmTzJGwKKavQorUcb1EHKGukogASSB30IJ9SGQlMI 6WmqZ6yEidgP/lC27rjIHi9W5AO77dDJR19f5xEqRGzXeOC3+BUyYh6mIUZWoDafr8Jv NTnMBY0umvFfCD5eWKkGtLVXZL0nDU9HPdu3bQYMvtfSQT0hXxuJis/dhgSd9PHhHqm4 Tet2PqD+BPpMTFK6SaD8+wxI793Szw4o6Xln3LYjjGBS25qabb6W2SiHa3lD7xTnYpUS qqlFONi9dSgbdjlQqMU3ovUCtc3JlELY6AkBzxkTrkhTqrxA4MdSaqZsJ4rJ4FIYqrs/ qv6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DOHuZNiz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806efc5asi817874a91.171.2024.06.06.14.30.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=DOHuZNiz; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205055-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205055-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A69F1B25C8E for ; Thu, 6 Jun 2024 21:24:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C2D0197A64; Thu, 6 Jun 2024 21:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DOHuZNiz" Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C678D1DFD1; Thu, 6 Jun 2024 21:23:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717709010; cv=none; b=ZhEJj4/KKMO6NggiDJXDv5ZJQFxR6moCtWTThJg/sHBzjthJFR37u2riXUYIvDLATQLZrvjKFcvVeWPlv4QYYcd7m6+OrTHadQYp+JEkkPxbWxv9JKfKbepQPHnWqEbhF7nb7cRlecy5Ki6M4+/+HOn5jLDnVMkhxiiJLl4H/MA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717709010; c=relaxed/simple; bh=MlWKKowoduf1coKOO9ueG5D4siN7Sr8huDBPbThrT3g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=I9jKt0rZ75i/0Aqe04CmT77sxLzS05r/v54I68e0zzfUQC6o7Sbf8jMJwO5poWuKNge33TtSFD0XXsm1OdrO+Pp1NeybyILn6NbBFZTO4nJIUxSqJcJmKNfDqAGPxJnqUQMB5UR+6HEaMCZQndi0vbOmA7Ma+ZOowSZBw1VCDUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DOHuZNiz; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-6c4f3e0e3d2so1168988a12.1; Thu, 06 Jun 2024 14:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717709008; x=1718313808; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6/wrurbfyUySx6z2OKVYQ/vZalRqibSuFmNRlySgbic=; b=DOHuZNiz7dVt1++kmgUY16xXmdRy5JaN7a2s15Y1iGFoWuNCkaBh0pJAX/bm1JFiTh x132kcMzme5saSAf/oLVoFgL9gPVVB6hDjnIjE56PiF5ciy3TXTgTTGbw2WiA6aKcF0L MwmDsWYnfw2XFopGaSl5Qpai0HL2LpLErYtOaxSoUHRzbNHwmZMNG8DCTtxI2ezYy8DW lZySUzQeUXKcBpfoFqJWBzbYpswqIVlmO36ljAbK1DQmkEEAG8mWSjS/c640ccPCiBuz QuuPX1TGB87XIxrF66ggs9o/09rLrJBfy/owCewqRqLIe3lYeMffWt7nKhEa32GcsJsd ZTpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717709008; x=1718313808; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6/wrurbfyUySx6z2OKVYQ/vZalRqibSuFmNRlySgbic=; b=PTMo0ZhmzAGoNSTXtbu1ryjA/dFEC6BIdCwBrBne3tfJLAyR2BDM0BU7Eq+PFaqsqH /h3f2l5DD8a8qfnMEoigjg7vFkgsX9fjUgQx2sAL6oWvVwnvEiSDEz+8mi81hJyK/BlF bOt6AR94MfQzZF9HIep2EEVn02d+DAmnU+hJ7ZMkQTiey29UVlMWDZxubRM271tIbJyO HTPFS1GiUBnKzwcSdQ/5J8q9h2CztVKRiwJfy0qagzpn+VKNyzVYGgJ2nWigAFGLsoMP S/z2t5CHKgU2Mw61ZAHxBgFglKdXlYL8jubIT2Kw0GHdGoKzUbkKBkIQAFi2m4MxTMhX Skdw== X-Forwarded-Encrypted: i=1; AJvYcCXkG9UjCwVp+ow2oRw0WKkHF7/fcLX/DEodUW7OofjSu1NCDo+5b4an+dbWV7tZBxpgG1b4uvbZibo2dK/LERf9RTc86TG08JghVszl X-Gm-Message-State: AOJu0Yys7osP3YA0aEK3FIgNbsneP8Ru4gdatpO3ZGb+8U/S4LY8AY7+ TtZNbJjl3uDwOC4rYGg9daPv1rf8cGg2jfcSbje9JltGe954pDrI X-Received: by 2002:a17:902:d508:b0:1f6:8489:d150 with SMTP id d9443c01a7336-1f6d02d2295mr9122195ad.13.1717709007959; Thu, 06 Jun 2024 14:23:27 -0700 (PDT) Received: from google.com ([2620:15c:9d:2:cdcb:6470:dec1:846c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6bd7d5edfsm20337705ad.162.2024.06.06.14.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 14:23:27 -0700 (PDT) Date: Thu, 6 Jun 2024 14:23:24 -0700 From: Dmitry Torokhov To: Alistair Francis Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, alistair23@gmail.com Subject: Re: [PATCH v2] Input: wacom_i2c - Clean up the query device fields Message-ID: References: <20211118123545.102872-1-alistair@alistair23.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211118123545.102872-1-alistair@alistair23.me> Hi Alistair, On Thu, Nov 18, 2021 at 10:35:45PM +1000, Alistair Francis wrote: > Improve the query device fields to be more verbose. > > Signed-off-by: Alistair Francis Could you please list what has changed since v1? > --- > drivers/input/touchscreen/wacom_i2c.c | 45 ++++++++++++++++----------- > 1 file changed, 27 insertions(+), 18 deletions(-) > > diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c > index fe4ea6204a4e..50d159919bd1 100644 > --- a/drivers/input/touchscreen/wacom_i2c.c > +++ b/drivers/input/touchscreen/wacom_i2c.c > @@ -23,13 +23,20 @@ > #define WACOM_BARREL_SWITCH_2 BIT(4) > #define WACOM_IN_PROXIMITY BIT(5) > > -/* Registers */ > -#define WACOM_CMD_QUERY0 0x04 > -#define WACOM_CMD_QUERY1 0x00 > -#define WACOM_CMD_QUERY2 0x33 > -#define WACOM_CMD_QUERY3 0x02 > -#define WACOM_CMD_THROW0 0x05 > -#define WACOM_CMD_THROW1 0x00 > +// Registers I am partial to C-style comments, let's keep them. > +#define WACOM_COMMAND_LSB 0x04 > +#define WACOM_COMMAND_MSB 0x00 > + > +#define WACOM_DATA_LSB 0x05 > +#define WACOM_DATA_MSB 0x00 > + > +// Report types > +#define REPORT_FEATURE 0x30 > + > +// Requests / operations > +#define OPCODE_GET_REPORT 0x02 > + > +#define WACOM_QUERY_REPORT 3 > #define WACOM_QUERY_SIZE 19 > > struct wacom_features { > @@ -51,22 +58,24 @@ static int wacom_query_device(struct i2c_client *client, > struct wacom_features *features) > { > int ret; > - u8 cmd1[] = { WACOM_CMD_QUERY0, WACOM_CMD_QUERY1, > - WACOM_CMD_QUERY2, WACOM_CMD_QUERY3 }; > - u8 cmd2[] = { WACOM_CMD_THROW0, WACOM_CMD_THROW1 }; > u8 data[WACOM_QUERY_SIZE]; > + > + u8 get_query_data_cmd[] = { > + WACOM_COMMAND_LSB, > + WACOM_COMMAND_MSB, > + REPORT_FEATURE | WACOM_QUERY_REPORT, > + OPCODE_GET_REPORT, > + WACOM_DATA_LSB, > + WACOM_DATA_MSB, > + }; > + > struct i2c_msg msgs[] = { > + // Request reading of feature ReportID: 3 (Pen Query Data) > { > .addr = client->addr, > .flags = 0, > - .len = sizeof(cmd1), > - .buf = cmd1, > - }, > - { > - .addr = client->addr, > - .flags = 0, > - .len = sizeof(cmd2), > - .buf = cmd2, > + .len = sizeof(get_query_data_cmd), > + .buf = get_query_data_cmd, This combines writes into one message. Is this safe and works for all devices? At the very least this needs to be mentioned in the patch description. > }, > { > .addr = client->addr, > -- > 2.31.1 > Thanks. -- Dmitry