Skip to contentSkip to conversation

HID: input: enable Totem on the Dell Canvas 27

PATCH In review Benjamin Tissoires 4 participants 7 messages Nov 10, 2017 – Nov 16, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: input: enable Totem on the Dell Canvas 27

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads. Last, both Width and Heigth are groupped together, the FW reports similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
drivers/hid/hid-input.c +27 -1
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +11 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +6 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  * http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input-event-codes.h +1 -0
index 179891074b3c..f886499fdd4c 100644
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
Signature · 1 line
2.14.3
#1 lore raw

sorry, this one got stuck in my outbox.

Quoted 12 lines · Benjamin Tissoires

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

Quoted 6 lines

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads.

HID docs indicate this is a full tool rotation, so ABS_RZ would be more appropriate?

"Azimuth
The counter-clockwise rotation of the cursor about the Z-axis."

But you also say it has rotation, so this is a bit confusing now :) We should also use INPUT_PROP_DIRECT here.

Quoted 1 line

Last, both Width and Heigth are groupped together, the FW reports

typo: grouped

Quoted 11 lines

similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

I'm going to be annoying here and say I'd like to figure out how to add this to libinput first to figure out what details can go wrong before we merge it and commit to this forever. Hopefully that shouldn't take that long...

Cheers,
Peter

Quoted 145 lines

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
drivers/hid/hid-input.c +27 -1
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +11 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +6 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  * http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input-event-codes.h +1 -0
index 179891074b3c..f886499fdd4c 100644
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
Signature · 1 line
2.14.3
maintainer
#2 lore raw
Quoted 20 lines · Peter Hutterer

sorry, this one got stuck in my outbox.

Quoted 17 lines · Benjamin Tissoires

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

Quoted 7 lines
Quoted 1 line

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads.

HID docs indicate this is a full tool rotation, so ABS_RZ would be more appropriate?

"Azimuth
The counter-clockwise rotation of the cursor about the Z-axis."

Right. We night also want to consider whether we need to convert HID to Linux values, as HID is counter-clockwise, and I suspect Linux will be clockwise (what do we report for joysticks?), similar to what we had for ABS_MT_ORIENTATION.

Quoted 172 lines

But you also say it has rotation, so this is a bit confusing now :) We should also use INPUT_PROP_DIRECT here.

Quoted 1 line

Last, both Width and Heigth are groupped together, the FW reports

typo: grouped

Quoted 11 lines

similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

I'm going to be annoying here and say I'd like to figure out how to add this to libinput first to figure out what details can go wrong before we merge it and commit to this forever. Hopefully that shouldn't take that long...

Cheers,
Peter

Quoted 145 lines

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
drivers/hid/hid-input.c +27 -1
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +11 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +6 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  * http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input-event-codes.h +1 -0
index 179891074b3c..f886499fdd4c 100644
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
Signature · 1 line
2.14.3
Signature · 1 line
Dmitry
#3 lore raw
Quoted 26 lines · Dmitry Torokhov
Quoted 25 lines · Peter Hutterer

sorry, this one got stuck in my outbox.

Quoted 12 lines · Benjamin Tissoires

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

Quoted 6 lines

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads.

HID docs indicate this is a full tool rotation, so ABS_RZ would be more appropriate?

Quoted 32 lines
Quoted 2 lines

"Azimuth
The counter-clockwise rotation of the cursor about the Z-axis."

Right. We night also want to consider whether we need to convert HID to Linux values, as HID is counter-clockwise, and I suspect Linux will be clockwise (what do we report for joysticks?), similar to what we had for ABS_MT_ORIENTATION.

Quoted 24 lines

But you also say it has rotation, so this is a bit confusing now :) We should also use INPUT_PROP_DIRECT here.

Quoted 1 line

Last, both Width and Heigth are groupped together, the FW reports

typo: grouped

Quoted 11 lines

similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

I'm going to be annoying here and say I'd like to figure out how to add this to libinput first to figure out what details can go wrong before we merge it and commit to this forever. Hopefully that shouldn't take that long...

I had a chat with Peter this morning. TL;DR is I'll need to rework on this more heavily to provide the final version with MT axes, and skip the single device implementation. I have no ideas if the Dell Canvas can report more than one totem, but the report descriptor would say so, so we better have a proper implementation instead of having one for single device capable and one for multiple devices.

