Skip to content

Commit 2b2bcc7

Browse files
qzedJiri Kosina
authored andcommitted
HID: surface-hid: Fix get-report request
Getting a report (e.g. feature report) from a device requires us to send a request indicating which report we want to retrieve and then waiting for the corresponding response containing that report. We already provide the response structure to the request call, but the request isn't marked as a request that expects a response. Thus the request returns before we receive the response and the response buffer indicates a zero length response due to that. This essentially means that the get-report calls are broken and will always indicate that a report of length zero has been read. Fix this by appropriately marking the request. Fixes: b05ff10 ("HID: Add support for Surface Aggregator Module HID transport") Signed-off-by: Maximilian Luz <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent fb1a79a commit 2b2bcc7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/surface-hid/surface_hid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static int ssam_hid_get_raw_report(struct surface_hid_device *shid, u8 rprt_id,
143143
rqst.target_id = shid->uid.target;
144144
rqst.instance_id = shid->uid.instance;
145145
rqst.command_id = SURFACE_HID_CID_GET_FEATURE_REPORT;
146-
rqst.flags = 0;
146+
rqst.flags = SSAM_REQUEST_HAS_RESPONSE;
147147
rqst.length = sizeof(rprt_id);
148148
rqst.payload = &rprt_id;
149149

0 commit comments

Comments
 (0)