Re: [PATCH v4 05/10] Input: wacom_i2c - Add support for distance and tilt x/y

From: Dmitry Torokhov
Date: Mon Mar 29 2021 - 15:13:26 EST


On Thu, Mar 25, 2021 at 09:52:25PM -0400, Alistair Francis wrote:
> This is based on the out of tree rM2 driver.
>
> Signed-off-by: Alistair Francis <alistair@xxxxxxxxxxxxx>
> ---
> 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 ee1829dd35f4..3b4bc514dc3f 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]);

Do other models also support distance and tilt? If not, this needs to be
made conditional.

Thanks.


--
Dmitry