I'll probably send a v2 just to address the issues raised here, but it shouldn't be merged given that user space will not be accepting such version.

Cheers,
Benjamin

Quoted 148 lines
Quoted 145 lines
Quoted 145 lines

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
drivers/hid/hid-input.c +27 -1
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code)
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +11 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +6 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  * http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input-event-codes.h +1 -0
index 179891074b3c..f886499fdd4c 100644
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
Signature · 1 line
2.14.3
Signature · 1 line
Dmitry
#4 lore raw
Quoted 69 lines

-----Original Message-----
From: Benjamin Tissoires [mailto:[email protected]]
Sent: Wednesday, November 15, 2017 6:53 AM
To: Dmitry Torokhov <[email protected]>
Cc: Peter Hutterer <[email protected]>; Jiri Kosina <[email protected]>; Limonciello, Mario <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] HID: input: enable Totem on the Dell Canvas 27

Quoted 26 lines · Dmitry Torokhov
Quoted 25 lines · Peter Hutterer

sorry, this one got stuck in my outbox.

Quoted 12 lines · Benjamin Tissoires

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

Quoted 6 lines

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads.

HID docs indicate this is a full tool rotation, so ABS_RZ would be more appropriate?

Quoted 32 lines
Quoted 2 lines

"Azimuth
The counter-clockwise rotation of the cursor about the Z-axis."

Right. We night also want to consider whether we need to convert HID to Linux values, as HID is counter-clockwise, and I suspect Linux will be clockwise (what do we report for joysticks?), similar to what we had for ABS_MT_ORIENTATION.

Quoted 24 lines

But you also say it has rotation, so this is a bit confusing now :) We should also use INPUT_PROP_DIRECT here.

Quoted 1 line

Last, both Width and Heigth are groupped together, the FW reports

typo: grouped

Quoted 11 lines

similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

I'm going to be annoying here and say I'd like to figure out how to add this to libinput first to figure out what details can go wrong before we merge it and commit to this forever. Hopefully that shouldn't take that long...

Quoted 6 lines

I had a chat with Peter this morning. TL;DR is I'll need to rework on this more heavily to provide the final version with MT axes, and skip the single device implementation. I have no ideas if the Dell Canvas can report more than one totem, but the report descriptor would say so, so we better have a proper implementation instead of having one for single device capable and one for multiple devices.

The Canvas can only support one large totem at a time.

Quoted 165 lines

I'll probably send a v2 just to address the issues raised here, but it shouldn't be merged given that user space will not be accepting such version.

Cheers,
Benjamin

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
Quoted 5 lines
Quoted 5 lines

drivers/hid/hid-input.c __s32 hidinput_calc_abs_res(const struct hid_field

Quoted 5 lines
drivers/hid/hid-input.c +0 -0
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field

*field, __u16 code)

Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct

Quoted 8 lines
drivers/hid/hid-input.c +1 -0
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct

hid_input *hidinput, struct hid_fiel

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
drivers/hid/hid-input.c +4 -1
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/hid/hid-input.c +4 -0
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
Quoted 8 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct

Quoted 8 lines
drivers/hid/hid-input.c +4 -0
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct

