From: Andrew Shadura <hidden> Date: 2015-07-20 12:08:17
PenMount USB resistive touchscreen reports it has three buttons, while in reality
it doesn't have any and doesn't support active styli, and only generates touch
events.
Signed-off-by: Andrew Shadura <redacted>
---
drivers/hid/hid-penmount.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -30,6 +30,21 @@ static int penmount_input_mapping(struct hid_device *hdev,return0;}+static__u8*penmount_report_fixup(structhid_device*hdev,__u8*rdesc,+unsignedint*rsize)+{+if(*rsize==76&&+rdesc[2]==0x09&&rdesc[3]==0x02/* mouse */&&+rdesc[22]==0x05&&rdesc[23]==0x09/* button */&&+rdesc[26]==0x29&&rdesc[27]==0x03/* maximum */){+hid_info(hdev,+"fixing up PenMount USB touchscreen report descriptor\n");++rdesc[27]=0x01;/* just one button */+}+returnrdesc;+}+staticconststructhid_device_idpenmount_devices[]={{HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT,USB_DEVICE_ID_PENMOUNT_6000)},{}
From: Andrew Shadura <hidden> Date: 2015-07-23 16:20:28
PenMount USB resistive touchscreen reports it has three buttons, while in reality
it doesn't have any and doesn't support active styli, and only generates touch
events.
Signed-off-by: Andrew Shadura <redacted>
---
drivers/hid/hid-penmount.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -30,6 +30,23 @@ static int penmount_input_mapping(struct hid_device *hdev,return0;}+static__u8*penmount_report_fixup(structhid_device*hdev,__u8*rdesc,+unsignedint*rsize)+{+if(*rsize==76&&+rdesc[2]==0x09&&rdesc[3]==0x02/* mouse */&&+rdesc[22]==0x05&&rdesc[23]==0x09/* button */&&+rdesc[26]==0x29&&rdesc[27]==0x03/* maximum */&&+rdesc[32]==0x95&&rdesc[33]==0x02/* report count */){+hid_info(hdev,+"fixing up PenMount USB touchscreen report descriptor\n");++rdesc[27]=0x01;/* just one button */+rdesc[33]=0x01;/* just one report */+}+returnrdesc;+}+staticconststructhid_device_idpenmount_devices[]={{HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT,USB_DEVICE_ID_PENMOUNT_6000)},{}
From: Benjamin Tissoires <hidden> Date: 2015-10-13 14:08:02
Hi Andrew,
[resurrecting this following a ping from Andrew]
On Thu, Jul 23, 2015 at 12:20 PM, Andrew Shadura
[off-list ref] wrote:
quoted hunk
PenMount USB resistive touchscreen reports it has three buttons, while in reality
it doesn't have any and doesn't support active styli, and only generates touch
events.
Signed-off-by: Andrew Shadura <redacted>
---
drivers/hid/hid-penmount.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -30,6 +30,23 @@ static int penmount_input_mapping(struct hid_device *hdev,return0;}+static__u8*penmount_report_fixup(structhid_device*hdev,__u8*rdesc,+unsignedint*rsize)+{+if(*rsize==76&&+rdesc[2]==0x09&&rdesc[3]==0x02/* mouse */&&+rdesc[22]==0x05&&rdesc[23]==0x09/* button */&&+rdesc[26]==0x29&&rdesc[27]==0x03/* maximum */&&+rdesc[32]==0x95&&rdesc[33]==0x02/* report count */){+hid_info(hdev,+"fixing up PenMount USB touchscreen report descriptor\n");++rdesc[27]=0x01;/* just one button */+rdesc[33]=0x01;/* just one report */
This is wrong. Changing this value shifts all the parsing of the rest
of the report descriptor. So if this is the last field in the current
report, then it might work. If not, then you are screwing the rest of
the report.
You can have 2 solutions to fix that:
- either you still use a report fixup and you add an extra const field
with a vendor usage page after this one (but that means allocating a
new report descriptor slightly larger)
- either you don't use a report fixup at all and ignore the extra
buttons in .input_mapping().
Cheers,
Benjamin
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html