linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
@ 2021-10-09 11:43 Alistair Francis
  2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
                   ` (4 more replies)
  0 siblings, 5 replies; 22+ messages in thread
From: Alistair Francis @ 2021-10-09 11:43 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer
  Cc: linux-imx, jikos, benjamin.tissoires, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, alistair23, Alistair Francis

Add support to the Wacom HID device for flipping the values based on
device tree settings. This allows us to support devices where the panel
is installed in a different orientation, such as the reMarkable2.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 .../bindings/input/hid-over-i2c.txt           | 20 ++++++
 drivers/hid/wacom_sys.c                       | 25 ++++++++
 drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
 drivers/hid/wacom_wac.h                       | 13 ++++
 4 files changed, 119 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.txt b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
index c76bafaf98d2..16ebd7c46049 100644
--- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
+++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
@@ -33,6 +33,26 @@ device-specific compatible properties, which should be used in addition to the
 - post-power-on-delay-ms: time required by the device after enabling its regulators
   or powering it on, before it is ready for communication.
 
+  flip-tilt-x:
+    type: boolean
+    description: Flip the tilt X values read from device
+
+  flip-tilt-y:
+    type: boolean
+    description: Flip the tilt Y values read from device
+
+  flip-pos-x:
+    type: boolean
+    description: Flip the X position values read from device
+
+  flip-pos-y:
+    type: boolean
+    description: Flip the Y position values read from device
+
+  flip-distance:
+    type: boolean
+    description: Flip the distance values read from device
+
 Example:
 
 	i2c-hid-dev@2c {
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 93f49b766376..47d9590b10bd 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -10,6 +10,7 @@
 
 #include "wacom_wac.h"
 #include "wacom.h"
+#include <linux/of.h>
 #include <linux/input/mt.h>
 
 #define WAC_MSG_RETRIES		5
@@ -2730,6 +2731,28 @@ static void wacom_mode_change_work(struct work_struct *work)
 	return;
 }
 
+static void wacom_of_read(struct hid_device *hdev, struct wacom_wac *wacom_wac)
+{
+	if (IS_ENABLED(CONFIG_OF)) {
+		wacom_wac->flip_tilt_x = of_property_read_bool(hdev->dev.parent->of_node,
+							"flip-tilt-x");
+		wacom_wac->flip_tilt_y = of_property_read_bool(hdev->dev.parent->of_node,
+							"flip-tilt-y");
+		wacom_wac->flip_pos_x = of_property_read_bool(hdev->dev.parent->of_node,
+							"flip-pos-x");
+		wacom_wac->flip_pos_y = of_property_read_bool(hdev->dev.parent->of_node,
+							"flip-pos-y");
+		wacom_wac->flip_distance = of_property_read_bool(hdev->dev.parent->of_node,
+							"flip-distance");
+	} else {
+		wacom_wac->flip_tilt_x = false;
+		wacom_wac->flip_tilt_y = false;
+		wacom_wac->flip_pos_x = false;
+		wacom_wac->flip_pos_y = false;
+		wacom_wac->flip_distance = false;
+	}
+}
+
 static int wacom_probe(struct hid_device *hdev,
 		const struct hid_device_id *id)
 {
@@ -2797,6 +2820,8 @@ static int wacom_probe(struct hid_device *hdev,
 				 error);
 	}
 
+	wacom_of_read(hdev, wacom_wac);
+
 	wacom_wac->probe_complete = true;
 	return 0;
 }
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 33a6908995b1..c01f683e23fa 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3261,6 +3261,63 @@ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
 	return 0;
 }
 
+static int wacom_of_irq(struct wacom_wac *wacom_wac, size_t len)
+{
+	const struct wacom_features *features = &wacom_wac->features;
+	unsigned char *data = wacom_wac->data;
+	struct input_dev *input = wacom_wac->pen_input;
+	unsigned int x, y, pressure;
+	unsigned char tsw, f1, f2, ers;
+	short tilt_x, tilt_y, distance;
+
+	if (!IS_ENABLED(CONFIG_OF))
+		return 0;
+
+	tsw = data[1] & WACOM_TIP_SWITCH_bm;
+	ers = data[1] & WACOM_ERASER_bm;
+	f1 = data[1] & WACOM_BARREL_SWITCH_bm;
+	f2 = data[1] & WACOM_BARREL_SWITCH_2_bm;
+	x = le16_to_cpup((__le16 *)&data[2]);
+	y = le16_to_cpup((__le16 *)&data[4]);
+	pressure = le16_to_cpup((__le16 *)&data[6]);
+
+	/* Signed */
+	tilt_x = get_unaligned_le16(&data[9]);
+	tilt_y = get_unaligned_le16(&data[11]);
+
+	distance = get_unaligned_le16(&data[13]);
+
+	/* keep touch state for pen events */
+	if (!wacom_wac->shared->touch_down)
+		wacom_wac->tool[0] = (data[1] & 0x0c) ?
+			BTN_TOOL_RUBBER : BTN_TOOL_PEN;
+
+	wacom_wac->shared->touch_down = data[1] & 0x20;
+
+	// Flip the values based on properties from the device tree
+
+	// Default to a negative value for distance as HID compliant Wacom
+	// devices generally specify the hovering distance as negative.
+	distance = wacom_wac->flip_distance ? distance : -distance;
+	x = wacom_wac->flip_pos_x ? (features->x_max - x) : x;
+	y = wacom_wac->flip_pos_y ? (features->y_max - y) : y;
+	tilt_x = wacom_wac->flip_tilt_x ? -tilt_x : tilt_x;
+	tilt_y = wacom_wac->flip_tilt_y ? -tilt_y : tilt_y;
+
+	input_report_key(input, BTN_TOUCH, tsw || ers);
+	input_report_key(input, wacom_wac->tool[0], wacom_wac->shared->touch_down);
+	input_report_key(input, BTN_STYLUS, f1);
+	input_report_key(input, BTN_STYLUS2, f2);
+	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);
+
+	return 1;
+}
+
 void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 {
 	bool sync;
@@ -3379,6 +3436,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
 			sync = wacom_remote_irq(wacom_wac, len);
 		break;
 
+	case HID_GENERIC:
+		sync = wacom_of_irq(wacom_wac, len);
+		break;
+
 	default:
 		sync = false;
 		break;
diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
index 8b2d4e5b2303..4dd5a56bf347 100644
--- a/drivers/hid/wacom_wac.h
+++ b/drivers/hid/wacom_wac.h
@@ -157,6 +157,14 @@
 #define WACOM_HID_WT_Y                  (WACOM_HID_UP_WACOMTOUCH | 0x131)
 #define WACOM_HID_WT_REPORT_VALID       (WACOM_HID_UP_WACOMTOUCH | 0x1d0)
 
+// Bitmasks (for data[3])
+#define WACOM_TIP_SWITCH_bm         (1 << 0)
+#define WACOM_BARREL_SWITCH_bm      (1 << 1)
+#define WACOM_ERASER_bm             (1 << 2)
+#define WACOM_INVERT_bm             (1 << 3)
+#define WACOM_BARREL_SWITCH_2_bm    (1 << 4)
+#define WACOM_IN_RANGE_bm           (1 << 5)
+
 #define WACOM_BATTERY_USAGE(f)	(((f)->hid == HID_DG_BATTERYSTRENGTH) || \
 				 ((f)->hid == WACOM_HID_WD_BATTERY_CHARGING) || \
 				 ((f)->hid == WACOM_HID_WD_BATTERY_LEVEL))
@@ -357,6 +365,11 @@ struct wacom_wac {
 	bool has_mode_change;
 	bool is_direct_mode;
 	bool is_invalid_bt_frame;
+	bool flip_tilt_x;
+	bool flip_tilt_y;
+	bool flip_pos_x;
+	bool flip_pos_y;
+	bool flip_distance;
 };
 
 #endif
-- 
2.31.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device
  2021-10-09 11:43 [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Alistair Francis
@ 2021-10-09 11:43 ` Alistair Francis
  2021-10-09 13:41   ` kernel test robot
  2021-10-09 14:32   ` kernel test robot
  2021-10-09 11:43 ` [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C Alistair Francis
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 22+ messages in thread
From: Alistair Francis @ 2021-10-09 11:43 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer
  Cc: linux-imx, jikos, benjamin.tissoires, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, alistair23, Alistair Francis

Add support for the AG14 Wacom digitiser connected via I2C. This is used
on the reMarkable2 tablet.

The vendor ID is different then the usual Wacom vendor ID, and I'm not
sure why. Otherwise we can just use the generic HID type.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 drivers/hid/hid-core.c  | 1 +
 drivers/hid/hid-ids.h   | 1 +
 drivers/hid/wacom_wac.c | 8 ++++++++
 3 files changed, 10 insertions(+)

diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index dbed2524fd47..724bec1754bd 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -904,6 +904,7 @@ static int hid_scan_report(struct hid_device *hid)
 	 * Vendor specific handlings
 	 */
 	switch (hid->vendor) {
+	case USB_VENDOR_ID_I2C_WACOM:
 	case USB_VENDOR_ID_WACOM:
 		hid->group = HID_GROUP_WACOM;
 		break;
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 29564b370341..daa0197445e7 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -1260,6 +1260,7 @@
 #define USB_DEVICE_ID_VTL_MULTITOUCH_FF3F	0xff3f
 
 #define USB_VENDOR_ID_WACOM		0x056a
+#define USB_VENDOR_ID_I2C_WACOM		0x2D1F
 #define USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH	0x81
 #define USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH   0x00BD
 
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index c01f683e23fa..6a800150933a 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -4814,6 +4814,9 @@ static const struct wacom_features wacom_features_0x3c8 =
 	{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
 	  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
 
+static const struct wacom_features wacom_features_0x95 =
+	{ "Wacom AG14", .type = HID_GENERIC, .oVid = 0x2D1F, .oPid = 149 };
+
 static const struct wacom_features wacom_features_HID_ANY_ID =
 	{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
 
@@ -4829,6 +4832,10 @@ static const struct wacom_features wacom_features_HID_ANY_ID =
 	HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
 	.driver_data = (kernel_ulong_t)&wacom_features_##prod
 
+#define I2C_AG14_DEVICE_WACOM(prod)					    \
+	HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_I2C_WACOM, prod),\
+	.driver_data = (kernel_ulong_t)&wacom_features_##prod
+
 #define USB_DEVICE_LENOVO(prod)					\
 	HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod),			\
 	.driver_data = (kernel_ulong_t)&wacom_features_##prod
@@ -4890,6 +4897,7 @@ const struct hid_device_id wacom_ids[] = {
 	{ USB_DEVICE_WACOM(0x84) },
 	{ USB_DEVICE_WACOM(0x90) },
 	{ USB_DEVICE_WACOM(0x93) },
+	{ I2C_AG14_DEVICE_WACOM(0x95) },
 	{ USB_DEVICE_WACOM(0x97) },
 	{ USB_DEVICE_WACOM(0x9A) },
 	{ USB_DEVICE_WACOM(0x9F) },
-- 
2.31.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C
  2021-10-09 11:43 [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Alistair Francis
  2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
@ 2021-10-09 11:43 ` Alistair Francis
  2021-10-15  2:50   ` Shawn Guo
  2021-10-09 11:43 ` [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-09 11:43 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer
  Cc: linux-imx, jikos, benjamin.tissoires, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, alistair23, Alistair Francis

Enable HID I2C in the imx defconfig as it is used for a HID compliant
wacom device on the reMarkable2 tablet.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 arch/arm/configs/imx_v6_v7_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig
index ccee86d0045d..8a54a4d0181a 100644
--- a/arch/arm/configs/imx_v6_v7_defconfig
+++ b/arch/arm/configs/imx_v6_v7_defconfig
@@ -320,6 +320,8 @@ CONFIG_SND_SOC_WM8960=y
 CONFIG_SND_SOC_WM8962=y
 CONFIG_SND_SIMPLE_CARD=y
 CONFIG_HID_MULTITOUCH=y
+CONFIG_HID_WACOM=y
+CONFIG_I2C_HID_OF=y
 CONFIG_USB=y
 CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
 CONFIG_USB_EHCI_HCD=y
-- 
2.31.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device
  2021-10-09 11:43 [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Alistair Francis
  2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
  2021-10-09 11:43 ` [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C Alistair Francis
@ 2021-10-09 11:43 ` Alistair Francis
  2021-10-10  8:24   ` kernel test robot
  2021-10-16 14:34 ` [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Rob Herring
       [not found] ` <CAF8JNh+OUzvAHA9tBrH2d_WxWPXRgiunhGO5KV4-fqVG+tUOyQ@mail.gmail.com>
  4 siblings, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-09 11:43 UTC (permalink / raw)
  To: dmitry.torokhov, shawnguo, s.hauer
  Cc: linux-imx, jikos, benjamin.tissoires, linux-input, devicetree,
	linux-kernel, linux-arm-kernel, alistair23, Alistair Francis

Signed-off-by: Alistair Francis <alistair@alistair23.me>
---
 arch/arm/boot/dts/imx7d-remarkable2.dts | 62 +++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/arch/arm/boot/dts/imx7d-remarkable2.dts b/arch/arm/boot/dts/imx7d-remarkable2.dts
index 89cbf13097a4..2099784d6515 100644
--- a/arch/arm/boot/dts/imx7d-remarkable2.dts
+++ b/arch/arm/boot/dts/imx7d-remarkable2.dts
@@ -34,6 +34,19 @@ reg_brcm: regulator-brcm {
 		startup-delay-us = <150>;
 	};
 
+	reg_digitizer: regulator-digitizer {
+		compatible = "regulator-fixed";
+		regulator-name = "VDD_3V3_DIGITIZER";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		pinctrl-names = "default", "sleep";
+		pinctrl-0 = <&pinctrl_digitizer_reg>;
+		pinctrl-1 = <&pinctrl_digitizer_reg>;
+		gpio = <&gpio1 6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		startup-delay-us = <100000>; /* 100 ms */
+	};
+
 	wifi_pwrseq: wifi_pwrseq {
 		compatible = "mmc-pwrseq-simple";
 		pinctrl-names = "default";
@@ -51,6 +64,29 @@ &clks {
 	assigned-clock-rates = <0>, <32768>;
 };
 
+&i2c1 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c1>;
+	status = "okay";
+
+	wacom_digitizer: digitizer@9 {
+		compatible = "hid-over-i2c";
+		reg = <0x09>;
+		hid-descr-addr = <0x01>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_wacom>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
+		flip-tilt-x;
+		flip-tilt-y;
+		flip-pos-x;
+		flip-pos-y;
+		flip-distance;
+		vdd-supply = <&reg_digitizer>;
+	};
+};
+
 &snvs_pwrkey {
 	status = "okay";
 };
@@ -117,6 +153,25 @@ &wdog1 {
 	fsl,ext-reset-output;
 };
 
+&iomuxc_lpsr {
+	pinctrl_digitizer_reg: digitizerreggrp {
+		fsl,pins = <
+			/* DIGITIZER_PWR_EN */
+			MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x14
+		>;
+	};
+
+	pinctrl_wacom: wacomgrp {
+		fsl,pins = <
+			/*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x00000014 /* FWE */
+			MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x00000074 /* PDCTB */
+			MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1	0x00000034 /* WACOM INT */
+			/*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x00000014 /* WACOM PWR ENABLE */
+			/*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x00000074 /* WACOM RESET */
+		>;
+	};
+};
+
 &iomuxc {
 	pinctrl_brcm_reg: brcmreggrp {
 		fsl,pins = <
@@ -125,6 +180,13 @@ MX7D_PAD_SAI1_TX_BCLK__GPIO6_IO13	0x14
 		>;
 	};
 
+	pinctrl_i2c1: i2c1grp {
+		fsl,pins = <
+			MX7D_PAD_I2C1_SDA__I2C1_SDA		0x4000007f
+			MX7D_PAD_I2C1_SCL__I2C1_SCL		0x4000007f
+		>;
+	};
+
 	pinctrl_uart1: uart1grp {
 		fsl,pins = <
 			MX7D_PAD_UART1_TX_DATA__UART1_DCE_TX	0x79
-- 
2.31.1


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device
  2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
@ 2021-10-09 13:41   ` kernel test robot
  2021-10-09 14:32   ` kernel test robot
  1 sibling, 0 replies; 22+ messages in thread
From: kernel test robot @ 2021-10-09 13:41 UTC (permalink / raw)
  To: Alistair Francis, dmitry.torokhov, shawnguo, s.hauer
  Cc: llvm, kbuild-all, linux-imx, jikos, benjamin.tissoires,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 42452 bytes --]

Hi Alistair,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hid/for-next]
[also build test ERROR on robh/for-next shawnguo/for-next linus/master v5.15-rc4 next-20211008]
[cannot apply to dtor-input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: i386-randconfig-r015-20211009 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 30caca39f401ae17927439c0a0bd6d1b1916dd6a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/b41e12004527538eaeaa1fd929a751c9504a32a0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
        git checkout b41e12004527538eaeaa1fd929a751c9504a32a0
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/hid/wacom_wac.c:4900:4: error: use of undeclared identifier 'USB_VENDOR_ID_I2C_WACOM'
           { I2C_AG14_DEVICE_WACOM(0x95) },
             ^
   drivers/hid/wacom_wac.c:4836:39: note: expanded from macro 'I2C_AG14_DEVICE_WACOM'
           HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_I2C_WACOM, prod),\
                                                ^
>> drivers/hid/wacom_wac.c:5010:1: error: definition of variable with array type needs an explicit size or an initializer
   MODULE_DEVICE_TABLE(hid, wacom_ids);
   ^
   include/linux/module.h:244:21: note: expanded from macro 'MODULE_DEVICE_TABLE'
   extern typeof(name) __mod_##type##__##name##_device_table               \
                       ^
   <scratch space>:160:1: note: expanded from here
   __mod_hid__wacom_ids_device_table
   ^
   2 errors generated.


vim +/USB_VENDOR_ID_I2C_WACOM +4900 drivers/hid/wacom_wac.c

  4275	
  4276	static const struct wacom_features wacom_features_0x00 =
  4277		{ "Wacom Penpartner", 5040, 3780, 255, 0,
  4278		  PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  4279	static const struct wacom_features wacom_features_0x10 =
  4280		{ "Wacom Graphire", 10206, 7422, 511, 63,
  4281		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4282	static const struct wacom_features wacom_features_0x81 =
  4283		{ "Wacom Graphire BT", 16704, 12064, 511, 32,
  4284		  GRAPHIRE_BT, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES, 2 };
  4285	static const struct wacom_features wacom_features_0x11 =
  4286		{ "Wacom Graphire2 4x5", 10206, 7422, 511, 63,
  4287		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4288	static const struct wacom_features wacom_features_0x12 =
  4289		{ "Wacom Graphire2 5x7", 13918, 10206, 511, 63,
  4290		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4291	static const struct wacom_features wacom_features_0x13 =
  4292		{ "Wacom Graphire3", 10208, 7424, 511, 63,
  4293		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4294	static const struct wacom_features wacom_features_0x14 =
  4295		{ "Wacom Graphire3 6x8", 16704, 12064, 511, 63,
  4296		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4297	static const struct wacom_features wacom_features_0x15 =
  4298		{ "Wacom Graphire4 4x5", 10208, 7424, 511, 63,
  4299		  WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4300	static const struct wacom_features wacom_features_0x16 =
  4301		{ "Wacom Graphire4 6x8", 16704, 12064, 511, 63,
  4302		  WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4303	static const struct wacom_features wacom_features_0x17 =
  4304		{ "Wacom BambooFun 4x5", 14760, 9225, 511, 63,
  4305		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4306	static const struct wacom_features wacom_features_0x18 =
  4307		{ "Wacom BambooFun 6x8", 21648, 13530, 511, 63,
  4308		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4309	static const struct wacom_features wacom_features_0x19 =
  4310		{ "Wacom Bamboo1 Medium", 16704, 12064, 511, 63,
  4311		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4312	static const struct wacom_features wacom_features_0x60 =
  4313		{ "Wacom Volito", 5104, 3712, 511, 63,
  4314		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4315	static const struct wacom_features wacom_features_0x61 =
  4316		{ "Wacom PenStation2", 3250, 2320, 255, 63,
  4317		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4318	static const struct wacom_features wacom_features_0x62 =
  4319		{ "Wacom Volito2 4x5", 5104, 3712, 511, 63,
  4320		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4321	static const struct wacom_features wacom_features_0x63 =
  4322		{ "Wacom Volito2 2x3", 3248, 2320, 511, 63,
  4323		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4324	static const struct wacom_features wacom_features_0x64 =
  4325		{ "Wacom PenPartner2", 3250, 2320, 511, 63,
  4326		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4327	static const struct wacom_features wacom_features_0x65 =
  4328		{ "Wacom Bamboo", 14760, 9225, 511, 63,
  4329		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4330	static const struct wacom_features wacom_features_0x69 =
  4331		{ "Wacom Bamboo1", 5104, 3712, 511, 63,
  4332		  GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  4333	static const struct wacom_features wacom_features_0x6A =
  4334		{ "Wacom Bamboo1 4x6", 14760, 9225, 1023, 63,
  4335		  GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4336	static const struct wacom_features wacom_features_0x6B =
  4337		{ "Wacom Bamboo1 5x8", 21648, 13530, 1023, 63,
  4338		  GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4339	static const struct wacom_features wacom_features_0x20 =
  4340		{ "Wacom Intuos 4x5", 12700, 10600, 1023, 31,
  4341		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4342	static const struct wacom_features wacom_features_0x21 =
  4343		{ "Wacom Intuos 6x8", 20320, 16240, 1023, 31,
  4344		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4345	static const struct wacom_features wacom_features_0x22 =
  4346		{ "Wacom Intuos 9x12", 30480, 24060, 1023, 31,
  4347		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4348	static const struct wacom_features wacom_features_0x23 =
  4349		{ "Wacom Intuos 12x12", 30480, 31680, 1023, 31,
  4350		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4351	static const struct wacom_features wacom_features_0x24 =
  4352		{ "Wacom Intuos 12x18", 45720, 31680, 1023, 31,
  4353		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4354	static const struct wacom_features wacom_features_0x30 =
  4355		{ "Wacom PL400", 5408, 4056, 255, 0,
  4356		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4357	static const struct wacom_features wacom_features_0x31 =
  4358		{ "Wacom PL500", 6144, 4608, 255, 0,
  4359		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4360	static const struct wacom_features wacom_features_0x32 =
  4361		{ "Wacom PL600", 6126, 4604, 255, 0,
  4362		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4363	static const struct wacom_features wacom_features_0x33 =
  4364		{ "Wacom PL600SX", 6260, 5016, 255, 0,
  4365		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4366	static const struct wacom_features wacom_features_0x34 =
  4367		{ "Wacom PL550", 6144, 4608, 511, 0,
  4368		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4369	static const struct wacom_features wacom_features_0x35 =
  4370		{ "Wacom PL800", 7220, 5780, 511, 0,
  4371		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4372	static const struct wacom_features wacom_features_0x37 =
  4373		{ "Wacom PL700", 6758, 5406, 511, 0,
  4374		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4375	static const struct wacom_features wacom_features_0x38 =
  4376		{ "Wacom PL510", 6282, 4762, 511, 0,
  4377		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4378	static const struct wacom_features wacom_features_0x39 =
  4379		{ "Wacom DTU710", 34080, 27660, 511, 0,
  4380		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4381	static const struct wacom_features wacom_features_0xC4 =
  4382		{ "Wacom DTF521", 6282, 4762, 511, 0,
  4383		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4384	static const struct wacom_features wacom_features_0xC0 =
  4385		{ "Wacom DTF720", 6858, 5506, 511, 0,
  4386		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4387	static const struct wacom_features wacom_features_0xC2 =
  4388		{ "Wacom DTF720a", 6858, 5506, 511, 0,
  4389		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4390	static const struct wacom_features wacom_features_0x03 =
  4391		{ "Wacom Cintiq Partner", 20480, 15360, 511, 0,
  4392		  PTU, WACOM_PL_RES, WACOM_PL_RES };
  4393	static const struct wacom_features wacom_features_0x41 =
  4394		{ "Wacom Intuos2 4x5", 12700, 10600, 1023, 31,
  4395		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4396	static const struct wacom_features wacom_features_0x42 =
  4397		{ "Wacom Intuos2 6x8", 20320, 16240, 1023, 31,
  4398		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4399	static const struct wacom_features wacom_features_0x43 =
  4400		{ "Wacom Intuos2 9x12", 30480, 24060, 1023, 31,
  4401		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4402	static const struct wacom_features wacom_features_0x44 =
  4403		{ "Wacom Intuos2 12x12", 30480, 31680, 1023, 31,
  4404		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4405	static const struct wacom_features wacom_features_0x45 =
  4406		{ "Wacom Intuos2 12x18", 45720, 31680, 1023, 31,
  4407		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4408	static const struct wacom_features wacom_features_0xB0 =
  4409		{ "Wacom Intuos3 4x5", 25400, 20320, 1023, 63,
  4410		  INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 4 };
  4411	static const struct wacom_features wacom_features_0xB1 =
  4412		{ "Wacom Intuos3 6x8", 40640, 30480, 1023, 63,
  4413		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4414	static const struct wacom_features wacom_features_0xB2 =
  4415		{ "Wacom Intuos3 9x12", 60960, 45720, 1023, 63,
  4416		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4417	static const struct wacom_features wacom_features_0xB3 =
  4418		{ "Wacom Intuos3 12x12", 60960, 60960, 1023, 63,
  4419		  INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4420	static const struct wacom_features wacom_features_0xB4 =
  4421		{ "Wacom Intuos3 12x19", 97536, 60960, 1023, 63,
  4422		  INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4423	static const struct wacom_features wacom_features_0xB5 =
  4424		{ "Wacom Intuos3 6x11", 54204, 31750, 1023, 63,
  4425		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4426	static const struct wacom_features wacom_features_0xB7 =
  4427		{ "Wacom Intuos3 4x6", 31496, 19685, 1023, 63,
  4428		  INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 4 };
  4429	static const struct wacom_features wacom_features_0xB8 =
  4430		{ "Wacom Intuos4 4x6", 31496, 19685, 2047, 63,
  4431		  INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7 };
  4432	static const struct wacom_features wacom_features_0xB9 =
  4433		{ "Wacom Intuos4 6x9", 44704, 27940, 2047, 63,
  4434		  INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4435	static const struct wacom_features wacom_features_0xBA =
  4436		{ "Wacom Intuos4 8x13", 65024, 40640, 2047, 63,
  4437		  INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4438	static const struct wacom_features wacom_features_0xBB =
  4439		{ "Wacom Intuos4 12x19", 97536, 60960, 2047, 63,
  4440		  INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4441	static const struct wacom_features wacom_features_0xBC =
  4442		{ "Wacom Intuos4 WL", 40640, 25400, 2047, 63,
  4443		  INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4444	static const struct wacom_features wacom_features_0xBD =
  4445		{ "Wacom Intuos4 WL", 40640, 25400, 2047, 63,
  4446		  INTUOS4WL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4447	static const struct wacom_features wacom_features_0x26 =
  4448		{ "Wacom Intuos5 touch S", 31496, 19685, 2047, 63,
  4449		  INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 16 };
  4450	static const struct wacom_features wacom_features_0x27 =
  4451		{ "Wacom Intuos5 touch M", 44704, 27940, 2047, 63,
  4452		  INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16 };
  4453	static const struct wacom_features wacom_features_0x28 =
  4454		{ "Wacom Intuos5 touch L", 65024, 40640, 2047, 63,
  4455		  INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16 };
  4456	static const struct wacom_features wacom_features_0x29 =
  4457		{ "Wacom Intuos5 S", 31496, 19685, 2047, 63,
  4458		  INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7 };
  4459	static const struct wacom_features wacom_features_0x2A =
  4460		{ "Wacom Intuos5 M", 44704, 27940, 2047, 63,
  4461		  INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4462	static const struct wacom_features wacom_features_0x314 =
  4463		{ "Wacom Intuos Pro S", 31496, 19685, 2047, 63,
  4464		  INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 16,
  4465		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4466	static const struct wacom_features wacom_features_0x315 =
  4467		{ "Wacom Intuos Pro M", 44704, 27940, 2047, 63,
  4468		  INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16,
  4469		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4470	static const struct wacom_features wacom_features_0x317 =
  4471		{ "Wacom Intuos Pro L", 65024, 40640, 2047, 63,
  4472		  INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16,
  4473		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4474	static const struct wacom_features wacom_features_0xF4 =
  4475		{ "Wacom Cintiq 24HD", 104480, 65600, 2047, 63,
  4476		  WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 16,
  4477		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4478		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4479	static const struct wacom_features wacom_features_0xF8 =
  4480		{ "Wacom Cintiq 24HD touch", 104480, 65600, 2047, 63, /* Pen */
  4481		  WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 16,
  4482		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4483		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4484		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
  4485	static const struct wacom_features wacom_features_0xF6 =
  4486		{ "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
  4487		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10,
  4488		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4489	static const struct wacom_features wacom_features_0x32A =
  4490		{ "Wacom Cintiq 27QHD", 120140, 67920, 2047, 63,
  4491		  WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
  4492		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4493		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4494	static const struct wacom_features wacom_features_0x32B =
  4495		{ "Wacom Cintiq 27QHD touch", 120140, 67920, 2047, 63,
  4496		  WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
  4497		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4498		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4499		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32C };
  4500	static const struct wacom_features wacom_features_0x32C =
  4501		{ "Wacom Cintiq 27QHD touch", .type = WACOM_27QHDT,
  4502		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32B, .touch_max = 10 };
  4503	static const struct wacom_features wacom_features_0x3F =
  4504		{ "Wacom Cintiq 21UX", 87200, 65600, 1023, 63,
  4505		  CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4506	static const struct wacom_features wacom_features_0xC5 =
  4507		{ "Wacom Cintiq 20WSX", 86680, 54180, 1023, 63,
  4508		  WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 10 };
  4509	static const struct wacom_features wacom_features_0xC6 =
  4510		{ "Wacom Cintiq 12WX", 53020, 33440, 1023, 63,
  4511		  WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 10 };
  4512	static const struct wacom_features wacom_features_0x304 =
  4513		{ "Wacom Cintiq 13HD", 59552, 33848, 1023, 63,
  4514		  WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4515		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4516		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4517	static const struct wacom_features wacom_features_0x333 =
  4518		{ "Wacom Cintiq 13HD touch", 59552, 33848, 2047, 63,
  4519		  WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4520		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4521		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4522		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x335 };
  4523	static const struct wacom_features wacom_features_0x335 =
  4524		{ "Wacom Cintiq 13HD touch", .type = WACOM_24HDT, /* Touch */
  4525		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x333, .touch_max = 10,
  4526		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4527	static const struct wacom_features wacom_features_0xC7 =
  4528		{ "Wacom DTU1931", 37832, 30305, 511, 0,
  4529		  PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4530	static const struct wacom_features wacom_features_0xCE =
  4531		{ "Wacom DTU2231", 47864, 27011, 511, 0,
  4532		  DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4533		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBMOUSE };
  4534	static const struct wacom_features wacom_features_0xF0 =
  4535		{ "Wacom DTU1631", 34623, 19553, 511, 0,
  4536		  DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4537	static const struct wacom_features wacom_features_0xFB =
  4538		{ "Wacom DTU1031", 22096, 13960, 511, 0,
  4539		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4540		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4541		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4542	static const struct wacom_features wacom_features_0x32F =
  4543		{ "Wacom DTU1031X", 22672, 12928, 511, 0,
  4544		  DTUSX, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 0,
  4545		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4546		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4547	static const struct wacom_features wacom_features_0x336 =
  4548		{ "Wacom DTU1141", 23672, 13403, 1023, 0,
  4549		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4550		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4551		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4552	static const struct wacom_features wacom_features_0x57 =
  4553		{ "Wacom DTK2241", 95840, 54260, 2047, 63,
  4554		  DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 6,
  4555		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4556		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4557	static const struct wacom_features wacom_features_0x59 = /* Pen */
  4558		{ "Wacom DTH2242", 95840, 54260, 2047, 63,
  4559		  DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 6,
  4560		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4561		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4562		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5D };
  4563	static const struct wacom_features wacom_features_0x5D = /* Touch */
  4564		{ "Wacom DTH2242",       .type = WACOM_24HDT,
  4565		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x59, .touch_max = 10,
  4566		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4567	static const struct wacom_features wacom_features_0xCC =
  4568		{ "Wacom Cintiq 21UX2", 87200, 65600, 2047, 63,
  4569		  WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4570		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4571		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4572	static const struct wacom_features wacom_features_0xFA =
  4573		{ "Wacom Cintiq 22HD", 95840, 54260, 2047, 63,
  4574		  WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4575		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4576		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4577	static const struct wacom_features wacom_features_0x5B =
  4578		{ "Wacom Cintiq 22HDT", 95840, 54260, 2047, 63,
  4579		  WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4580		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4581		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4582		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e };
  4583	static const struct wacom_features wacom_features_0x5E =
  4584		{ "Wacom Cintiq 22HDT", .type = WACOM_24HDT,
  4585		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10,
  4586		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4587	static const struct wacom_features wacom_features_0x90 =
  4588		{ "Wacom ISDv4 90", 26202, 16325, 255, 0,
  4589		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4590	static const struct wacom_features wacom_features_0x93 =
  4591		{ "Wacom ISDv4 93", 26202, 16325, 255, 0,
  4592		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4593	static const struct wacom_features wacom_features_0x97 =
  4594		{ "Wacom ISDv4 97", 26202, 16325, 511, 0,
  4595		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4596	static const struct wacom_features wacom_features_0x9A =
  4597		{ "Wacom ISDv4 9A", 26202, 16325, 255, 0,
  4598		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4599	static const struct wacom_features wacom_features_0x9F =
  4600		{ "Wacom ISDv4 9F", 26202, 16325, 255, 0,
  4601		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4602	static const struct wacom_features wacom_features_0xE2 =
  4603		{ "Wacom ISDv4 E2", 26202, 16325, 255, 0,
  4604		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4605	static const struct wacom_features wacom_features_0xE3 =
  4606		{ "Wacom ISDv4 E3", 26202, 16325, 255, 0,
  4607		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4608	static const struct wacom_features wacom_features_0xE5 =
  4609		{ "Wacom ISDv4 E5", 26202, 16325, 255, 0,
  4610		  MTSCREEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4611	static const struct wacom_features wacom_features_0xE6 =
  4612		{ "Wacom ISDv4 E6", 27760, 15694, 255, 0,
  4613		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4614	static const struct wacom_features wacom_features_0xEC =
  4615		{ "Wacom ISDv4 EC", 25710, 14500, 255, 0,
  4616		  TABLETPC,    WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4617	static const struct wacom_features wacom_features_0xED =
  4618		{ "Wacom ISDv4 ED", 26202, 16325, 255, 0,
  4619		  TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4620	static const struct wacom_features wacom_features_0xEF =
  4621		{ "Wacom ISDv4 EF", 26202, 16325, 255, 0,
  4622		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4623	static const struct wacom_features wacom_features_0x100 =
  4624		{ "Wacom ISDv4 100", 26202, 16325, 255, 0,
  4625		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4626	static const struct wacom_features wacom_features_0x101 =
  4627		{ "Wacom ISDv4 101", 26202, 16325, 255, 0,
  4628		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4629	static const struct wacom_features wacom_features_0x10D =
  4630		{ "Wacom ISDv4 10D", 26202, 16325, 255, 0,
  4631		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4632	static const struct wacom_features wacom_features_0x10E =
  4633		{ "Wacom ISDv4 10E", 27760, 15694, 255, 0,
  4634		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4635	static const struct wacom_features wacom_features_0x10F =
  4636		{ "Wacom ISDv4 10F", 27760, 15694, 255, 0,
  4637		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4638	static const struct wacom_features wacom_features_0x116 =
  4639		{ "Wacom ISDv4 116", 26202, 16325, 255, 0,
  4640		  TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4641	static const struct wacom_features wacom_features_0x12C =
  4642		{ "Wacom ISDv4 12C", 27848, 15752, 2047, 0,
  4643		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4644	static const struct wacom_features wacom_features_0x4001 =
  4645		{ "Wacom ISDv4 4001", 26202, 16325, 255, 0,
  4646		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4647	static const struct wacom_features wacom_features_0x4004 =
  4648		{ "Wacom ISDv4 4004", 11060, 6220, 255, 0,
  4649		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4650	static const struct wacom_features wacom_features_0x5000 =
  4651		{ "Wacom ISDv4 5000", 27848, 15752, 1023, 0,
  4652		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4653	static const struct wacom_features wacom_features_0x5002 =
  4654		{ "Wacom ISDv4 5002", 29576, 16724, 1023, 0,
  4655		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4656	static const struct wacom_features wacom_features_0x47 =
  4657		{ "Wacom Intuos2 6x8", 20320, 16240, 1023, 31,
  4658		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4659	static const struct wacom_features wacom_features_0x84 =
  4660		{ "Wacom Wireless Receiver", .type = WIRELESS, .touch_max = 16 };
  4661	static const struct wacom_features wacom_features_0xD0 =
  4662		{ "Wacom Bamboo 2FG", 14720, 9200, 1023, 31,
  4663		  BAMBOO_TOUCH, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4664	static const struct wacom_features wacom_features_0xD1 =
  4665		{ "Wacom Bamboo 2FG 4x5", 14720, 9200, 1023, 31,
  4666		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4667	static const struct wacom_features wacom_features_0xD2 =
  4668		{ "Wacom Bamboo Craft", 14720, 9200, 1023, 31,
  4669		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4670	static const struct wacom_features wacom_features_0xD3 =
  4671		{ "Wacom Bamboo 2FG 6x8", 21648, 13700, 1023, 31,
  4672		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4673	static const struct wacom_features wacom_features_0xD4 =
  4674		{ "Wacom Bamboo Pen", 14720, 9200, 1023, 31,
  4675		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4676	static const struct wacom_features wacom_features_0xD5 =
  4677		{ "Wacom Bamboo Pen 6x8", 21648, 13700, 1023, 31,
  4678		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4679	static const struct wacom_features wacom_features_0xD6 =
  4680		{ "Wacom BambooPT 2FG 4x5", 14720, 9200, 1023, 31,
  4681		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4682	static const struct wacom_features wacom_features_0xD7 =
  4683		{ "Wacom BambooPT 2FG Small", 14720, 9200, 1023, 31,
  4684		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4685	static const struct wacom_features wacom_features_0xD8 =
  4686		{ "Wacom Bamboo Comic 2FG", 21648, 13700, 1023, 31,
  4687		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4688	static const struct wacom_features wacom_features_0xDA =
  4689		{ "Wacom Bamboo 2FG 4x5 SE", 14720, 9200, 1023, 31,
  4690		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4691	static const struct wacom_features wacom_features_0xDB =
  4692		{ "Wacom Bamboo 2FG 6x8 SE", 21648, 13700, 1023, 31,
  4693		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4694	static const struct wacom_features wacom_features_0xDD =
  4695	        { "Wacom Bamboo Connect", 14720, 9200, 1023, 31,
  4696	          BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4697	static const struct wacom_features wacom_features_0xDE =
  4698	        { "Wacom Bamboo 16FG 4x5", 14720, 9200, 1023, 31,
  4699		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 };
  4700	static const struct wacom_features wacom_features_0xDF =
  4701	        { "Wacom Bamboo 16FG 6x8", 21648, 13700, 1023, 31,
  4702		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 };
  4703	static const struct wacom_features wacom_features_0x300 =
  4704		{ "Wacom Bamboo One S", 14720, 9225, 1023, 31,
  4705		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4706	static const struct wacom_features wacom_features_0x301 =
  4707		{ "Wacom Bamboo One M", 21648, 13530, 1023, 31,
  4708		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4709	static const struct wacom_features wacom_features_0x302 =
  4710		{ "Wacom Intuos PT S", 15200, 9500, 1023, 31,
  4711		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4712		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4713	static const struct wacom_features wacom_features_0x303 =
  4714		{ "Wacom Intuos PT M", 21600, 13500, 1023, 31,
  4715		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4716		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4717	static const struct wacom_features wacom_features_0x30E =
  4718		{ "Wacom Intuos S", 15200, 9500, 1023, 31,
  4719		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4720		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4721	static const struct wacom_features wacom_features_0x6004 =
  4722		{ "ISD-V4", 12800, 8000, 255, 0,
  4723		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4724	static const struct wacom_features wacom_features_0x307 =
  4725		{ "Wacom ISDv5 307", 59552, 33848, 2047, 63,
  4726		  CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4727		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4728		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4729		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
  4730	static const struct wacom_features wacom_features_0x309 =
  4731		{ "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
  4732		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10,
  4733		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4734	static const struct wacom_features wacom_features_0x30A =
  4735		{ "Wacom ISDv5 30A", 59552, 33848, 2047, 63,
  4736		  CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4737		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4738		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4739		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30C };
  4740	static const struct wacom_features wacom_features_0x30C =
  4741		{ "Wacom ISDv5 30C", .type = WACOM_24HDT, /* Touch */
  4742		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30A, .touch_max = 10,
  4743		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4744	static const struct wacom_features wacom_features_0x318 =
  4745		{ "Wacom USB Bamboo PAD", 4095, 4095, /* Touch */
  4746		  .type = BAMBOO_PAD, 35, 48, .touch_max = 4 };
  4747	static const struct wacom_features wacom_features_0x319 =
  4748		{ "Wacom Wireless Bamboo PAD", 4095, 4095, /* Touch */
  4749		  .type = BAMBOO_PAD, 35, 48, .touch_max = 4 };
  4750	static const struct wacom_features wacom_features_0x325 =
  4751		{ "Wacom ISDv5 325", 59552, 33848, 2047, 63,
  4752		  CINTIQ_COMPANION_2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11,
  4753		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4754		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4755		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x326 };
  4756	static const struct wacom_features wacom_features_0x326 = /* Touch */
  4757		{ "Wacom ISDv5 326", .type = HID_GENERIC, .oVid = USB_VENDOR_ID_WACOM,
  4758		  .oPid = 0x325 };
  4759	static const struct wacom_features wacom_features_0x323 =
  4760		{ "Wacom Intuos P M", 21600, 13500, 1023, 31,
  4761		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4762		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4763	static const struct wacom_features wacom_features_0x331 =
  4764		{ "Wacom Express Key Remote", .type = REMOTE,
  4765		  .numbered_buttons = 18, .check_for_hid_type = true,
  4766		  .hid_type = HID_TYPE_USBNONE };
  4767	static const struct wacom_features wacom_features_0x33B =
  4768		{ "Wacom Intuos S 2", 15200, 9500, 2047, 63,
  4769		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4770		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4771	static const struct wacom_features wacom_features_0x33C =
  4772		{ "Wacom Intuos PT S 2", 15200, 9500, 2047, 63,
  4773		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4774		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4775	static const struct wacom_features wacom_features_0x33D =
  4776		{ "Wacom Intuos P M 2", 21600, 13500, 2047, 63,
  4777		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4778		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4779	static const struct wacom_features wacom_features_0x33E =
  4780		{ "Wacom Intuos PT M 2", 21600, 13500, 2047, 63,
  4781		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4782		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4783	static const struct wacom_features wacom_features_0x343 =
  4784		{ "Wacom DTK1651", 34816, 19759, 1023, 0,
  4785		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4786		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4787		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4788	static const struct wacom_features wacom_features_0x360 =
  4789		{ "Wacom Intuos Pro M", 44800, 29600, 8191, 63,
  4790		  INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
  4791	static const struct wacom_features wacom_features_0x361 =
  4792		{ "Wacom Intuos Pro L", 62200, 43200, 8191, 63,
  4793		  INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
  4794	static const struct wacom_features wacom_features_0x377 =
  4795		{ "Wacom Intuos BT S", 15200, 9500, 4095, 63,
  4796		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4797	static const struct wacom_features wacom_features_0x379 =
  4798		{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
  4799		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4800	static const struct wacom_features wacom_features_0x37A =
  4801		{ "Wacom One by Wacom S", 15200, 9500, 2047, 63,
  4802		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4803	static const struct wacom_features wacom_features_0x37B =
  4804		{ "Wacom One by Wacom M", 21600, 13500, 2047, 63,
  4805		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4806	static const struct wacom_features wacom_features_0x393 =
  4807		{ "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
  4808		  INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
  4809		  .touch_max = 10 };
  4810	static const struct wacom_features wacom_features_0x3c6 =
  4811		{ "Wacom Intuos BT S", 15200, 9500, 4095, 63,
  4812		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4813	static const struct wacom_features wacom_features_0x3c8 =
  4814		{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
  4815		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4816	
  4817	static const struct wacom_features wacom_features_0x95 =
  4818		{ "Wacom AG14", .type = HID_GENERIC, .oVid = 0x2D1F, .oPid = 149 };
  4819	
  4820	static const struct wacom_features wacom_features_HID_ANY_ID =
  4821		{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
  4822	
  4823	#define USB_DEVICE_WACOM(prod)						\
  4824		HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4825		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4826	
  4827	#define BT_DEVICE_WACOM(prod)						\
  4828		HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4829		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4830	
  4831	#define I2C_DEVICE_WACOM(prod)						\
  4832		HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4833		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4834	
  4835	#define I2C_AG14_DEVICE_WACOM(prod)					    \
  4836		HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_I2C_WACOM, prod),\
  4837		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4838	
  4839	#define USB_DEVICE_LENOVO(prod)					\
  4840		HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, prod),			\
  4841		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4842	
  4843	const struct hid_device_id wacom_ids[] = {
  4844		{ USB_DEVICE_WACOM(0x00) },
  4845		{ USB_DEVICE_WACOM(0x03) },
  4846		{ USB_DEVICE_WACOM(0x10) },
  4847		{ USB_DEVICE_WACOM(0x11) },
  4848		{ USB_DEVICE_WACOM(0x12) },
  4849		{ USB_DEVICE_WACOM(0x13) },
  4850		{ USB_DEVICE_WACOM(0x14) },
  4851		{ USB_DEVICE_WACOM(0x15) },
  4852		{ USB_DEVICE_WACOM(0x16) },
  4853		{ USB_DEVICE_WACOM(0x17) },
  4854		{ USB_DEVICE_WACOM(0x18) },
  4855		{ USB_DEVICE_WACOM(0x19) },
  4856		{ USB_DEVICE_WACOM(0x20) },
  4857		{ USB_DEVICE_WACOM(0x21) },
  4858		{ USB_DEVICE_WACOM(0x22) },
  4859		{ USB_DEVICE_WACOM(0x23) },
  4860		{ USB_DEVICE_WACOM(0x24) },
  4861		{ USB_DEVICE_WACOM(0x26) },
  4862		{ USB_DEVICE_WACOM(0x27) },
  4863		{ USB_DEVICE_WACOM(0x28) },
  4864		{ USB_DEVICE_WACOM(0x29) },
  4865		{ USB_DEVICE_WACOM(0x2A) },
  4866		{ USB_DEVICE_WACOM(0x30) },
  4867		{ USB_DEVICE_WACOM(0x31) },
  4868		{ USB_DEVICE_WACOM(0x32) },
  4869		{ USB_DEVICE_WACOM(0x33) },
  4870		{ USB_DEVICE_WACOM(0x34) },
  4871		{ USB_DEVICE_WACOM(0x35) },
  4872		{ USB_DEVICE_WACOM(0x37) },
  4873		{ USB_DEVICE_WACOM(0x38) },
  4874		{ USB_DEVICE_WACOM(0x39) },
  4875		{ USB_DEVICE_WACOM(0x3F) },
  4876		{ USB_DEVICE_WACOM(0x41) },
  4877		{ USB_DEVICE_WACOM(0x42) },
  4878		{ USB_DEVICE_WACOM(0x43) },
  4879		{ USB_DEVICE_WACOM(0x44) },
  4880		{ USB_DEVICE_WACOM(0x45) },
  4881		{ USB_DEVICE_WACOM(0x47) },
  4882		{ USB_DEVICE_WACOM(0x57) },
  4883		{ USB_DEVICE_WACOM(0x59) },
  4884		{ USB_DEVICE_WACOM(0x5B) },
  4885		{ USB_DEVICE_WACOM(0x5D) },
  4886		{ USB_DEVICE_WACOM(0x5E) },
  4887		{ USB_DEVICE_WACOM(0x60) },
  4888		{ USB_DEVICE_WACOM(0x61) },
  4889		{ USB_DEVICE_WACOM(0x62) },
  4890		{ USB_DEVICE_WACOM(0x63) },
  4891		{ USB_DEVICE_WACOM(0x64) },
  4892		{ USB_DEVICE_WACOM(0x65) },
  4893		{ USB_DEVICE_WACOM(0x69) },
  4894		{ USB_DEVICE_WACOM(0x6A) },
  4895		{ USB_DEVICE_WACOM(0x6B) },
  4896		{ BT_DEVICE_WACOM(0x81) },
  4897		{ USB_DEVICE_WACOM(0x84) },
  4898		{ USB_DEVICE_WACOM(0x90) },
  4899		{ USB_DEVICE_WACOM(0x93) },
> 4900		{ I2C_AG14_DEVICE_WACOM(0x95) },
  4901		{ USB_DEVICE_WACOM(0x97) },
  4902		{ USB_DEVICE_WACOM(0x9A) },
  4903		{ USB_DEVICE_WACOM(0x9F) },
  4904		{ USB_DEVICE_WACOM(0xB0) },
  4905		{ USB_DEVICE_WACOM(0xB1) },
  4906		{ USB_DEVICE_WACOM(0xB2) },
  4907		{ USB_DEVICE_WACOM(0xB3) },
  4908		{ USB_DEVICE_WACOM(0xB4) },
  4909		{ USB_DEVICE_WACOM(0xB5) },
  4910		{ USB_DEVICE_WACOM(0xB7) },
  4911		{ USB_DEVICE_WACOM(0xB8) },
  4912		{ USB_DEVICE_WACOM(0xB9) },
  4913		{ USB_DEVICE_WACOM(0xBA) },
  4914		{ USB_DEVICE_WACOM(0xBB) },
  4915		{ USB_DEVICE_WACOM(0xBC) },
  4916		{ BT_DEVICE_WACOM(0xBD) },
  4917		{ USB_DEVICE_WACOM(0xC0) },
  4918		{ USB_DEVICE_WACOM(0xC2) },
  4919		{ USB_DEVICE_WACOM(0xC4) },
  4920		{ USB_DEVICE_WACOM(0xC5) },
  4921		{ USB_DEVICE_WACOM(0xC6) },
  4922		{ USB_DEVICE_WACOM(0xC7) },
  4923		{ USB_DEVICE_WACOM(0xCC) },
  4924		{ USB_DEVICE_WACOM(0xCE) },
  4925		{ USB_DEVICE_WACOM(0xD0) },
  4926		{ USB_DEVICE_WACOM(0xD1) },
  4927		{ USB_DEVICE_WACOM(0xD2) },
  4928		{ USB_DEVICE_WACOM(0xD3) },
  4929		{ USB_DEVICE_WACOM(0xD4) },
  4930		{ USB_DEVICE_WACOM(0xD5) },
  4931		{ USB_DEVICE_WACOM(0xD6) },
  4932		{ USB_DEVICE_WACOM(0xD7) },
  4933		{ USB_DEVICE_WACOM(0xD8) },
  4934		{ USB_DEVICE_WACOM(0xDA) },
  4935		{ USB_DEVICE_WACOM(0xDB) },
  4936		{ USB_DEVICE_WACOM(0xDD) },
  4937		{ USB_DEVICE_WACOM(0xDE) },
  4938		{ USB_DEVICE_WACOM(0xDF) },
  4939		{ USB_DEVICE_WACOM(0xE2) },
  4940		{ USB_DEVICE_WACOM(0xE3) },
  4941		{ USB_DEVICE_WACOM(0xE5) },
  4942		{ USB_DEVICE_WACOM(0xE6) },
  4943		{ USB_DEVICE_WACOM(0xEC) },
  4944		{ USB_DEVICE_WACOM(0xED) },
  4945		{ USB_DEVICE_WACOM(0xEF) },
  4946		{ USB_DEVICE_WACOM(0xF0) },
  4947		{ USB_DEVICE_WACOM(0xF4) },
  4948		{ USB_DEVICE_WACOM(0xF6) },
  4949		{ USB_DEVICE_WACOM(0xF8) },
  4950		{ USB_DEVICE_WACOM(0xFA) },
  4951		{ USB_DEVICE_WACOM(0xFB) },
  4952		{ USB_DEVICE_WACOM(0x100) },
  4953		{ USB_DEVICE_WACOM(0x101) },
  4954		{ USB_DEVICE_WACOM(0x10D) },
  4955		{ USB_DEVICE_WACOM(0x10E) },
  4956		{ USB_DEVICE_WACOM(0x10F) },
  4957		{ USB_DEVICE_WACOM(0x116) },
  4958		{ USB_DEVICE_WACOM(0x12C) },
  4959		{ USB_DEVICE_WACOM(0x300) },
  4960		{ USB_DEVICE_WACOM(0x301) },
  4961		{ USB_DEVICE_WACOM(0x302) },
  4962		{ USB_DEVICE_WACOM(0x303) },
  4963		{ USB_DEVICE_WACOM(0x304) },
  4964		{ USB_DEVICE_WACOM(0x307) },
  4965		{ USB_DEVICE_WACOM(0x309) },
  4966		{ USB_DEVICE_WACOM(0x30A) },
  4967		{ USB_DEVICE_WACOM(0x30C) },
  4968		{ USB_DEVICE_WACOM(0x30E) },
  4969		{ USB_DEVICE_WACOM(0x314) },
  4970		{ USB_DEVICE_WACOM(0x315) },
  4971		{ USB_DEVICE_WACOM(0x317) },
  4972		{ USB_DEVICE_WACOM(0x318) },
  4973		{ USB_DEVICE_WACOM(0x319) },
  4974		{ USB_DEVICE_WACOM(0x323) },
  4975		{ USB_DEVICE_WACOM(0x325) },
  4976		{ USB_DEVICE_WACOM(0x326) },
  4977		{ USB_DEVICE_WACOM(0x32A) },
  4978		{ USB_DEVICE_WACOM(0x32B) },
  4979		{ USB_DEVICE_WACOM(0x32C) },
  4980		{ USB_DEVICE_WACOM(0x32F) },
  4981		{ USB_DEVICE_WACOM(0x331) },
  4982		{ USB_DEVICE_WACOM(0x333) },
  4983		{ USB_DEVICE_WACOM(0x335) },
  4984		{ USB_DEVICE_WACOM(0x336) },
  4985		{ USB_DEVICE_WACOM(0x33B) },
  4986		{ USB_DEVICE_WACOM(0x33C) },
  4987		{ USB_DEVICE_WACOM(0x33D) },
  4988		{ USB_DEVICE_WACOM(0x33E) },
  4989		{ USB_DEVICE_WACOM(0x343) },
  4990		{ BT_DEVICE_WACOM(0x360) },
  4991		{ BT_DEVICE_WACOM(0x361) },
  4992		{ BT_DEVICE_WACOM(0x377) },
  4993		{ BT_DEVICE_WACOM(0x379) },
  4994		{ USB_DEVICE_WACOM(0x37A) },
  4995		{ USB_DEVICE_WACOM(0x37B) },
  4996		{ BT_DEVICE_WACOM(0x393) },
  4997		{ BT_DEVICE_WACOM(0x3c6) },
  4998		{ BT_DEVICE_WACOM(0x3c8) },
  4999		{ USB_DEVICE_WACOM(0x4001) },
  5000		{ USB_DEVICE_WACOM(0x4004) },
  5001		{ USB_DEVICE_WACOM(0x5000) },
  5002		{ USB_DEVICE_WACOM(0x5002) },
  5003		{ USB_DEVICE_LENOVO(0x6004) },
  5004	
  5005		{ USB_DEVICE_WACOM(HID_ANY_ID) },
  5006		{ I2C_DEVICE_WACOM(HID_ANY_ID) },
  5007		{ BT_DEVICE_WACOM(HID_ANY_ID) },
  5008		{ }
  5009	};
> 5010	MODULE_DEVICE_TABLE(hid, wacom_ids);

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30140 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device
  2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
  2021-10-09 13:41   ` kernel test robot
@ 2021-10-09 14:32   ` kernel test robot
  1 sibling, 0 replies; 22+ messages in thread
From: kernel test robot @ 2021-10-09 14:32 UTC (permalink / raw)
  To: Alistair Francis, dmitry.torokhov, shawnguo, s.hauer
  Cc: kbuild-all, linux-imx, jikos, benjamin.tissoires, linux-input,
	devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 36097 bytes --]

Hi Alistair,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hid/for-next]
[also build test ERROR on robh/for-next shawnguo/for-next linus/master v5.15-rc4 next-20211008]
[cannot apply to dtor-input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: arm-randconfig-r016-20211009 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/b41e12004527538eaeaa1fd929a751c9504a32a0
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
        git checkout b41e12004527538eaeaa1fd929a751c9504a32a0
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/hid/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from drivers/hid/wacom_wac.h:9,
                    from drivers/hid/wacom_wac.c:11:
>> drivers/hid/wacom_wac.c:4836:46: error: 'USB_VENDOR_ID_I2C_WACOM' undeclared here (not in a function); did you mean 'USB_VENDOR_ID_WACOM'?
    4836 |         HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_I2C_WACOM, prod),\
         |                                              ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:680:46: note: in definition of macro 'HID_DEVICE'
     680 |         .bus = (b), .group = (g), .vendor = (ven), .product = (prod)
         |                                              ^~~
   drivers/hid/wacom_wac.c:4900:11: note: in expansion of macro 'I2C_AG14_DEVICE_WACOM'
    4900 |         { I2C_AG14_DEVICE_WACOM(0x95) },
         |           ^~~~~~~~~~~~~~~~~~~~~


vim +4836 drivers/hid/wacom_wac.c

  4275	
  4276	static const struct wacom_features wacom_features_0x00 =
  4277		{ "Wacom Penpartner", 5040, 3780, 255, 0,
  4278		  PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  4279	static const struct wacom_features wacom_features_0x10 =
  4280		{ "Wacom Graphire", 10206, 7422, 511, 63,
  4281		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4282	static const struct wacom_features wacom_features_0x81 =
  4283		{ "Wacom Graphire BT", 16704, 12064, 511, 32,
  4284		  GRAPHIRE_BT, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES, 2 };
  4285	static const struct wacom_features wacom_features_0x11 =
  4286		{ "Wacom Graphire2 4x5", 10206, 7422, 511, 63,
  4287		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4288	static const struct wacom_features wacom_features_0x12 =
  4289		{ "Wacom Graphire2 5x7", 13918, 10206, 511, 63,
  4290		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4291	static const struct wacom_features wacom_features_0x13 =
  4292		{ "Wacom Graphire3", 10208, 7424, 511, 63,
  4293		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4294	static const struct wacom_features wacom_features_0x14 =
  4295		{ "Wacom Graphire3 6x8", 16704, 12064, 511, 63,
  4296		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4297	static const struct wacom_features wacom_features_0x15 =
  4298		{ "Wacom Graphire4 4x5", 10208, 7424, 511, 63,
  4299		  WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4300	static const struct wacom_features wacom_features_0x16 =
  4301		{ "Wacom Graphire4 6x8", 16704, 12064, 511, 63,
  4302		  WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4303	static const struct wacom_features wacom_features_0x17 =
  4304		{ "Wacom BambooFun 4x5", 14760, 9225, 511, 63,
  4305		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4306	static const struct wacom_features wacom_features_0x18 =
  4307		{ "Wacom BambooFun 6x8", 21648, 13530, 511, 63,
  4308		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4309	static const struct wacom_features wacom_features_0x19 =
  4310		{ "Wacom Bamboo1 Medium", 16704, 12064, 511, 63,
  4311		  GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
  4312	static const struct wacom_features wacom_features_0x60 =
  4313		{ "Wacom Volito", 5104, 3712, 511, 63,
  4314		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4315	static const struct wacom_features wacom_features_0x61 =
  4316		{ "Wacom PenStation2", 3250, 2320, 255, 63,
  4317		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4318	static const struct wacom_features wacom_features_0x62 =
  4319		{ "Wacom Volito2 4x5", 5104, 3712, 511, 63,
  4320		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4321	static const struct wacom_features wacom_features_0x63 =
  4322		{ "Wacom Volito2 2x3", 3248, 2320, 511, 63,
  4323		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4324	static const struct wacom_features wacom_features_0x64 =
  4325		{ "Wacom PenPartner2", 3250, 2320, 511, 63,
  4326		  GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
  4327	static const struct wacom_features wacom_features_0x65 =
  4328		{ "Wacom Bamboo", 14760, 9225, 511, 63,
  4329		  WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4330	static const struct wacom_features wacom_features_0x69 =
  4331		{ "Wacom Bamboo1", 5104, 3712, 511, 63,
  4332		  GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
  4333	static const struct wacom_features wacom_features_0x6A =
  4334		{ "Wacom Bamboo1 4x6", 14760, 9225, 1023, 63,
  4335		  GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4336	static const struct wacom_features wacom_features_0x6B =
  4337		{ "Wacom Bamboo1 5x8", 21648, 13530, 1023, 63,
  4338		  GRAPHIRE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4339	static const struct wacom_features wacom_features_0x20 =
  4340		{ "Wacom Intuos 4x5", 12700, 10600, 1023, 31,
  4341		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4342	static const struct wacom_features wacom_features_0x21 =
  4343		{ "Wacom Intuos 6x8", 20320, 16240, 1023, 31,
  4344		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4345	static const struct wacom_features wacom_features_0x22 =
  4346		{ "Wacom Intuos 9x12", 30480, 24060, 1023, 31,
  4347		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4348	static const struct wacom_features wacom_features_0x23 =
  4349		{ "Wacom Intuos 12x12", 30480, 31680, 1023, 31,
  4350		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4351	static const struct wacom_features wacom_features_0x24 =
  4352		{ "Wacom Intuos 12x18", 45720, 31680, 1023, 31,
  4353		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4354	static const struct wacom_features wacom_features_0x30 =
  4355		{ "Wacom PL400", 5408, 4056, 255, 0,
  4356		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4357	static const struct wacom_features wacom_features_0x31 =
  4358		{ "Wacom PL500", 6144, 4608, 255, 0,
  4359		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4360	static const struct wacom_features wacom_features_0x32 =
  4361		{ "Wacom PL600", 6126, 4604, 255, 0,
  4362		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4363	static const struct wacom_features wacom_features_0x33 =
  4364		{ "Wacom PL600SX", 6260, 5016, 255, 0,
  4365		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4366	static const struct wacom_features wacom_features_0x34 =
  4367		{ "Wacom PL550", 6144, 4608, 511, 0,
  4368		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4369	static const struct wacom_features wacom_features_0x35 =
  4370		{ "Wacom PL800", 7220, 5780, 511, 0,
  4371		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4372	static const struct wacom_features wacom_features_0x37 =
  4373		{ "Wacom PL700", 6758, 5406, 511, 0,
  4374		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4375	static const struct wacom_features wacom_features_0x38 =
  4376		{ "Wacom PL510", 6282, 4762, 511, 0,
  4377		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4378	static const struct wacom_features wacom_features_0x39 =
  4379		{ "Wacom DTU710", 34080, 27660, 511, 0,
  4380		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4381	static const struct wacom_features wacom_features_0xC4 =
  4382		{ "Wacom DTF521", 6282, 4762, 511, 0,
  4383		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4384	static const struct wacom_features wacom_features_0xC0 =
  4385		{ "Wacom DTF720", 6858, 5506, 511, 0,
  4386		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4387	static const struct wacom_features wacom_features_0xC2 =
  4388		{ "Wacom DTF720a", 6858, 5506, 511, 0,
  4389		  PL, WACOM_PL_RES, WACOM_PL_RES };
  4390	static const struct wacom_features wacom_features_0x03 =
  4391		{ "Wacom Cintiq Partner", 20480, 15360, 511, 0,
  4392		  PTU, WACOM_PL_RES, WACOM_PL_RES };
  4393	static const struct wacom_features wacom_features_0x41 =
  4394		{ "Wacom Intuos2 4x5", 12700, 10600, 1023, 31,
  4395		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4396	static const struct wacom_features wacom_features_0x42 =
  4397		{ "Wacom Intuos2 6x8", 20320, 16240, 1023, 31,
  4398		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4399	static const struct wacom_features wacom_features_0x43 =
  4400		{ "Wacom Intuos2 9x12", 30480, 24060, 1023, 31,
  4401		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4402	static const struct wacom_features wacom_features_0x44 =
  4403		{ "Wacom Intuos2 12x12", 30480, 31680, 1023, 31,
  4404		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4405	static const struct wacom_features wacom_features_0x45 =
  4406		{ "Wacom Intuos2 12x18", 45720, 31680, 1023, 31,
  4407		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4408	static const struct wacom_features wacom_features_0xB0 =
  4409		{ "Wacom Intuos3 4x5", 25400, 20320, 1023, 63,
  4410		  INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 4 };
  4411	static const struct wacom_features wacom_features_0xB1 =
  4412		{ "Wacom Intuos3 6x8", 40640, 30480, 1023, 63,
  4413		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4414	static const struct wacom_features wacom_features_0xB2 =
  4415		{ "Wacom Intuos3 9x12", 60960, 45720, 1023, 63,
  4416		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4417	static const struct wacom_features wacom_features_0xB3 =
  4418		{ "Wacom Intuos3 12x12", 60960, 60960, 1023, 63,
  4419		  INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4420	static const struct wacom_features wacom_features_0xB4 =
  4421		{ "Wacom Intuos3 12x19", 97536, 60960, 1023, 63,
  4422		  INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4423	static const struct wacom_features wacom_features_0xB5 =
  4424		{ "Wacom Intuos3 6x11", 54204, 31750, 1023, 63,
  4425		  INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4426	static const struct wacom_features wacom_features_0xB7 =
  4427		{ "Wacom Intuos3 4x6", 31496, 19685, 1023, 63,
  4428		  INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 4 };
  4429	static const struct wacom_features wacom_features_0xB8 =
  4430		{ "Wacom Intuos4 4x6", 31496, 19685, 2047, 63,
  4431		  INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7 };
  4432	static const struct wacom_features wacom_features_0xB9 =
  4433		{ "Wacom Intuos4 6x9", 44704, 27940, 2047, 63,
  4434		  INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4435	static const struct wacom_features wacom_features_0xBA =
  4436		{ "Wacom Intuos4 8x13", 65024, 40640, 2047, 63,
  4437		  INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4438	static const struct wacom_features wacom_features_0xBB =
  4439		{ "Wacom Intuos4 12x19", 97536, 60960, 2047, 63,
  4440		  INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4441	static const struct wacom_features wacom_features_0xBC =
  4442		{ "Wacom Intuos4 WL", 40640, 25400, 2047, 63,
  4443		  INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4444	static const struct wacom_features wacom_features_0xBD =
  4445		{ "Wacom Intuos4 WL", 40640, 25400, 2047, 63,
  4446		  INTUOS4WL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4447	static const struct wacom_features wacom_features_0x26 =
  4448		{ "Wacom Intuos5 touch S", 31496, 19685, 2047, 63,
  4449		  INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 16 };
  4450	static const struct wacom_features wacom_features_0x27 =
  4451		{ "Wacom Intuos5 touch M", 44704, 27940, 2047, 63,
  4452		  INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16 };
  4453	static const struct wacom_features wacom_features_0x28 =
  4454		{ "Wacom Intuos5 touch L", 65024, 40640, 2047, 63,
  4455		  INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16 };
  4456	static const struct wacom_features wacom_features_0x29 =
  4457		{ "Wacom Intuos5 S", 31496, 19685, 2047, 63,
  4458		  INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7 };
  4459	static const struct wacom_features wacom_features_0x2A =
  4460		{ "Wacom Intuos5 M", 44704, 27940, 2047, 63,
  4461		  INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9 };
  4462	static const struct wacom_features wacom_features_0x314 =
  4463		{ "Wacom Intuos Pro S", 31496, 19685, 2047, 63,
  4464		  INTUOSPS, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, .touch_max = 16,
  4465		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4466	static const struct wacom_features wacom_features_0x315 =
  4467		{ "Wacom Intuos Pro M", 44704, 27940, 2047, 63,
  4468		  INTUOSPM, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16,
  4469		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4470	static const struct wacom_features wacom_features_0x317 =
  4471		{ "Wacom Intuos Pro L", 65024, 40640, 2047, 63,
  4472		  INTUOSPL, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 16,
  4473		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4474	static const struct wacom_features wacom_features_0xF4 =
  4475		{ "Wacom Cintiq 24HD", 104480, 65600, 2047, 63,
  4476		  WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 16,
  4477		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4478		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4479	static const struct wacom_features wacom_features_0xF8 =
  4480		{ "Wacom Cintiq 24HD touch", 104480, 65600, 2047, 63, /* Pen */
  4481		  WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 16,
  4482		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4483		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4484		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
  4485	static const struct wacom_features wacom_features_0xF6 =
  4486		{ "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
  4487		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10,
  4488		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4489	static const struct wacom_features wacom_features_0x32A =
  4490		{ "Wacom Cintiq 27QHD", 120140, 67920, 2047, 63,
  4491		  WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
  4492		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4493		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4494	static const struct wacom_features wacom_features_0x32B =
  4495		{ "Wacom Cintiq 27QHD touch", 120140, 67920, 2047, 63,
  4496		  WACOM_27QHD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0,
  4497		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4498		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4499		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32C };
  4500	static const struct wacom_features wacom_features_0x32C =
  4501		{ "Wacom Cintiq 27QHD touch", .type = WACOM_27QHDT,
  4502		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x32B, .touch_max = 10 };
  4503	static const struct wacom_features wacom_features_0x3F =
  4504		{ "Wacom Cintiq 21UX", 87200, 65600, 1023, 63,
  4505		  CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 8 };
  4506	static const struct wacom_features wacom_features_0xC5 =
  4507		{ "Wacom Cintiq 20WSX", 86680, 54180, 1023, 63,
  4508		  WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 10 };
  4509	static const struct wacom_features wacom_features_0xC6 =
  4510		{ "Wacom Cintiq 12WX", 53020, 33440, 1023, 63,
  4511		  WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 10 };
  4512	static const struct wacom_features wacom_features_0x304 =
  4513		{ "Wacom Cintiq 13HD", 59552, 33848, 1023, 63,
  4514		  WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4515		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4516		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4517	static const struct wacom_features wacom_features_0x333 =
  4518		{ "Wacom Cintiq 13HD touch", 59552, 33848, 2047, 63,
  4519		  WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4520		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4521		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4522		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x335 };
  4523	static const struct wacom_features wacom_features_0x335 =
  4524		{ "Wacom Cintiq 13HD touch", .type = WACOM_24HDT, /* Touch */
  4525		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x333, .touch_max = 10,
  4526		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4527	static const struct wacom_features wacom_features_0xC7 =
  4528		{ "Wacom DTU1931", 37832, 30305, 511, 0,
  4529		  PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4530	static const struct wacom_features wacom_features_0xCE =
  4531		{ "Wacom DTU2231", 47864, 27011, 511, 0,
  4532		  DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4533		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBMOUSE };
  4534	static const struct wacom_features wacom_features_0xF0 =
  4535		{ "Wacom DTU1631", 34623, 19553, 511, 0,
  4536		  DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4537	static const struct wacom_features wacom_features_0xFB =
  4538		{ "Wacom DTU1031", 22096, 13960, 511, 0,
  4539		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4540		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4541		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4542	static const struct wacom_features wacom_features_0x32F =
  4543		{ "Wacom DTU1031X", 22672, 12928, 511, 0,
  4544		  DTUSX, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 0,
  4545		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4546		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4547	static const struct wacom_features wacom_features_0x336 =
  4548		{ "Wacom DTU1141", 23672, 13403, 1023, 0,
  4549		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4550		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4551		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4552	static const struct wacom_features wacom_features_0x57 =
  4553		{ "Wacom DTK2241", 95840, 54260, 2047, 63,
  4554		  DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 6,
  4555		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4556		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4557	static const struct wacom_features wacom_features_0x59 = /* Pen */
  4558		{ "Wacom DTH2242", 95840, 54260, 2047, 63,
  4559		  DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 6,
  4560		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4561		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4562		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5D };
  4563	static const struct wacom_features wacom_features_0x5D = /* Touch */
  4564		{ "Wacom DTH2242",       .type = WACOM_24HDT,
  4565		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x59, .touch_max = 10,
  4566		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4567	static const struct wacom_features wacom_features_0xCC =
  4568		{ "Wacom Cintiq 21UX2", 87200, 65600, 2047, 63,
  4569		  WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4570		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4571		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4572	static const struct wacom_features wacom_features_0xFA =
  4573		{ "Wacom Cintiq 22HD", 95840, 54260, 2047, 63,
  4574		  WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4575		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4576		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET };
  4577	static const struct wacom_features wacom_features_0x5B =
  4578		{ "Wacom Cintiq 22HDT", 95840, 54260, 2047, 63,
  4579		  WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 18,
  4580		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4581		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4582		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e };
  4583	static const struct wacom_features wacom_features_0x5E =
  4584		{ "Wacom Cintiq 22HDT", .type = WACOM_24HDT,
  4585		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10,
  4586		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4587	static const struct wacom_features wacom_features_0x90 =
  4588		{ "Wacom ISDv4 90", 26202, 16325, 255, 0,
  4589		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4590	static const struct wacom_features wacom_features_0x93 =
  4591		{ "Wacom ISDv4 93", 26202, 16325, 255, 0,
  4592		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4593	static const struct wacom_features wacom_features_0x97 =
  4594		{ "Wacom ISDv4 97", 26202, 16325, 511, 0,
  4595		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4596	static const struct wacom_features wacom_features_0x9A =
  4597		{ "Wacom ISDv4 9A", 26202, 16325, 255, 0,
  4598		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4599	static const struct wacom_features wacom_features_0x9F =
  4600		{ "Wacom ISDv4 9F", 26202, 16325, 255, 0,
  4601		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4602	static const struct wacom_features wacom_features_0xE2 =
  4603		{ "Wacom ISDv4 E2", 26202, 16325, 255, 0,
  4604		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4605	static const struct wacom_features wacom_features_0xE3 =
  4606		{ "Wacom ISDv4 E3", 26202, 16325, 255, 0,
  4607		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4608	static const struct wacom_features wacom_features_0xE5 =
  4609		{ "Wacom ISDv4 E5", 26202, 16325, 255, 0,
  4610		  MTSCREEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4611	static const struct wacom_features wacom_features_0xE6 =
  4612		{ "Wacom ISDv4 E6", 27760, 15694, 255, 0,
  4613		  TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4614	static const struct wacom_features wacom_features_0xEC =
  4615		{ "Wacom ISDv4 EC", 25710, 14500, 255, 0,
  4616		  TABLETPC,    WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4617	static const struct wacom_features wacom_features_0xED =
  4618		{ "Wacom ISDv4 ED", 26202, 16325, 255, 0,
  4619		  TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4620	static const struct wacom_features wacom_features_0xEF =
  4621		{ "Wacom ISDv4 EF", 26202, 16325, 255, 0,
  4622		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4623	static const struct wacom_features wacom_features_0x100 =
  4624		{ "Wacom ISDv4 100", 26202, 16325, 255, 0,
  4625		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4626	static const struct wacom_features wacom_features_0x101 =
  4627		{ "Wacom ISDv4 101", 26202, 16325, 255, 0,
  4628		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4629	static const struct wacom_features wacom_features_0x10D =
  4630		{ "Wacom ISDv4 10D", 26202, 16325, 255, 0,
  4631		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4632	static const struct wacom_features wacom_features_0x10E =
  4633		{ "Wacom ISDv4 10E", 27760, 15694, 255, 0,
  4634		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4635	static const struct wacom_features wacom_features_0x10F =
  4636		{ "Wacom ISDv4 10F", 27760, 15694, 255, 0,
  4637		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4638	static const struct wacom_features wacom_features_0x116 =
  4639		{ "Wacom ISDv4 116", 26202, 16325, 255, 0,
  4640		  TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 1 };
  4641	static const struct wacom_features wacom_features_0x12C =
  4642		{ "Wacom ISDv4 12C", 27848, 15752, 2047, 0,
  4643		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; /* Pen-only */
  4644	static const struct wacom_features wacom_features_0x4001 =
  4645		{ "Wacom ISDv4 4001", 26202, 16325, 255, 0,
  4646		  MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4647	static const struct wacom_features wacom_features_0x4004 =
  4648		{ "Wacom ISDv4 4004", 11060, 6220, 255, 0,
  4649		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4650	static const struct wacom_features wacom_features_0x5000 =
  4651		{ "Wacom ISDv4 5000", 27848, 15752, 1023, 0,
  4652		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4653	static const struct wacom_features wacom_features_0x5002 =
  4654		{ "Wacom ISDv4 5002", 29576, 16724, 1023, 0,
  4655		  MTTPC_B, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4656	static const struct wacom_features wacom_features_0x47 =
  4657		{ "Wacom Intuos2 6x8", 20320, 16240, 1023, 31,
  4658		  INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4659	static const struct wacom_features wacom_features_0x84 =
  4660		{ "Wacom Wireless Receiver", .type = WIRELESS, .touch_max = 16 };
  4661	static const struct wacom_features wacom_features_0xD0 =
  4662		{ "Wacom Bamboo 2FG", 14720, 9200, 1023, 31,
  4663		  BAMBOO_TOUCH, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4664	static const struct wacom_features wacom_features_0xD1 =
  4665		{ "Wacom Bamboo 2FG 4x5", 14720, 9200, 1023, 31,
  4666		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4667	static const struct wacom_features wacom_features_0xD2 =
  4668		{ "Wacom Bamboo Craft", 14720, 9200, 1023, 31,
  4669		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4670	static const struct wacom_features wacom_features_0xD3 =
  4671		{ "Wacom Bamboo 2FG 6x8", 21648, 13700, 1023, 31,
  4672		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4673	static const struct wacom_features wacom_features_0xD4 =
  4674		{ "Wacom Bamboo Pen", 14720, 9200, 1023, 31,
  4675		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4676	static const struct wacom_features wacom_features_0xD5 =
  4677		{ "Wacom Bamboo Pen 6x8", 21648, 13700, 1023, 31,
  4678		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4679	static const struct wacom_features wacom_features_0xD6 =
  4680		{ "Wacom BambooPT 2FG 4x5", 14720, 9200, 1023, 31,
  4681		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4682	static const struct wacom_features wacom_features_0xD7 =
  4683		{ "Wacom BambooPT 2FG Small", 14720, 9200, 1023, 31,
  4684		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4685	static const struct wacom_features wacom_features_0xD8 =
  4686		{ "Wacom Bamboo Comic 2FG", 21648, 13700, 1023, 31,
  4687		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4688	static const struct wacom_features wacom_features_0xDA =
  4689		{ "Wacom Bamboo 2FG 4x5 SE", 14720, 9200, 1023, 31,
  4690		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4691	static const struct wacom_features wacom_features_0xDB =
  4692		{ "Wacom Bamboo 2FG 6x8 SE", 21648, 13700, 1023, 31,
  4693		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 2 };
  4694	static const struct wacom_features wacom_features_0xDD =
  4695	        { "Wacom Bamboo Connect", 14720, 9200, 1023, 31,
  4696	          BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4697	static const struct wacom_features wacom_features_0xDE =
  4698	        { "Wacom Bamboo 16FG 4x5", 14720, 9200, 1023, 31,
  4699		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 };
  4700	static const struct wacom_features wacom_features_0xDF =
  4701	        { "Wacom Bamboo 16FG 6x8", 21648, 13700, 1023, 31,
  4702		  BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16 };
  4703	static const struct wacom_features wacom_features_0x300 =
  4704		{ "Wacom Bamboo One S", 14720, 9225, 1023, 31,
  4705		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4706	static const struct wacom_features wacom_features_0x301 =
  4707		{ "Wacom Bamboo One M", 21648, 13530, 1023, 31,
  4708		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4709	static const struct wacom_features wacom_features_0x302 =
  4710		{ "Wacom Intuos PT S", 15200, 9500, 1023, 31,
  4711		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4712		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4713	static const struct wacom_features wacom_features_0x303 =
  4714		{ "Wacom Intuos PT M", 21600, 13500, 1023, 31,
  4715		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4716		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4717	static const struct wacom_features wacom_features_0x30E =
  4718		{ "Wacom Intuos S", 15200, 9500, 1023, 31,
  4719		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4720		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4721	static const struct wacom_features wacom_features_0x6004 =
  4722		{ "ISD-V4", 12800, 8000, 255, 0,
  4723		  TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4724	static const struct wacom_features wacom_features_0x307 =
  4725		{ "Wacom ISDv5 307", 59552, 33848, 2047, 63,
  4726		  CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4727		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4728		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4729		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x309 };
  4730	static const struct wacom_features wacom_features_0x309 =
  4731		{ "Wacom ISDv5 309", .type = WACOM_24HDT, /* Touch */
  4732		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x0307, .touch_max = 10,
  4733		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4734	static const struct wacom_features wacom_features_0x30A =
  4735		{ "Wacom ISDv5 30A", 59552, 33848, 2047, 63,
  4736		  CINTIQ_HYBRID, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9,
  4737		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4738		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4739		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30C };
  4740	static const struct wacom_features wacom_features_0x30C =
  4741		{ "Wacom ISDv5 30C", .type = WACOM_24HDT, /* Touch */
  4742		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x30A, .touch_max = 10,
  4743		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4744	static const struct wacom_features wacom_features_0x318 =
  4745		{ "Wacom USB Bamboo PAD", 4095, 4095, /* Touch */
  4746		  .type = BAMBOO_PAD, 35, 48, .touch_max = 4 };
  4747	static const struct wacom_features wacom_features_0x319 =
  4748		{ "Wacom Wireless Bamboo PAD", 4095, 4095, /* Touch */
  4749		  .type = BAMBOO_PAD, 35, 48, .touch_max = 4 };
  4750	static const struct wacom_features wacom_features_0x325 =
  4751		{ "Wacom ISDv5 325", 59552, 33848, 2047, 63,
  4752		  CINTIQ_COMPANION_2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11,
  4753		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4754		  WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET,
  4755		  .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x326 };
  4756	static const struct wacom_features wacom_features_0x326 = /* Touch */
  4757		{ "Wacom ISDv5 326", .type = HID_GENERIC, .oVid = USB_VENDOR_ID_WACOM,
  4758		  .oPid = 0x325 };
  4759	static const struct wacom_features wacom_features_0x323 =
  4760		{ "Wacom Intuos P M", 21600, 13500, 1023, 31,
  4761		  INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4762		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4763	static const struct wacom_features wacom_features_0x331 =
  4764		{ "Wacom Express Key Remote", .type = REMOTE,
  4765		  .numbered_buttons = 18, .check_for_hid_type = true,
  4766		  .hid_type = HID_TYPE_USBNONE };
  4767	static const struct wacom_features wacom_features_0x33B =
  4768		{ "Wacom Intuos S 2", 15200, 9500, 2047, 63,
  4769		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4770		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4771	static const struct wacom_features wacom_features_0x33C =
  4772		{ "Wacom Intuos PT S 2", 15200, 9500, 2047, 63,
  4773		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4774		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4775	static const struct wacom_features wacom_features_0x33D =
  4776		{ "Wacom Intuos P M 2", 21600, 13500, 2047, 63,
  4777		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
  4778		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4779	static const struct wacom_features wacom_features_0x33E =
  4780		{ "Wacom Intuos PT M 2", 21600, 13500, 2047, 63,
  4781		  INTUOSHT2, WACOM_INTUOS_RES, WACOM_INTUOS_RES, .touch_max = 16,
  4782		  .check_for_hid_type = true, .hid_type = HID_TYPE_USBNONE };
  4783	static const struct wacom_features wacom_features_0x343 =
  4784		{ "Wacom DTK1651", 34816, 19759, 1023, 0,
  4785		  DTUS, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4,
  4786		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET,
  4787		  WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
  4788	static const struct wacom_features wacom_features_0x360 =
  4789		{ "Wacom Intuos Pro M", 44800, 29600, 8191, 63,
  4790		  INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
  4791	static const struct wacom_features wacom_features_0x361 =
  4792		{ "Wacom Intuos Pro L", 62200, 43200, 8191, 63,
  4793		  INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
  4794	static const struct wacom_features wacom_features_0x377 =
  4795		{ "Wacom Intuos BT S", 15200, 9500, 4095, 63,
  4796		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4797	static const struct wacom_features wacom_features_0x379 =
  4798		{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
  4799		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4800	static const struct wacom_features wacom_features_0x37A =
  4801		{ "Wacom One by Wacom S", 15200, 9500, 2047, 63,
  4802		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4803	static const struct wacom_features wacom_features_0x37B =
  4804		{ "Wacom One by Wacom M", 21600, 13500, 2047, 63,
  4805		  BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  4806	static const struct wacom_features wacom_features_0x393 =
  4807		{ "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
  4808		  INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
  4809		  .touch_max = 10 };
  4810	static const struct wacom_features wacom_features_0x3c6 =
  4811		{ "Wacom Intuos BT S", 15200, 9500, 4095, 63,
  4812		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4813	static const struct wacom_features wacom_features_0x3c8 =
  4814		{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
  4815		  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
  4816	
  4817	static const struct wacom_features wacom_features_0x95 =
  4818		{ "Wacom AG14", .type = HID_GENERIC, .oVid = 0x2D1F, .oPid = 149 };
  4819	
  4820	static const struct wacom_features wacom_features_HID_ANY_ID =
  4821		{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
  4822	
  4823	#define USB_DEVICE_WACOM(prod)						\
  4824		HID_DEVICE(BUS_USB, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4825		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4826	
  4827	#define BT_DEVICE_WACOM(prod)						\
  4828		HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4829		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4830	
  4831	#define I2C_DEVICE_WACOM(prod)						\
  4832		HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_WACOM, prod),\
  4833		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4834	
  4835	#define I2C_AG14_DEVICE_WACOM(prod)					    \
> 4836		HID_DEVICE(BUS_I2C, HID_GROUP_WACOM, USB_VENDOR_ID_I2C_WACOM, prod),\
  4837		.driver_data = (kernel_ulong_t)&wacom_features_##prod
  4838	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34229 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device
  2021-10-09 11:43 ` [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
@ 2021-10-10  8:24   ` kernel test robot
  0 siblings, 0 replies; 22+ messages in thread
From: kernel test robot @ 2021-10-10  8:24 UTC (permalink / raw)
  To: Alistair Francis, dmitry.torokhov, shawnguo, s.hauer
  Cc: llvm, kbuild-all, linux-imx, jikos, benjamin.tissoires,
	linux-input, devicetree, linux-kernel, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 3433 bytes --]

Hi Alistair,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hid/for-next]
[also build test WARNING on robh/for-next shawnguo/for-next linus/master v5.15-rc4 next-20211008]
[cannot apply to dtor-input/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
base:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
config: arm-randconfig-c002-20211009 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 30caca39f401ae17927439c0a0bd6d1b1916dd6a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://github.com/0day-ci/linux/commit/ce3f07df832613e47eae45309a5432325738d3b3
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Alistair-Francis/HID-wacom_sys-Add-support-for-flipping-the-data-values/20211009-194419
        git checkout ce3f07df832613e47eae45309a5432325738d3b3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> arch/arm/boot/dts/imx7d-remarkable2.dts:166:53: warning: '/*' within block comment [-Wcomment]
                           /*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5   0x00000014 /* FWE */
                                                                              ^
   arch/arm/boot/dts/imx7d-remarkable2.dts:169:53: warning: '/*' within block comment [-Wcomment]
                           /*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6   0x00000014 /* WACOM PWR ENABLE */
                                                                              ^
   arch/arm/boot/dts/imx7d-remarkable2.dts:170:53: warning: '/*' within block comment [-Wcomment]
                           /*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0   0x00000074 /* WACOM RESET */
                                                                              ^
   3 warnings generated.


vim +166 arch/arm/boot/dts/imx7d-remarkable2.dts

   155	
   156	&iomuxc_lpsr {
   157		pinctrl_digitizer_reg: digitizerreggrp {
   158			fsl,pins = <
   159				/* DIGITIZER_PWR_EN */
   160				MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x14
   161			>;
   162		};
   163	
   164		pinctrl_wacom: wacomgrp {
   165			fsl,pins = <
 > 166				/*MX7D_PAD_LPSR_GPIO1_IO05__GPIO1_IO5	0x00000014 /* FWE */
   167				MX7D_PAD_LPSR_GPIO1_IO04__GPIO1_IO4	0x00000074 /* PDCTB */
   168				MX7D_PAD_LPSR_GPIO1_IO01__GPIO1_IO1	0x00000034 /* WACOM INT */
   169				/*MX7D_PAD_LPSR_GPIO1_IO06__GPIO1_IO6	0x00000014 /* WACOM PWR ENABLE */
   170				/*MX7D_PAD_LPSR_GPIO1_IO00__GPIO1_IO0	0x00000074 /* WACOM RESET */
   171			>;
   172		};
   173	};
   174	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33119 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C
  2021-10-09 11:43 ` [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C Alistair Francis
@ 2021-10-15  2:50   ` Shawn Guo
  0 siblings, 0 replies; 22+ messages in thread
From: Shawn Guo @ 2021-10-15  2:50 UTC (permalink / raw)
  To: Alistair Francis
  Cc: dmitry.torokhov, s.hauer, linux-imx, jikos, benjamin.tissoires,
	linux-input, devicetree, linux-kernel, linux-arm-kernel,
	alistair23

On Sat, Oct 09, 2021 at 09:43:12PM +1000, Alistair Francis wrote:
> Enable HID I2C in the imx defconfig as it is used for a HID compliant
> wacom device on the reMarkable2 tablet.
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>

Applied, thanks!

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-09 11:43 [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Alistair Francis
                   ` (2 preceding siblings ...)
  2021-10-09 11:43 ` [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
@ 2021-10-16 14:34 ` Rob Herring
       [not found] ` <CAF8JNh+OUzvAHA9tBrH2d_WxWPXRgiunhGO5KV4-fqVG+tUOyQ@mail.gmail.com>
  4 siblings, 0 replies; 22+ messages in thread
From: Rob Herring @ 2021-10-16 14:34 UTC (permalink / raw)
  To: Alistair Francis
  Cc: shawnguo, dmitry.torokhov, s.hauer, linux-imx, linux-input,
	devicetree, linux-arm-kernel, jikos, linux-kernel, alistair23,
	benjamin.tissoires

On Sat, 09 Oct 2021 21:43:10 +1000, Alistair Francis wrote:
> Add support to the Wacom HID device for flipping the values based on
> device tree settings. This allows us to support devices where the panel
> is installed in a different orientation, such as the reMarkable2.
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> ---
>  .../bindings/input/hid-over-i2c.txt           | 20 ++++++
>  drivers/hid/wacom_sys.c                       | 25 ++++++++
>  drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
>  drivers/hid/wacom_wac.h                       | 13 ++++
>  4 files changed, 119 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
       [not found] ` <CAF8JNh+OUzvAHA9tBrH2d_WxWPXRgiunhGO5KV4-fqVG+tUOyQ@mail.gmail.com>
@ 2021-10-18 21:54   ` Alistair Francis
  2021-10-19  1:50   ` Dmitry Torokhov
  1 sibling, 0 replies; 22+ messages in thread
From: Alistair Francis @ 2021-10-18 21:54 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Alistair Francis, Dmitry Torokhov, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Tue, Oct 19, 2021 at 3:42 AM Ping Cheng <pinglinux@gmail.com> wrote:
>
> Hi Alistair,
>
> On Sat, Oct 9, 2021, 4:44 AM Alistair Francis <alistair@alistair23.me> wrote:
>>
>> Add support to the Wacom HID device for flipping the values based on
>> device tree settings. This allows us to support devices where the panel
>> is installed in a different orientation, such as the reMarkable2.
>
>
> This device was designed for hid-generic driver, if it's not driven by wacom_i2c.c or an out of tree driver.
>
> wacom.ko doesn't support vid 0x2d1f devices.
>
> Nacked-by: Ping Cheng <Ping.Cheng@wacom.com>

Any ideas how to support the hardware then?

I can't use the wacom_i2c driver as the panel supports I2C HID. But I
can't use the I2C HID driver as I need the values flipped to support
the installed orientation.

Alistair

>
> Sorry about that,
> Ping
>
>> Signed-off-by: Alistair Francis <alistair@alistair23.me>
>> ---
>>  .../bindings/input/hid-over-i2c.txt           | 20 ++++++
>>  drivers/hid/wacom_sys.c                       | 25 ++++++++
>>  drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
>>  drivers/hid/wacom_wac.h                       | 13 ++++
>>  4 files changed, 119 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.txt b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
>> index c76bafaf98d2..16ebd7c46049 100644
>> --- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
>> +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
>> @@ -33,6 +33,26 @@ device-specific compatible properties, which should be used in addition to the
>>  - post-power-on-delay-ms: time required by the device after enabling its regulators
>>    or powering it on, before it is ready for communication.
>>
>> +  flip-tilt-x:
>> +    type: boolean
>> +    description: Flip the tilt X values read from device
>> +
>> +  flip-tilt-y:
>> +    type: boolean
>> +    description: Flip the tilt Y values read from device
>> +
>> +  flip-pos-x:
>> +    type: boolean
>> +    description: Flip the X position values read from device
>> +
>> +  flip-pos-y:
>> +    type: boolean
>> +    description: Flip the Y position values read from device
>> +
>> +  flip-distance:
>> +    type: boolean
>> +    description: Flip the distance values read from device
>> +
>>  Example:
>>
>>         i2c-hid-dev@2c {
>> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
>> index 93f49b766376..47d9590b10bd 100644
>> --- a/drivers/hid/wacom_sys.c
>> +++ b/drivers/hid/wacom_sys.c
>> @@ -10,6 +10,7 @@
>>
>>  #include "wacom_wac.h"
>>  #include "wacom.h"
>> +#include <linux/of.h>
>>  #include <linux/input/mt.h>
>>
>>  #define WAC_MSG_RETRIES                5
>> @@ -2730,6 +2731,28 @@ static void wacom_mode_change_work(struct work_struct *work)
>>         return;
>>  }
>>
>> +static void wacom_of_read(struct hid_device *hdev, struct wacom_wac *wacom_wac)
>> +{
>> +       if (IS_ENABLED(CONFIG_OF)) {
>> +               wacom_wac->flip_tilt_x = of_property_read_bool(hdev->dev.parent->of_node,
>> +                                                       "flip-tilt-x");
>> +               wacom_wac->flip_tilt_y = of_property_read_bool(hdev->dev.parent->of_node,
>> +                                                       "flip-tilt-y");
>> +               wacom_wac->flip_pos_x = of_property_read_bool(hdev->dev.parent->of_node,
>> +                                                       "flip-pos-x");
>> +               wacom_wac->flip_pos_y = of_property_read_bool(hdev->dev.parent->of_node,
>> +                                                       "flip-pos-y");
>> +               wacom_wac->flip_distance = of_property_read_bool(hdev->dev.parent->of_node,
>> +                                                       "flip-distance");
>> +       } else {
>> +               wacom_wac->flip_tilt_x = false;
>> +               wacom_wac->flip_tilt_y = false;
>> +               wacom_wac->flip_pos_x = false;
>> +               wacom_wac->flip_pos_y = false;
>> +               wacom_wac->flip_distance = false;
>> +       }
>> +}
>> +
>>  static int wacom_probe(struct hid_device *hdev,
>>                 const struct hid_device_id *id)
>>  {
>> @@ -2797,6 +2820,8 @@ static int wacom_probe(struct hid_device *hdev,
>>                                  error);
>>         }
>>
>> +       wacom_of_read(hdev, wacom_wac);
>> +
>>         wacom_wac->probe_complete = true;
>>         return 0;
>>  }
>> diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
>> index 33a6908995b1..c01f683e23fa 100644
>> --- a/drivers/hid/wacom_wac.c
>> +++ b/drivers/hid/wacom_wac.c
>> @@ -3261,6 +3261,63 @@ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
>>         return 0;
>>  }
>>
>> +static int wacom_of_irq(struct wacom_wac *wacom_wac, size_t len)
>> +{
>> +       const struct wacom_features *features = &wacom_wac->features;
>> +       unsigned char *data = wacom_wac->data;
>> +       struct input_dev *input = wacom_wac->pen_input;
>> +       unsigned int x, y, pressure;
>> +       unsigned char tsw, f1, f2, ers;
>> +       short tilt_x, tilt_y, distance;
>> +
>> +       if (!IS_ENABLED(CONFIG_OF))
>> +               return 0;
>> +
>> +       tsw = data[1] & WACOM_TIP_SWITCH_bm;
>> +       ers = data[1] & WACOM_ERASER_bm;
>> +       f1 = data[1] & WACOM_BARREL_SWITCH_bm;
>> +       f2 = data[1] & WACOM_BARREL_SWITCH_2_bm;
>> +       x = le16_to_cpup((__le16 *)&data[2]);
>> +       y = le16_to_cpup((__le16 *)&data[4]);
>> +       pressure = le16_to_cpup((__le16 *)&data[6]);
>> +
>> +       /* Signed */
>> +       tilt_x = get_unaligned_le16(&data[9]);
>> +       tilt_y = get_unaligned_le16(&data[11]);
>> +
>> +       distance = get_unaligned_le16(&data[13]);
>> +
>> +       /* keep touch state for pen events */
>> +       if (!wacom_wac->shared->touch_down)
>> +               wacom_wac->tool[0] = (data[1] & 0x0c) ?
>> +                       BTN_TOOL_RUBBER : BTN_TOOL_PEN;
>> +
>> +       wacom_wac->shared->touch_down = data[1] & 0x20;
>> +
>> +       // Flip the values based on properties from the device tree
>> +
>> +       // Default to a negative value for distance as HID compliant Wacom
>> +       // devices generally specify the hovering distance as negative.
>> +       distance = wacom_wac->flip_distance ? distance : -distance;
>> +       x = wacom_wac->flip_pos_x ? (features->x_max - x) : x;
>> +       y = wacom_wac->flip_pos_y ? (features->y_max - y) : y;
>> +       tilt_x = wacom_wac->flip_tilt_x ? -tilt_x : tilt_x;
>> +       tilt_y = wacom_wac->flip_tilt_y ? -tilt_y : tilt_y;
>> +
>> +       input_report_key(input, BTN_TOUCH, tsw || ers);
>> +       input_report_key(input, wacom_wac->tool[0], wacom_wac->shared->touch_down);
>> +       input_report_key(input, BTN_STYLUS, f1);
>> +       input_report_key(input, BTN_STYLUS2, f2);
>> +       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);
>> +
>> +       return 1;
>> +}
>> +
>>  void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
>>  {
>>         bool sync;
>> @@ -3379,6 +3436,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
>>                         sync = wacom_remote_irq(wacom_wac, len);
>>                 break;
>>
>> +       case HID_GENERIC:
>> +               sync = wacom_of_irq(wacom_wac, len);
>> +               break;
>> +
>>         default:
>>                 sync = false;
>>                 break;
>> diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h
>> index 8b2d4e5b2303..4dd5a56bf347 100644
>> --- a/drivers/hid/wacom_wac.h
>> +++ b/drivers/hid/wacom_wac.h
>> @@ -157,6 +157,14 @@
>>  #define WACOM_HID_WT_Y                  (WACOM_HID_UP_WACOMTOUCH | 0x131)
>>  #define WACOM_HID_WT_REPORT_VALID       (WACOM_HID_UP_WACOMTOUCH | 0x1d0)
>>
>> +// Bitmasks (for data[3])
>> +#define WACOM_TIP_SWITCH_bm         (1 << 0)
>> +#define WACOM_BARREL_SWITCH_bm      (1 << 1)
>> +#define WACOM_ERASER_bm             (1 << 2)
>> +#define WACOM_INVERT_bm             (1 << 3)
>> +#define WACOM_BARREL_SWITCH_2_bm    (1 << 4)
>> +#define WACOM_IN_RANGE_bm           (1 << 5)
>> +
>>  #define WACOM_BATTERY_USAGE(f) (((f)->hid == HID_DG_BATTERYSTRENGTH) || \
>>                                  ((f)->hid == WACOM_HID_WD_BATTERY_CHARGING) || \
>>                                  ((f)->hid == WACOM_HID_WD_BATTERY_LEVEL))
>> @@ -357,6 +365,11 @@ struct wacom_wac {
>>         bool has_mode_change;
>>         bool is_direct_mode;
>>         bool is_invalid_bt_frame;
>> +       bool flip_tilt_x;
>> +       bool flip_tilt_y;
>> +       bool flip_pos_x;
>> +       bool flip_pos_y;
>> +       bool flip_distance;
>>  };
>>
>>  #endif
>> --
>> 2.31.1
>>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
       [not found] ` <CAF8JNh+OUzvAHA9tBrH2d_WxWPXRgiunhGO5KV4-fqVG+tUOyQ@mail.gmail.com>
  2021-10-18 21:54   ` Alistair Francis
@ 2021-10-19  1:50   ` Dmitry Torokhov
  2021-10-19 22:57     ` Tobita, Tatsunosuke
  2021-10-19 23:33     ` Alistair Francis
  1 sibling, 2 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2021-10-19  1:50 UTC (permalink / raw)
  To: Ping Cheng
  Cc: Alistair Francis, shawnguo, s.hauer, linux-imx, Jiri Kosina,
	Benjamin Tissoires, linux-input, devicetree, LKML,
	linux-arm-kernel, alistair23

Hi Ping,

On Mon, Oct 18, 2021 at 10:41:55AM -0700, Ping Cheng wrote:
> Hi Alistair,
> 
> On Sat, Oct 9, 2021, 4:44 AM Alistair Francis <alistair@alistair23.me>
> wrote:
> 
> > Add support to the Wacom HID device for flipping the values based on
> > device tree settings. This allows us to support devices where the panel
> > is installed in a different orientation, such as the reMarkable2.
> >
> 
> This device was designed for hid-generic driver, if it's not driven by
> wacom_i2c.c or an out of tree driver.
> 
> wacom.ko doesn't support vid 0x2d1f devices.

I am really confused about this distinction. Could you please elaborate
why wacom driver only supports 0x056a (and, curiously, some Lenovo)
devices.

Thanks.


> 
> Nacked-by: Ping Cheng <Ping.Cheng@wacom.com>
> 
> Sorry about that,
> Ping
> 
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> > ---
> >  .../bindings/input/hid-over-i2c.txt           | 20 ++++++
> >  drivers/hid/wacom_sys.c                       | 25 ++++++++
> >  drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
> >  drivers/hid/wacom_wac.h                       | 13 ++++
> >  4 files changed, 119 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > index c76bafaf98d2..16ebd7c46049 100644
> > --- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > @@ -33,6 +33,26 @@ device-specific compatible properties, which should be
> > used in addition to the
> >  - post-power-on-delay-ms: time required by the device after enabling its
> > regulators
> >    or powering it on, before it is ready for communication.
> >
> > +  flip-tilt-x:
> > +    type: boolean
> > +    description: Flip the tilt X values read from device
> > +
> > +  flip-tilt-y:
> > +    type: boolean
> > +    description: Flip the tilt Y values read from device

Do these really need to be controlled separately from the main
touchcsreen orientation?

> > +
> > +  flip-pos-x:
> > +    type: boolean
> > +    description: Flip the X position values read from device
> > +
> > +  flip-pos-y:
> > +    type: boolean
> > +    description: Flip the Y position values read from device

We already have touchscreen-inverted-x/y defined in
Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
why are they not sufficient?

> > +
> > +  flip-distance:
> > +    type: boolean
> > +    description: Flip the distance values read from device

I am still confused of the notion of flipped distance.

> > +
> >  Example:
> >
> >         i2c-hid-dev@2c {
> > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> > index 93f49b766376..47d9590b10bd 100644
> > --- a/drivers/hid/wacom_sys.c
> > +++ b/drivers/hid/wacom_sys.c
> > @@ -10,6 +10,7 @@
> >
> >  #include "wacom_wac.h"
> >  #include "wacom.h"
> > +#include <linux/of.h>
> >  #include <linux/input/mt.h>
> >
> >  #define WAC_MSG_RETRIES                5
> > @@ -2730,6 +2731,28 @@ static void wacom_mode_change_work(struct
> > work_struct *work)
> >         return;
> >  }
> >
> > +static void wacom_of_read(struct hid_device *hdev, struct wacom_wac
> > *wacom_wac)
> > +{
> > +       if (IS_ENABLED(CONFIG_OF)) {
> > +               wacom_wac->flip_tilt_x =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-tilt-x");
> > +               wacom_wac->flip_tilt_y =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-tilt-y");
> > +               wacom_wac->flip_pos_x =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-pos-x");
> > +               wacom_wac->flip_pos_y =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-pos-y");
> > +               wacom_wac->flip_distance =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-distance");
> > +       } else {
> > +               wacom_wac->flip_tilt_x = false;
> > +               wacom_wac->flip_tilt_y = false;
> > +               wacom_wac->flip_pos_x = false;
> > +               wacom_wac->flip_pos_y = false;
> > +               wacom_wac->flip_distance = false;
> > +       }
> > +}
> > +
> >  static int wacom_probe(struct hid_device *hdev,
> >                 const struct hid_device_id *id)
> >  {
> > @@ -2797,6 +2820,8 @@ static int wacom_probe(struct hid_device *hdev,
> >                                  error);
> >         }
> >
> > +       wacom_of_read(hdev, wacom_wac);
> > +
> >         wacom_wac->probe_complete = true;
> >         return 0;
> >  }
> > diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> > index 33a6908995b1..c01f683e23fa 100644
> > --- a/drivers/hid/wacom_wac.c
> > +++ b/drivers/hid/wacom_wac.c
> > @@ -3261,6 +3261,63 @@ static int wacom_status_irq(struct wacom_wac
> > *wacom_wac, size_t len)
> >         return 0;
> >  }
> >
> > +static int wacom_of_irq(struct wacom_wac *wacom_wac, size_t len)
> > +{
> > +       const struct wacom_features *features = &wacom_wac->features;
> > +       unsigned char *data = wacom_wac->data;
> > +       struct input_dev *input = wacom_wac->pen_input;
> > +       unsigned int x, y, pressure;
> > +       unsigned char tsw, f1, f2, ers;
> > +       short tilt_x, tilt_y, distance;
> > +
> > +       if (!IS_ENABLED(CONFIG_OF))
> > +               return 0;
> > +
> > +       tsw = data[1] & WACOM_TIP_SWITCH_bm;
> > +       ers = data[1] & WACOM_ERASER_bm;
> > +       f1 = data[1] & WACOM_BARREL_SWITCH_bm;
> > +       f2 = data[1] & WACOM_BARREL_SWITCH_2_bm;
> > +       x = le16_to_cpup((__le16 *)&data[2]);
> > +       y = le16_to_cpup((__le16 *)&data[4]);
> > +       pressure = le16_to_cpup((__le16 *)&data[6]);
> > +
> > +       /* Signed */
> > +       tilt_x = get_unaligned_le16(&data[9]);
> > +       tilt_y = get_unaligned_le16(&data[11]);
> > +
> > +       distance = get_unaligned_le16(&data[13]);

You are still parsing raw data. The point of HID is to provide common
framework for scaling raw values.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* RE: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-19  1:50   ` Dmitry Torokhov
@ 2021-10-19 22:57     ` Tobita, Tatsunosuke
  2021-10-19 23:33     ` Alistair Francis
  1 sibling, 0 replies; 22+ messages in thread
From: Tobita, Tatsunosuke @ 2021-10-19 22:57 UTC (permalink / raw)
  To: Dmitry Torokhov, Ping Cheng
  Cc: Alistair Francis, shawnguo, s.hauer, linux-imx, Jiri Kosina,
	Benjamin Tissoires, linux-input, devicetree, LKML,
	linux-arm-kernel, alistair23

Hi Dmitry,

>I am really confused about this distinction. Could you please elaborate why wacom driver only supports 0x056a (and, curiously, some Lenovo) devices.
We want 0x2d1F to work with ***ONLY*** with the generic HID driver because the every recent firmware is designed for that; no help is needed from other sides.
In contrast, the most of the devices is required help from other sides. Therefore, the devices with VID 0x2D1F devices are supposed to run alone and separated out from our brand shipped products. 
I don't know how much we can go further to tell you about this -because of our business, but 0x2D1F was obtained such purpose. Your understanding is much appreciated.

Thanks,

Tats

-----Original Message-----
From: Dmitry Torokhov <dmitry.torokhov@gmail.com> 
Sent: Tuesday, October 19, 2021 10:51 AM
To: Ping Cheng <pinglinux@gmail.com>
Cc: Alistair Francis <alistair@alistair23.me>; shawnguo@kernel.org; s.hauer@pengutronix.de; linux-imx@nxp.com; Jiri Kosina <jikos@kernel.org>; Benjamin Tissoires <benjamin.tissoires@redhat.com>; linux-input <linux-input@vger.kernel.org>; devicetree@vger.kernel.org; LKML <linux-kernel@vger.kernel.org>; linux-arm-kernel@lists.infradead.org; alistair23@gmail.com
Subject: Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values

[EXTERNAL]

Hi Ping,

On Mon, Oct 18, 2021 at 10:41:55AM -0700, Ping Cheng wrote:
> Hi Alistair,
>
> On Sat, Oct 9, 2021, 4:44 AM Alistair Francis <alistair@alistair23.me>
> wrote:
>
> > Add support to the Wacom HID device for flipping the values based on 
> > device tree settings. This allows us to support devices where the 
> > panel is installed in a different orientation, such as the reMarkable2.
> >
>
> This device was designed for hid-generic driver, if it's not driven by 
> wacom_i2c.c or an out of tree driver.
>
> wacom.ko doesn't support vid 0x2d1f devices.

I am really confused about this distinction. Could you please elaborate why wacom driver only supports 0x056a (and, curiously, some Lenovo) devices.

Thanks.


>
> Nacked-by: Ping Cheng <Ping.Cheng@wacom.com>
>
> Sorry about that,
> Ping
>
> Signed-off-by: Alistair Francis <alistair@alistair23.me>
> > ---
> >  .../bindings/input/hid-over-i2c.txt           | 20 ++++++
> >  drivers/hid/wacom_sys.c                       | 25 ++++++++
> >  drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
> >  drivers/hid/wacom_wac.h                       | 13 ++++
> >  4 files changed, 119 insertions(+)
> >
> > diff --git 
> > a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > index c76bafaf98d2..16ebd7c46049 100644
> > --- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > @@ -33,6 +33,26 @@ device-specific compatible properties, which 
> > should be used in addition to the
> >  - post-power-on-delay-ms: time required by the device after 
> > enabling its regulators
> >    or powering it on, before it is ready for communication.
> >
> > +  flip-tilt-x:
> > +    type: boolean
> > +    description: Flip the tilt X values read from device
> > +
> > +  flip-tilt-y:
> > +    type: boolean
> > +    description: Flip the tilt Y values read from device

Do these really need to be controlled separately from the main touchcsreen orientation?

> > +
> > +  flip-pos-x:
> > +    type: boolean
> > +    description: Flip the X position values read from device
> > +
> > +  flip-pos-y:
> > +    type: boolean
> > +    description: Flip the Y position values read from device

We already have touchscreen-inverted-x/y defined in Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
why are they not sufficient?

> > +
> > +  flip-distance:
> > +    type: boolean
> > +    description: Flip the distance values read from device

I am still confused of the notion of flipped distance.

> > +
> >  Example:
> >
> >         i2c-hid-dev@2c {
> > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 
> > 93f49b766376..47d9590b10bd 100644
> > --- a/drivers/hid/wacom_sys.c
> > +++ b/drivers/hid/wacom_sys.c
> > @@ -10,6 +10,7 @@
> >
> >  #include "wacom_wac.h"
> >  #include "wacom.h"
> > +#include <linux/of.h>
> >  #include <linux/input/mt.h>
> >
> >  #define WAC_MSG_RETRIES                5
> > @@ -2730,6 +2731,28 @@ static void wacom_mode_change_work(struct 
> > work_struct *work)
> >         return;
> >  }
> >
> > +static void wacom_of_read(struct hid_device *hdev, struct wacom_wac
> > *wacom_wac)
> > +{
> > +       if (IS_ENABLED(CONFIG_OF)) {
> > +               wacom_wac->flip_tilt_x =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-tilt-x");
> > +               wacom_wac->flip_tilt_y =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-tilt-y");
> > +               wacom_wac->flip_pos_x =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-pos-x");
> > +               wacom_wac->flip_pos_y =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-pos-y");
> > +               wacom_wac->flip_distance =
> > of_property_read_bool(hdev->dev.parent->of_node,
> > +                                                       "flip-distance");
> > +       } else {
> > +               wacom_wac->flip_tilt_x = false;
> > +               wacom_wac->flip_tilt_y = false;
> > +               wacom_wac->flip_pos_x = false;
> > +               wacom_wac->flip_pos_y = false;
> > +               wacom_wac->flip_distance = false;
> > +       }
> > +}
> > +
> >  static int wacom_probe(struct hid_device *hdev,
> >                 const struct hid_device_id *id)  { @@ -2797,6 
> > +2820,8 @@ static int wacom_probe(struct hid_device *hdev,
> >                                  error);
> >         }
> >
> > +       wacom_of_read(hdev, wacom_wac);
> > +
> >         wacom_wac->probe_complete = true;
> >         return 0;
> >  }
> > diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 
> > 33a6908995b1..c01f683e23fa 100644
> > --- a/drivers/hid/wacom_wac.c
> > +++ b/drivers/hid/wacom_wac.c
> > @@ -3261,6 +3261,63 @@ static int wacom_status_irq(struct wacom_wac 
> > *wacom_wac, size_t len)
> >         return 0;
> >  }
> >
> > +static int wacom_of_irq(struct wacom_wac *wacom_wac, size_t len) {
> > +       const struct wacom_features *features = &wacom_wac->features;
> > +       unsigned char *data = wacom_wac->data;
> > +       struct input_dev *input = wacom_wac->pen_input;
> > +       unsigned int x, y, pressure;
> > +       unsigned char tsw, f1, f2, ers;
> > +       short tilt_x, tilt_y, distance;
> > +
> > +       if (!IS_ENABLED(CONFIG_OF))
> > +               return 0;
> > +
> > +       tsw = data[1] & WACOM_TIP_SWITCH_bm;
> > +       ers = data[1] & WACOM_ERASER_bm;
> > +       f1 = data[1] & WACOM_BARREL_SWITCH_bm;
> > +       f2 = data[1] & WACOM_BARREL_SWITCH_2_bm;
> > +       x = le16_to_cpup((__le16 *)&data[2]);
> > +       y = le16_to_cpup((__le16 *)&data[4]);
> > +       pressure = le16_to_cpup((__le16 *)&data[6]);
> > +
> > +       /* Signed */
> > +       tilt_x = get_unaligned_le16(&data[9]);
> > +       tilt_y = get_unaligned_le16(&data[11]);
> > +
> > +       distance = get_unaligned_le16(&data[13]);

You are still parsing raw data. The point of HID is to provide common framework for scaling raw values.

Thanks.

--
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-19  1:50   ` Dmitry Torokhov
  2021-10-19 22:57     ` Tobita, Tatsunosuke
@ 2021-10-19 23:33     ` Alistair Francis
  2021-10-20  1:05       ` Dmitry Torokhov
  1 sibling, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-19 23:33 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Alistair Francis, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hi Ping,
>
> On Mon, Oct 18, 2021 at 10:41:55AM -0700, Ping Cheng wrote:
> > Hi Alistair,
> >
> > On Sat, Oct 9, 2021, 4:44 AM Alistair Francis <alistair@alistair23.me>
> > wrote:
> >
> > > Add support to the Wacom HID device for flipping the values based on
> > > device tree settings. This allows us to support devices where the panel
> > > is installed in a different orientation, such as the reMarkable2.
> > >
> >
> > This device was designed for hid-generic driver, if it's not driven by
> > wacom_i2c.c or an out of tree driver.
> >
> > wacom.ko doesn't support vid 0x2d1f devices.
>
> I am really confused about this distinction. Could you please elaborate
> why wacom driver only supports 0x056a (and, curiously, some Lenovo)
> devices.
>
> Thanks.
>
>
> >
> > Nacked-by: Ping Cheng <Ping.Cheng@wacom.com>
> >
> > Sorry about that,
> > Ping
> >
> > Signed-off-by: Alistair Francis <alistair@alistair23.me>
> > > ---
> > >  .../bindings/input/hid-over-i2c.txt           | 20 ++++++
> > >  drivers/hid/wacom_sys.c                       | 25 ++++++++
> > >  drivers/hid/wacom_wac.c                       | 61 +++++++++++++++++++
> > >  drivers/hid/wacom_wac.h                       | 13 ++++
> > >  4 files changed, 119 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > > b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > > index c76bafaf98d2..16ebd7c46049 100644
> > > --- a/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > > +++ b/Documentation/devicetree/bindings/input/hid-over-i2c.txt
> > > @@ -33,6 +33,26 @@ device-specific compatible properties, which should be
> > > used in addition to the
> > >  - post-power-on-delay-ms: time required by the device after enabling its
> > > regulators
> > >    or powering it on, before it is ready for communication.
> > >
> > > +  flip-tilt-x:
> > > +    type: boolean
> > > +    description: Flip the tilt X values read from device
> > > +
> > > +  flip-tilt-y:
> > > +    type: boolean
> > > +    description: Flip the tilt Y values read from device
>
> Do these really need to be controlled separately from the main
> touchcsreen orientation?

I don't think so actually.

>
> > > +
> > > +  flip-pos-x:
> > > +    type: boolean
> > > +    description: Flip the X position values read from device
> > > +
> > > +  flip-pos-y:
> > > +    type: boolean
> > > +    description: Flip the Y position values read from device
>
> We already have touchscreen-inverted-x/y defined in
> Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> why are they not sufficient?

The touchscreen-* properties aren't applied to HID devices though, at
least not that I can tell.

Alistair

>
> > > +
> > > +  flip-distance:
> > > +    type: boolean
> > > +    description: Flip the distance values read from device
>
> I am still confused of the notion of flipped distance.
>
> > > +
> > >  Example:
> > >
> > >         i2c-hid-dev@2c {
> > > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> > > index 93f49b766376..47d9590b10bd 100644
> > > --- a/drivers/hid/wacom_sys.c
> > > +++ b/drivers/hid/wacom_sys.c
> > > @@ -10,6 +10,7 @@
> > >
> > >  #include "wacom_wac.h"
> > >  #include "wacom.h"
> > > +#include <linux/of.h>
> > >  #include <linux/input/mt.h>
> > >
> > >  #define WAC_MSG_RETRIES                5
> > > @@ -2730,6 +2731,28 @@ static void wacom_mode_change_work(struct
> > > work_struct *work)
> > >         return;
> > >  }
> > >
> > > +static void wacom_of_read(struct hid_device *hdev, struct wacom_wac
> > > *wacom_wac)
> > > +{
> > > +       if (IS_ENABLED(CONFIG_OF)) {
> > > +               wacom_wac->flip_tilt_x =
> > > of_property_read_bool(hdev->dev.parent->of_node,
> > > +                                                       "flip-tilt-x");
> > > +               wacom_wac->flip_tilt_y =
> > > of_property_read_bool(hdev->dev.parent->of_node,
> > > +                                                       "flip-tilt-y");
> > > +               wacom_wac->flip_pos_x =
> > > of_property_read_bool(hdev->dev.parent->of_node,
> > > +                                                       "flip-pos-x");
> > > +               wacom_wac->flip_pos_y =
> > > of_property_read_bool(hdev->dev.parent->of_node,
> > > +                                                       "flip-pos-y");
> > > +               wacom_wac->flip_distance =
> > > of_property_read_bool(hdev->dev.parent->of_node,
> > > +                                                       "flip-distance");
> > > +       } else {
> > > +               wacom_wac->flip_tilt_x = false;
> > > +               wacom_wac->flip_tilt_y = false;
> > > +               wacom_wac->flip_pos_x = false;
> > > +               wacom_wac->flip_pos_y = false;
> > > +               wacom_wac->flip_distance = false;
> > > +       }
> > > +}
> > > +
> > >  static int wacom_probe(struct hid_device *hdev,
> > >                 const struct hid_device_id *id)
> > >  {
> > > @@ -2797,6 +2820,8 @@ static int wacom_probe(struct hid_device *hdev,
> > >                                  error);
> > >         }
> > >
> > > +       wacom_of_read(hdev, wacom_wac);
> > > +
> > >         wacom_wac->probe_complete = true;
> > >         return 0;
> > >  }
> > > diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
> > > index 33a6908995b1..c01f683e23fa 100644
> > > --- a/drivers/hid/wacom_wac.c
> > > +++ b/drivers/hid/wacom_wac.c
> > > @@ -3261,6 +3261,63 @@ static int wacom_status_irq(struct wacom_wac
> > > *wacom_wac, size_t len)
> > >         return 0;
> > >  }
> > >
> > > +static int wacom_of_irq(struct wacom_wac *wacom_wac, size_t len)
> > > +{
> > > +       const struct wacom_features *features = &wacom_wac->features;
> > > +       unsigned char *data = wacom_wac->data;
> > > +       struct input_dev *input = wacom_wac->pen_input;
> > > +       unsigned int x, y, pressure;
> > > +       unsigned char tsw, f1, f2, ers;
> > > +       short tilt_x, tilt_y, distance;
> > > +
> > > +       if (!IS_ENABLED(CONFIG_OF))
> > > +               return 0;
> > > +
> > > +       tsw = data[1] & WACOM_TIP_SWITCH_bm;
> > > +       ers = data[1] & WACOM_ERASER_bm;
> > > +       f1 = data[1] & WACOM_BARREL_SWITCH_bm;
> > > +       f2 = data[1] & WACOM_BARREL_SWITCH_2_bm;
> > > +       x = le16_to_cpup((__le16 *)&data[2]);
> > > +       y = le16_to_cpup((__le16 *)&data[4]);
> > > +       pressure = le16_to_cpup((__le16 *)&data[6]);
> > > +
> > > +       /* Signed */
> > > +       tilt_x = get_unaligned_le16(&data[9]);
> > > +       tilt_y = get_unaligned_le16(&data[11]);
> > > +
> > > +       distance = get_unaligned_le16(&data[13]);
>
> You are still parsing raw data. The point of HID is to provide common
> framework for scaling raw values.
>
> Thanks.
>
> --
> Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-19 23:33     ` Alistair Francis
@ 2021-10-20  1:05       ` Dmitry Torokhov
  2021-10-20  1:44         ` Alistair Francis
  0 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2021-10-20  1:05 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Ping Cheng, Alistair Francis, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > We already have touchscreen-inverted-x/y defined in
> > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > why are they not sufficient?
> 
> The touchscreen-* properties aren't applied to HID devices though, at
> least not that I can tell.

No, they are not currently, but that does not mean we need to establish
a new set of properties (property names) for HID case.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20  1:05       ` Dmitry Torokhov
@ 2021-10-20  1:44         ` Alistair Francis
  2021-10-20  2:14           ` Dmitry Torokhov
  0 siblings, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-20  1:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Alistair Francis, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > We already have touchscreen-inverted-x/y defined in
> > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > why are they not sufficient?
> >
> > The touchscreen-* properties aren't applied to HID devices though, at
> > least not that I can tell.
>
> No, they are not currently, but that does not mean we need to establish
> a new set of properties (property names) for HID case.

I can update the names to use the existing touchscreen ones.

Do you have a hint of where this should be implemented though?

Right now (without "HID: wacom: Add support for the AG14 Wacom
device") the wacom touchscreen is just registered as a generic HID
device. I don't see any good place in hid-core, hid-input or
hid-generic to invert the input values for this.

Even with my "HID: wacom: Add support for the AG14 Wacom device" patch
I don't see a good way of doing this without the raw data parsing.

Alistair

>
> Thanks.

>
> --
> Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20  1:44         ` Alistair Francis
@ 2021-10-20  2:14           ` Dmitry Torokhov
  2021-10-20  7:40             ` Benjamin Tissoires
  2021-10-20 11:28             ` Alistair Francis
  0 siblings, 2 replies; 22+ messages in thread
From: Dmitry Torokhov @ 2021-10-20  2:14 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Ping Cheng, Alistair Francis, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > We already have touchscreen-inverted-x/y defined in
> > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > why are they not sufficient?
> > >
> > > The touchscreen-* properties aren't applied to HID devices though, at
> > > least not that I can tell.
> >
> > No, they are not currently, but that does not mean we need to establish
> > a new set of properties (property names) for HID case.
> 
> I can update the names to use the existing touchscreen ones.
> 
> Do you have a hint of where this should be implemented though?
> 
> Right now (without "HID: wacom: Add support for the AG14 Wacom
> device") the wacom touchscreen is just registered as a generic HID
> device. I don't see any good place in hid-core, hid-input or
> hid-generic to invert the input values for this.

I think the transformation should happen in
hid-multitouch.c::mt_process_slot() using helpers from
include/linux/input/touchscreen.h

I think the more challenging question is to how pass/attach struct
touchscreen_properties * to the hid device (i expect the properties will
be attached to i2c-hid device, but maybe we could create a sub-node of
it and attach properties there.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20  2:14           ` Dmitry Torokhov
@ 2021-10-20  7:40             ` Benjamin Tissoires
  2021-10-20 11:34               ` Alistair Francis
  2021-10-20 11:28             ` Alistair Francis
  1 sibling, 1 reply; 22+ messages in thread
From: Benjamin Tissoires @ 2021-10-20  7:40 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Alistair Francis, Ping Cheng, Alistair Francis, Shawn Guo,
	Sascha Hauer, dl-linux-imx, Jiri Kosina, linux-input, devicetree,
	LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 4:14 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > We already have touchscreen-inverted-x/y defined in
> > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > why are they not sufficient?
> > > >
> > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > least not that I can tell.
> > >
> > > No, they are not currently, but that does not mean we need to establish
> > > a new set of properties (property names) for HID case.
> >
> > I can update the names to use the existing touchscreen ones.
> >
> > Do you have a hint of where this should be implemented though?
> >
> > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > device") the wacom touchscreen is just registered as a generic HID
> > device. I don't see any good place in hid-core, hid-input or
> > hid-generic to invert the input values for this.
>
> I think the transformation should happen in
> hid-multitouch.c::mt_process_slot() using helpers from
> include/linux/input/touchscreen.h
>
> I think the more challenging question is to how pass/attach struct
> touchscreen_properties * to the hid device (i expect the properties will
> be attached to i2c-hid device, but maybe we could create a sub-node of
> it and attach properties there.
>

Sorry but I don't like that very much. This would mean that we have an
out of band information that needs to be carried over to
HID-generic/multitouch and having tests for it is going to be harder.
I would rather have userspace deal with the rotation if we do not have
the information from the device itself.

Foreword: I have been given a hammer, so I see nails everywhere.

The past 3 weeks I have been working on implementing some eBPF hooks
in the HID subsystem. This would IMO be the best solution here: a udev
hwdb rule sees that there is the not-wacom PID/VID (and maybe the
platform or parses the OF properties if they are available in the
sysfs) and adds a couple of functions in the HID stack to rotate the
screen. The advantage is that we do not need to add a new kernel API
anymore, the disadvantage is that we need userspace to "fix" the
kernel behaviour (so at boot, this might be an issue).

I am not at the point where I can share the code as there is a lot of
rewriting and my last attempt is resulting in a page fault, but I'd be
happy to share it more once that hiccup is solved.

Cheers,
Benjamin


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20  2:14           ` Dmitry Torokhov
  2021-10-20  7:40             ` Benjamin Tissoires
@ 2021-10-20 11:28             ` Alistair Francis
  2021-10-20 11:46               ` Benjamin Tissoires
  1 sibling, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-20 11:28 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Ping Cheng, Alistair Francis, Shawn Guo, Sascha Hauer,
	dl-linux-imx, Jiri Kosina, Benjamin Tissoires, linux-input,
	devicetree, LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 12:14 PM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > We already have touchscreen-inverted-x/y defined in
> > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > why are they not sufficient?
> > > >
> > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > least not that I can tell.
> > >
> > > No, they are not currently, but that does not mean we need to establish
> > > a new set of properties (property names) for HID case.
> >
> > I can update the names to use the existing touchscreen ones.
> >
> > Do you have a hint of where this should be implemented though?
> >
> > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > device") the wacom touchscreen is just registered as a generic HID
> > device. I don't see any good place in hid-core, hid-input or
> > hid-generic to invert the input values for this.
>
> I think the transformation should happen in
> hid-multitouch.c::mt_process_slot() using helpers from
> include/linux/input/touchscreen.h

Thanks for the help!

I have managed to get the device to be a hid-multitouch (instead of
hid-generic).

I also think I have figured out a way to get the properties to
hid-multitouch from the i2c-hid device. It requires a change to
touchscreen.c, but it's not a big change.

The main problem now is that hid-multitouch.c::mt_process_slot() isn't
actually called. The code just calls input_sync() from
hid-multitouch.c::mt_report(). It doesn't get to mt_process_slot() due
to rdata->is_mt_collection not being true. Setting
rdata->is_mt_collection to true causes userspace not to see the wacom
input any more.

Alistair

>
> I think the more challenging question is to how pass/attach struct
> touchscreen_properties * to the hid device (i expect the properties will
> be attached to i2c-hid device, but maybe we could create a sub-node of
> it and attach properties there.
>
> Thanks.
>
> --
> Dmitry

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20  7:40             ` Benjamin Tissoires
@ 2021-10-20 11:34               ` Alistair Francis
  2021-10-20 12:04                 ` Benjamin Tissoires
  0 siblings, 1 reply; 22+ messages in thread
From: Alistair Francis @ 2021-10-20 11:34 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Dmitry Torokhov, Ping Cheng, Alistair Francis, Shawn Guo,
	Sascha Hauer, dl-linux-imx, Jiri Kosina, linux-input, devicetree,
	LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 5:40 PM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> On Wed, Oct 20, 2021 at 4:14 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > >
> > > > > > We already have touchscreen-inverted-x/y defined in
> > > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > > why are they not sufficient?
> > > > >
> > > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > > least not that I can tell.
> > > >
> > > > No, they are not currently, but that does not mean we need to establish
> > > > a new set of properties (property names) for HID case.
> > >
> > > I can update the names to use the existing touchscreen ones.
> > >
> > > Do you have a hint of where this should be implemented though?
> > >
> > > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > > device") the wacom touchscreen is just registered as a generic HID
> > > device. I don't see any good place in hid-core, hid-input or
> > > hid-generic to invert the input values for this.
> >
> > I think the transformation should happen in
> > hid-multitouch.c::mt_process_slot() using helpers from
> > include/linux/input/touchscreen.h
> >
> > I think the more challenging question is to how pass/attach struct
> > touchscreen_properties * to the hid device (i expect the properties will
> > be attached to i2c-hid device, but maybe we could create a sub-node of
> > it and attach properties there.
> >
>
> Sorry but I don't like that very much. This would mean that we have an
> out of band information that needs to be carried over to
> HID-generic/multitouch and having tests for it is going to be harder.
> I would rather have userspace deal with the rotation if we do not have
> the information from the device itself.

My 2c below

>
> Foreword: I have been given a hammer, so I see nails everywhere.
>
> The past 3 weeks I have been working on implementing some eBPF hooks
> in the HID subsystem. This would IMO be the best solution here: a udev
> hwdb rule sees that there is the not-wacom PID/VID (and maybe the
> platform or parses the OF properties if they are available in the

I'm not sure we have a specific VID/PID to work with here. The VID is
generic AFAIK, not sure about the PID though. Maybe someone from Wacom
could confirm either way.

> sysfs) and adds a couple of functions in the HID stack to rotate the
> screen. The advantage is that we do not need to add a new kernel API

I would say that touchscreen-inverted-x/y isn't a new API, it's
commonly used. To me it makes sense that it's supported for all
touchscreens.

> anymore, the disadvantage is that we need userspace to "fix" the
> kernel behaviour (so at boot, this might be an issue).

That's a pain for me. I'm still stuck with the vendors userspace as I
need their propiritory eInk driver code. It also seems like a hassle
for different distros to handle this (compared to just in the DT).

Alistair

>
> I am not at the point where I can share the code as there is a lot of
> rewriting and my last attempt is resulting in a page fault, but I'd be
> happy to share it more once that hiccup is solved.
>
> Cheers,
> Benjamin
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20 11:28             ` Alistair Francis
@ 2021-10-20 11:46               ` Benjamin Tissoires
  0 siblings, 0 replies; 22+ messages in thread
From: Benjamin Tissoires @ 2021-10-20 11:46 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Dmitry Torokhov, Ping Cheng, Alistair Francis, Shawn Guo,
	Sascha Hauer, dl-linux-imx, Jiri Kosina, linux-input, devicetree,
	LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 1:28 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Wed, Oct 20, 2021 at 12:14 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > >
> > > > > > We already have touchscreen-inverted-x/y defined in
> > > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > > why are they not sufficient?
> > > > >
> > > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > > least not that I can tell.
> > > >
> > > > No, they are not currently, but that does not mean we need to establish
> > > > a new set of properties (property names) for HID case.
> > >
> > > I can update the names to use the existing touchscreen ones.
> > >
> > > Do you have a hint of where this should be implemented though?
> > >
> > > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > > device") the wacom touchscreen is just registered as a generic HID
> > > device. I don't see any good place in hid-core, hid-input or
> > > hid-generic to invert the input values for this.
> >
> > I think the transformation should happen in
> > hid-multitouch.c::mt_process_slot() using helpers from
> > include/linux/input/touchscreen.h
>
> Thanks for the help!
>
> I have managed to get the device to be a hid-multitouch (instead of
> hid-generic).
>
> I also think I have figured out a way to get the properties to
> hid-multitouch from the i2c-hid device. It requires a change to
> touchscreen.c, but it's not a big change.
>
> The main problem now is that hid-multitouch.c::mt_process_slot() isn't
> actually called. The code just calls input_sync() from
> hid-multitouch.c::mt_report(). It doesn't get to mt_process_slot() due
> to rdata->is_mt_collection not being true. Setting
> rdata->is_mt_collection to true causes userspace not to see the wacom
> input any more.

hid-multitouch now only handles the mutltitouch part. Everything else
is handled in hid-input.c
So if the device is just presenting a stylus to the user space, you
better not use hid-multitouch at all, but hid-generic.

Cheers,
Benjamin

>
> Alistair
>
> >
> > I think the more challenging question is to how pass/attach struct
> > touchscreen_properties * to the hid device (i expect the properties will
> > be attached to i2c-hid device, but maybe we could create a sub-node of
> > it and attach properties there.
> >
> > Thanks.
> >
> > --
> > Dmitry
>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20 11:34               ` Alistair Francis
@ 2021-10-20 12:04                 ` Benjamin Tissoires
  2021-10-21  9:27                   ` Alistair Francis
  0 siblings, 1 reply; 22+ messages in thread
From: Benjamin Tissoires @ 2021-10-20 12:04 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Dmitry Torokhov, Ping Cheng, Alistair Francis, Shawn Guo,
	Sascha Hauer, dl-linux-imx, Jiri Kosina, linux-input, devicetree,
	LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 1:34 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Wed, Oct 20, 2021 at 5:40 PM Benjamin Tissoires
> <benjamin.tissoires@redhat.com> wrote:
> >
> > On Wed, Oct 20, 2021 at 4:14 AM Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > >
> > > On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > > > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > > > <dmitry.torokhov@gmail.com> wrote:
> > > > >
> > > > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > >
> > > > > > > We already have touchscreen-inverted-x/y defined in
> > > > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > > > why are they not sufficient?
> > > > > >
> > > > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > > > least not that I can tell.
> > > > >
> > > > > No, they are not currently, but that does not mean we need to establish
> > > > > a new set of properties (property names) for HID case.
> > > >
> > > > I can update the names to use the existing touchscreen ones.
> > > >
> > > > Do you have a hint of where this should be implemented though?
> > > >
> > > > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > > > device") the wacom touchscreen is just registered as a generic HID
> > > > device. I don't see any good place in hid-core, hid-input or
> > > > hid-generic to invert the input values for this.
> > >
> > > I think the transformation should happen in
> > > hid-multitouch.c::mt_process_slot() using helpers from
> > > include/linux/input/touchscreen.h
> > >
> > > I think the more challenging question is to how pass/attach struct
> > > touchscreen_properties * to the hid device (i expect the properties will
> > > be attached to i2c-hid device, but maybe we could create a sub-node of
> > > it and attach properties there.
> > >
> >
> > Sorry but I don't like that very much. This would mean that we have an
> > out of band information that needs to be carried over to
> > HID-generic/multitouch and having tests for it is going to be harder.
> > I would rather have userspace deal with the rotation if we do not have
> > the information from the device itself.
>
> My 2c below
>
> >
> > Foreword: I have been given a hammer, so I see nails everywhere.
> >
> > The past 3 weeks I have been working on implementing some eBPF hooks
> > in the HID subsystem. This would IMO be the best solution here: a udev
> > hwdb rule sees that there is the not-wacom PID/VID (and maybe the
> > platform or parses the OF properties if they are available in the
>
> I'm not sure we have a specific VID/PID to work with here. The VID is
> generic AFAIK, not sure about the PID though. Maybe someone from Wacom
> could confirm either way.

It actually doesn't really matter. What matters is that there is a way
to know that this device needs to be rotated, being through DT
properties that would be exported through sysfs, or a hwdb entry that
matches on the product, the platform or something else.

>
> > sysfs) and adds a couple of functions in the HID stack to rotate the
> > screen. The advantage is that we do not need to add a new kernel API
>
> I would say that touchscreen-inverted-x/y isn't a new API, it's
> commonly used. To me it makes sense that it's supported for all
> touchscreens.

Well, it's new in the HID world, and this is opening the pandora box:
the patch adds only the equivalent of touchscreen-inverted-x/y, but
not touchscreen-swapped-x-y. So you can not actually rotate a screen
by 90 degrees.

Inverting a value on an axis is easy. Swapping 2 axes is way harder in
the HID world, because you have to interpret the report descriptor
differently.

Also, the patch adds 3 new properties: flip-tilt-x/y and flip-distance.
The tilt and distance would be easy, but suddenly we need to also add
pressure, and all of the other HID definitions. This is going to be
endless. It took me a while to understand Rob's point regarding
generic properties, but we are exactly entering this territory: this
is an endless chase and will never end.

I would much rather have a device specific quirk that would be
triggered by the DT than adding generic properties like that.

Also, hid-multitouch is the most tested driver through the hid-tools
test suite: https://gitlab.freedesktop.org/libevdev/hid-tools
I am not sure how I can add tests for those properties in a generic
way (the creation of the "virtual DT" is going to be problematic).

On the contrary, a device specific quirk can easily be tested without
having to mess too much with the hid subsystem.

>
> > anymore, the disadvantage is that we need userspace to "fix" the
> > kernel behaviour (so at boot, this might be an issue).
>
> That's a pain for me. I'm still stuck with the vendors userspace as I
> need their propiritory eInk driver code. It also seems like a hassle
> for different distros to handle this (compared to just in the DT).

I understand the pain. But I am not talking about a 1 kernel cycle
release timeframe. More like 6-12 months to bring in all the pieces
together. Distributions have no issues with udev most of the time
(even those that stuck to the old pre-systemd fork), and it would not
be different than having a udev intrinsic that tags the pen with
ID_INPUT_TABLET so libinput and others can deal with it.

Cheers,
Benjamin

>
> Alistair
>
> >
> > I am not at the point where I can share the code as there is a lot of
> > rewriting and my last attempt is resulting in a page fault, but I'd be
> > happy to share it more once that hiccup is solved.
> >
> > Cheers,
> > Benjamin
> >
>


^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values
  2021-10-20 12:04                 ` Benjamin Tissoires
@ 2021-10-21  9:27                   ` Alistair Francis
  0 siblings, 0 replies; 22+ messages in thread
From: Alistair Francis @ 2021-10-21  9:27 UTC (permalink / raw)
  To: Benjamin Tissoires
  Cc: Dmitry Torokhov, Ping Cheng, Alistair Francis, Shawn Guo,
	Sascha Hauer, dl-linux-imx, Jiri Kosina, linux-input, devicetree,
	LKML, linux-arm-kernel

On Wed, Oct 20, 2021 at 10:04 PM Benjamin Tissoires
<benjamin.tissoires@redhat.com> wrote:
>
> On Wed, Oct 20, 2021 at 1:34 PM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Wed, Oct 20, 2021 at 5:40 PM Benjamin Tissoires
> > <benjamin.tissoires@redhat.com> wrote:
> > >
> > > On Wed, Oct 20, 2021 at 4:14 AM Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > >
> > > > On Wed, Oct 20, 2021 at 11:44:50AM +1000, Alistair Francis wrote:
> > > > > On Wed, Oct 20, 2021 at 11:05 AM Dmitry Torokhov
> > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > >
> > > > > > On Wed, Oct 20, 2021 at 09:33:13AM +1000, Alistair Francis wrote:
> > > > > > > On Tue, Oct 19, 2021 at 11:51 AM Dmitry Torokhov
> > > > > > > <dmitry.torokhov@gmail.com> wrote:
> > > > > > > >
> > > > > > > > We already have touchscreen-inverted-x/y defined in
> > > > > > > > Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml,
> > > > > > > > why are they not sufficient?
> > > > > > >
> > > > > > > The touchscreen-* properties aren't applied to HID devices though, at
> > > > > > > least not that I can tell.
> > > > > >
> > > > > > No, they are not currently, but that does not mean we need to establish
> > > > > > a new set of properties (property names) for HID case.
> > > > >
> > > > > I can update the names to use the existing touchscreen ones.
> > > > >
> > > > > Do you have a hint of where this should be implemented though?
> > > > >
> > > > > Right now (without "HID: wacom: Add support for the AG14 Wacom
> > > > > device") the wacom touchscreen is just registered as a generic HID
> > > > > device. I don't see any good place in hid-core, hid-input or
> > > > > hid-generic to invert the input values for this.
> > > >
> > > > I think the transformation should happen in
> > > > hid-multitouch.c::mt_process_slot() using helpers from
> > > > include/linux/input/touchscreen.h
> > > >
> > > > I think the more challenging question is to how pass/attach struct
> > > > touchscreen_properties * to the hid device (i expect the properties will
> > > > be attached to i2c-hid device, but maybe we could create a sub-node of
> > > > it and attach properties there.
> > > >
> > >
> > > Sorry but I don't like that very much. This would mean that we have an
> > > out of band information that needs to be carried over to
> > > HID-generic/multitouch and having tests for it is going to be harder.
> > > I would rather have userspace deal with the rotation if we do not have
> > > the information from the device itself.
> >
> > My 2c below
> >
> > >
> > > Foreword: I have been given a hammer, so I see nails everywhere.
> > >
> > > The past 3 weeks I have been working on implementing some eBPF hooks
> > > in the HID subsystem. This would IMO be the best solution here: a udev
> > > hwdb rule sees that there is the not-wacom PID/VID (and maybe the
> > > platform or parses the OF properties if they are available in the
> >
> > I'm not sure we have a specific VID/PID to work with here. The VID is
> > generic AFAIK, not sure about the PID though. Maybe someone from Wacom
> > could confirm either way.
>
> It actually doesn't really matter. What matters is that there is a way
> to know that this device needs to be rotated, being through DT
> properties that would be exported through sysfs, or a hwdb entry that
> matches on the product, the platform or something else.
>
> >
> > > sysfs) and adds a couple of functions in the HID stack to rotate the
> > > screen. The advantage is that we do not need to add a new kernel API
> >
> > I would say that touchscreen-inverted-x/y isn't a new API, it's
> > commonly used. To me it makes sense that it's supported for all
> > touchscreens.
>
> Well, it's new in the HID world, and this is opening the pandora box:
> the patch adds only the equivalent of touchscreen-inverted-x/y, but
> not touchscreen-swapped-x-y. So you can not actually rotate a screen
> by 90 degrees.
>
> Inverting a value on an axis is easy. Swapping 2 axes is way harder in
> the HID world, because you have to interpret the report descriptor
> differently.
>
> Also, the patch adds 3 new properties: flip-tilt-x/y and flip-distance.

This patch does yes, but I'm happy to just drop this to the invert
touchscreen properties.

> The tilt and distance would be easy, but suddenly we need to also add
> pressure, and all of the other HID definitions. This is going to be
> endless. It took me a while to understand Rob's point regarding
> generic properties, but we are exactly entering this territory: this
> is an endless chase and will never end.
>
> I would much rather have a device specific quirk that would be
> triggered by the DT than adding generic properties like that.

That works for me!

A HID_QUIRK_XY_INVERT would work for me and seems useful for others in
the future as well.

I managed to figure out how to do this, I'll send a patch soon.

>
> Also, hid-multitouch is the most tested driver through the hid-tools
> test suite: https://gitlab.freedesktop.org/libevdev/hid-tools
> I am not sure how I can add tests for those properties in a generic
> way (the creation of the "virtual DT" is going to be problematic).
>
> On the contrary, a device specific quirk can easily be tested without
> having to mess too much with the hid subsystem.

Great!

Alistair

>
> >
> > > anymore, the disadvantage is that we need userspace to "fix" the
> > > kernel behaviour (so at boot, this might be an issue).
> >
> > That's a pain for me. I'm still stuck with the vendors userspace as I
> > need their propiritory eInk driver code. It also seems like a hassle
> > for different distros to handle this (compared to just in the DT).
>
> I understand the pain. But I am not talking about a 1 kernel cycle
> release timeframe. More like 6-12 months to bring in all the pieces
> together. Distributions have no issues with udev most of the time
> (even those that stuck to the old pre-systemd fork), and it would not
> be different than having a udev intrinsic that tags the pen with
> ID_INPUT_TABLET so libinput and others can deal with it.
>
> Cheers,
> Benjamin
>
> >
> > Alistair
> >
> > >
> > > I am not at the point where I can share the code as there is a lot of
> > > rewriting and my last attempt is resulting in a page fault, but I'd be
> > > happy to share it more once that hiccup is solved.
> > >
> > > Cheers,
> > > Benjamin
> > >
> >
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-10-21  9:27 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 11:43 [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Alistair Francis
2021-10-09 11:43 ` [PATCH v11 2/4] HID: wacom: Add support for the AG14 Wacom device Alistair Francis
2021-10-09 13:41   ` kernel test robot
2021-10-09 14:32   ` kernel test robot
2021-10-09 11:43 ` [PATCH v11 3/4] ARM: imx_v6_v7_defconfig: Enable HID I2C Alistair Francis
2021-10-15  2:50   ` Shawn Guo
2021-10-09 11:43 ` [PATCH v11 4/4] ARM: dts: imx7d: remarkable2: add wacom digitizer device Alistair Francis
2021-10-10  8:24   ` kernel test robot
2021-10-16 14:34 ` [PATCH v11 1/4] HID: wacom_sys: Add support for flipping the data values Rob Herring
     [not found] ` <CAF8JNh+OUzvAHA9tBrH2d_WxWPXRgiunhGO5KV4-fqVG+tUOyQ@mail.gmail.com>
2021-10-18 21:54   ` Alistair Francis
2021-10-19  1:50   ` Dmitry Torokhov
2021-10-19 22:57     ` Tobita, Tatsunosuke
2021-10-19 23:33     ` Alistair Francis
2021-10-20  1:05       ` Dmitry Torokhov
2021-10-20  1:44         ` Alistair Francis
2021-10-20  2:14           ` Dmitry Torokhov
2021-10-20  7:40             ` Benjamin Tissoires
2021-10-20 11:34               ` Alistair Francis
2021-10-20 12:04                 ` Benjamin Tissoires
2021-10-21  9:27                   ` Alistair Francis
2021-10-20 11:28             ` Alistair Francis
2021-10-20 11:46               ` Benjamin Tissoires

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).