hid_input *hidinput, struct hid_fiel

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
drivers/hid/hid-input.c +14 -0
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-multitouch.c static int mt_input_mapping(struct hid_device *hdev,

Quoted 8 lines
drivers/hid/hid-input.c +0 -0
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +0 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev,

struct hid_input *hi,

Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-multitouch.c static int mt_input_mapping(struct hid_device

Quoted 8 lines
drivers/hid/hid-multitouch.c +1 -0
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device

*hdev, struct hid_input *hi,

Quoted 15 lines
Quoted 15 lines

drivers/hid/hid-multitouch.c static int mt_input_configured(struct hid_device

Quoted 15 lines
drivers/hid/hid-multitouch.c +8 -0
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device

*hdev, struct hid_input *hi)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/hid/hid-multitouch.c +2 -0
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
Quoted 8 lines
Quoted 8 lines

include/linux/hid.h struct hid_item { · line 189

Quoted 8 lines
drivers/hid/hid-multitouch.c +0 -0
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +0 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  *

http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf

Quoted 5 lines
Quoted 5 lines

include/linux/hid.h struct hid_item {

Quoted 5 lines
include/linux/hid.h +3 -0
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-

_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt

Quoted 7 lines
Quoted 7 lines

include/uapi/linux/input-

Quoted 7 lines
include/linux/hid.h +3 -0
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input- renamed from include/uapi/linux/input-event-codes.h +0 -0

event-codes.h

Quoted 17 lines
Quoted 6 lines
Quoted 6 lines

index 179891074b3c..f886499fdd4c 100644

include/uapi/linux/input-event-codes.h +0 -0
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
Quoted 8 lines
Quoted 8 lines
include/uapi/linux/input-event-codes.h +1 -1
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
--

2.14.3

--
Dmitry

#5 lore raw
Quoted 69 lines · On Wed, Nov 15, 2017 at 02:42:40PM +0000, [email protected] wrote:
Quoted 69 lines

-----Original Message-----
From: Benjamin Tissoires [mailto:[email protected]]
Sent: Wednesday, November 15, 2017 6:53 AM
To: Dmitry Torokhov <[email protected]>
Cc: Peter Hutterer <[email protected]>; Jiri Kosina <[email protected]>; Limonciello, Mario <[email protected]>; [email protected]; [email protected]
Subject: Re: [PATCH] HID: input: enable Totem on the Dell Canvas 27

Quoted 58 lines · Dmitry Torokhov
Quoted 20 lines · Peter Hutterer

sorry, this one got stuck in my outbox.

Quoted 17 lines · Benjamin Tissoires

The Dell Canvas 27 has a tool that can be put on the surface and acts as a dial. The firmware processes the detection of the tool and forward regular HID reports with X, Y, Azimuth, rotation, width/height.

The firmware also exports Contact ID, Countact Count which may hint that several totems can be used at the same time, but for now, only allow one totem at a time.

We also ignore scan time in hid-input.c because there is not much point to forward it now given that the indication of the tool being present is already provided through BTN_TOOL_DIAL.

We need to add a new BTN_TOOL_DIAL event because the HID mapping suggests that this tool is aimed at being used by the system and not the applications. Also this prevents current systemd heuristics to apply ID_INPUT_TOUCHSCREEN to this new type of devices.

Quoted 7 lines
Quoted 1 line

I mapped Azimuth to ABS_WHEEL to somehow ressemble the Wacom Pads.

HID docs indicate this is a full tool rotation, so ABS_RZ would be more appropriate?

"Azimuth
The counter-clockwise rotation of the cursor about the Z-axis."

Right. We night also want to consider whether we need to convert HID to Linux values, as HID is counter-clockwise, and I suspect Linux will be clockwise (what do we report for joysticks?), similar to what we had for ABS_MT_ORIENTATION.

Quoted 24 lines

But you also say it has rotation, so this is a bit confusing now :) We should also use INPUT_PROP_DIRECT here.

Quoted 1 line

Last, both Width and Heigth are groupped together, the FW reports

typo: grouped

Quoted 11 lines

similar values for both and we are out of ABS_* events.

---

Hi,

This is probably v4.16 material as we are close to the merge window (I wouldn't mind it applied in v4.15 though ;-P)

I'm going to be annoying here and say I'd like to figure out how to add this to libinput first to figure out what details can go wrong before we merge it and commit to this forever. Hopefully that shouldn't take that long...

Quoted 8 lines
Quoted 6 lines

I had a chat with Peter this morning. TL;DR is I'll need to rework on this more heavily to provide the final version with MT axes, and skip the single device implementation. I have no ideas if the Dell Canvas can report more than one totem, but the report descriptor would say so, so we better have a proper implementation instead of having one for single device capable and one for multiple devices.

The Canvas can only support one large totem at a time.

that's the current version but I doubt this will remain so for the upcoming years. We can support one totem through the MT protocol but it'll be hard to support multiple totems through the single touch protocol. So better safe than sorry.

Cheers,
Peter

Quoted 165 lines
Quoted 164 lines

I'll probably send a v2 just to address the issues raised here, but it shouldn't be merged given that user space will not be accepting such version.

Cheers,
Benjamin

Quoted 18 lines
Quoted 18 lines
Quoted 18 lines

The patch does the job but we probably need to decide if the mappings I chose are correct.

For the record, I uploaded some evemu-record traces and hid-recorder traces in the RH Bz linked above to keep traces of them. The interesting one is the evemu one for the totem with this patch applied:
https://bugzilla.redhat.com/attachment.cgi?id=1350389

Cheers,
Benjamin

 drivers/hid/hid-input.c                | 28 +++++++++++++++++++++++++++-
 drivers/hid/hid-multitouch.c           | 11 +++++++++++
 include/linux/hid.h                    |  6 ++++++
 include/uapi/linux/input-event-codes.h |  1 +
 4 files changed, 45 insertions(+), 1 deletion(-)
Quoted 5 lines
Quoted 5 lines

drivers/hid/hid-input.c __s32 hidinput_calc_abs_res(const struct hid_field

Quoted 5 lines
drivers/hid/hid-input.c +0 -0
index 04d01b57d94c..7da72b571b7d 100644
@@ -229,6 +229,7 @@ __s32 hidinput_calc_abs_res(const struct hid_field

*field, __u16 code)

Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct

Quoted 8 lines
drivers/hid/hid-input.c +1 -0
 	case ABS_X:
 	case ABS_Y:
 	case ABS_Z:
+	case ABS_TOOL_WIDTH:
 	case ABS_MT_POSITION_X:
 	case ABS_MT_POSITION_Y:
 	case ABS_MT_TOOL_X:
@@ -786,13 +787,24 @@ static void hidinput_configure_usage(struct

hid_input *hidinput, struct hid_fiel

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
drivers/hid/hid-input.c +4 -1
 			map_abs_clear(ABS_TILT_Y);
 			break;
 
+		case 0x3f: /* Azimuth */
+			map_abs_clear(ABS_WHEEL);
+			break;
+
 		case 0x33: /* Touch */
-		case 0x42: /* TipSwitch */
 		case 0x43: /* TipSwitch2 */
 			device->quirks &= ~HID_QUIRK_NOTOUCH;
 			map_key_clear(BTN_TOUCH);
 			break;
 
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/hid/hid-input.c +4 -0
+		case 0x42: /* TipSwitch */
+			if (field->application == HID_GD_SYSTEM_MULTIAXIS) {
+				map_key_clear(BTN_TOOL_DIAL);
+			} else {
Quoted 8 lines

drivers/hid/hid-input.c static void hidinput_configure_usage(struct

Quoted 8 lines
drivers/hid/hid-input.c +4 -0
+				device->quirks &= ~HID_QUIRK_NOTOUCH;
+				map_key_clear(BTN_TOUCH);
+			}
+			break;
 		case 0x44: /* BarrelSwitch */
 			map_key_clear(BTN_STYLUS);
 			break;
@@ -806,6 +818,20 @@ static void hidinput_configure_usage(struct

hid_input *hidinput, struct hid_fiel

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
drivers/hid/hid-input.c +14 -0
 			map_key_clear(BTN_TOUCH);
 			break;
 
+		case 0x48: /* WIDTH */
+		case 0x49: /* HEIGHT */
+			map_abs_clear(ABS_TOOL_WIDTH);
+			break;
+
+		case 0x51: /* CONTACT ID */
+			goto ignore;
+
+		case 0x54: /* CONTACT COUNT */
+			goto ignore;
+
+		case 0x56: /* SCANTIME */
+			goto ignore;
+
Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-multitouch.c static int mt_input_mapping(struct hid_device *hdev,

Quoted 8 lines
drivers/hid/hid-input.c +0 -0
 		case 0x46: /* TabletPick */
 		case 0x5a: /* SecondaryBarrelSwitch */
 			map_key_clear(BTN_STYLUS2);
drivers/hid/hid-multitouch.c +0 -0
index 65ea23be9677..a0b332518eaa 100644
@@ -974,6 +974,7 @@ static int mt_input_mapping(struct hid_device *hdev,

struct hid_input *hi,

Quoted 8 lines
Quoted 8 lines

drivers/hid/hid-multitouch.c static int mt_input_mapping(struct hid_device

Quoted 8 lines
drivers/hid/hid-multitouch.c +1 -0
 	    field->application != HID_DG_TOUCHPAD &&
 	    field->application != HID_GD_KEYBOARD &&
 	    field->application != HID_GD_SYSTEM_CONTROL &&
+	    field->application != HID_GD_SYSTEM_MULTIAXIS &&
 	    field->application != HID_CP_CONSUMER_CONTROL &&
 	    field->application != HID_GD_WIRELESS_RADIO_CTLS &&
 	    !(field->application == HID_VD_ASUS_CUSTOM_MEDIA_KEYS &&
@@ -1003,6 +1004,14 @@ static int mt_input_mapping(struct hid_device

*hdev, struct hid_input *hi,

Quoted 15 lines
Quoted 15 lines

drivers/hid/hid-multitouch.c static int mt_input_configured(struct hid_device

Quoted 15 lines
drivers/hid/hid-multitouch.c +8 -0
 		return 1;
 	}
 
+	/*
+	 * We do not want to export scantime on System MultiAxis
+	 * for now
+	 */
+	if (field->usage->hid == HID_DG_SCANTIME &&
+	    field->application == HID_GD_SYSTEM_MULTIAXIS)
+		return -1;
+
 	/*
 	 * some egalax touchscreens have "application == HID_DG_TOUCHSCREEN"
 	 * for the stylus.
@@ -1193,6 +1202,8 @@ static int mt_input_configured(struct hid_device

*hdev, struct hid_input *hi)

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/hid/hid-multitouch.c +2 -0
 			break;
 		case HID_GD_MOUSE:
 			suffix = "Mouse";
+		case HID_GD_SYSTEM_MULTIAXIS:
+			suffix = "MultiAxis";
 			break;
Quoted 8 lines
Quoted 8 lines

include/linux/hid.h struct hid_item { · line 189

Quoted 8 lines
drivers/hid/hid-multitouch.c +0 -0
 		case HID_DG_STYLUS:
 			suffix = "Pen";
include/linux/hid.h +0 -0
index d491027a7c22..f93ebbe2f23d 100644
@@ -189,6 +189,12 @@ struct hid_item {
  *

http://www.usb.org/developers/hidpage/HUTRR40RadioHIDUsagesFinal.pdf

Quoted 5 lines
Quoted 5 lines

include/linux/hid.h struct hid_item {

Quoted 5 lines
include/linux/hid.h +3 -0
  */
 #define HID_GD_WIRELESS_RADIO_CTLS	0x0001000c
+/*
+ * System Multi-Axis, see:
+ * http://www.usb.org/developers/hidpage/HUTRR62_-

_Generic_Desktop_CA_for_System_Multi-Axis_Controllers.txt

Quoted 7 lines
Quoted 7 lines

include/uapi/linux/input-

Quoted 7 lines
include/linux/hid.h +3 -0
+ */
+#define HID_GD_SYSTEM_MULTIAXIS	0x0001000e
+
 #define HID_GD_X		0x00010030
 #define HID_GD_Y		0x00010031
 #define HID_GD_Z		0x00010032
include/uapi/linux/input- renamed from include/uapi/linux/input-event-codes.h +0 -0

event-codes.h

Quoted 17 lines
Quoted 6 lines
Quoted 6 lines

index 179891074b3c..f886499fdd4c 100644

include/uapi/linux/input-event-codes.h +0 -0
@@ -406,6 +406,7 @@
 #define BTN_TOOL_MOUSE		0x146
 #define BTN_TOOL_LENS		0x147
Quoted 8 lines
Quoted 8 lines
include/uapi/linux/input-event-codes.h +1 -1
 #define BTN_TOOL_QUINTTAP	0x148	/* Five fingers on trackpad */
+#define BTN_TOOL_DIAL		0x149	/* System MultiAxis */
 #define BTN_TOUCH		0x14a
 #define BTN_STYLUS		0x14b
 #define BTN_STYLUS2		0x14c
--

2.14.3

--
Dmitry

#6 lore raw
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

I had a chat with Peter this morning. TL;DR is I'll need to rework on this more heavily to provide the final version with MT axes, and skip the single device implementation. I have no ideas if the Dell Canvas can report more than one totem, but the report descriptor would say so, so we better have a proper implementation instead of having one for single device capable and one for multiple devices.

Quoted 7 lines
Quoted 1 line

The Canvas can only support one large totem at a time.

that's the current version but I doubt this will remain so for the upcoming years. We can support one totem through the MT protocol but it'll be hard to support multiple totems through the single touch protocol. So better safe than sorry.

As I'm told the limitation is a function of what Windows 10 supports.