Skip to content

Commit 0ef89a8

Browse files
marcanjannau
authored andcommitted
fixup! hid: Add Apple DockChannel HID transport driver
1 parent d17f006 commit 0ef89a8

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

drivers/hid/dockchannel-hid/dockchannel-hid.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ struct dchid_hdr {
4343
#define FLAGS_GROUP GENMASK(7, 6)
4444
#define FLAGS_REQ GENMASK(5, 0)
4545

46-
#define GROUP_INPUT 0
47-
#define GROUP_OUTPUT 1
48-
#define GROUP_CMD 2
49-
5046
#define REQ_SET_REPORT 0
5147
#define REQ_GET_REPORT 1
5248

@@ -360,7 +356,7 @@ static int dchid_cmd(struct dchid_iface *iface, u32 type, u32 req,
360356

361357
static int dchid_comm_cmd(struct dockchannel_hid *dchid, void *cmd, size_t size)
362358
{
363-
return dchid_cmd(dchid->comm, GROUP_CMD, REQ_SET_REPORT, cmd, size, NULL, 0);
359+
return dchid_cmd(dchid->comm, HID_FEATURE_REPORT, REQ_SET_REPORT, cmd, size, NULL, 0);
364360
}
365361

366362
static int dchid_enable_interface(struct dchid_iface *iface)
@@ -590,15 +586,15 @@ static int dchid_parse(struct hid_device *hdev)
590586
/* Note: buf excludes report number! For ease of fetching strings/etc. */
591587
static int dchid_get_report_cmd(struct dchid_iface *iface, u8 reportnum, void *buf, size_t len)
592588
{
593-
int ret = dchid_cmd(iface, GROUP_CMD, REQ_GET_REPORT, &reportnum, 1, buf, len);
589+
int ret = dchid_cmd(iface, HID_FEATURE_REPORT, REQ_GET_REPORT, &reportnum, 1, buf, len);
594590

595591
return ret <= 0 ? ret : ret - 1;
596592
}
597593

598594
/* Note: buf includes report number! */
599595
static int dchid_set_report(struct dchid_iface *iface, void *buf, size_t len)
600596
{
601-
return dchid_cmd(iface, GROUP_OUTPUT, REQ_SET_REPORT, buf, len, NULL, 0);
597+
return dchid_cmd(iface, HID_OUTPUT_REPORT, REQ_SET_REPORT, buf, len, NULL, 0);
602598
}
603599

604600
static int dchid_raw_request(struct hid_device *hdev,
@@ -610,7 +606,7 @@ static int dchid_raw_request(struct hid_device *hdev,
610606
switch (reqtype) {
611607
case HID_REQ_GET_REPORT:
612608
buf[0] = reportnum;
613-
return dchid_cmd(iface, GROUP_OUTPUT, REQ_GET_REPORT, &reportnum, 1, buf + 1, len - 1);
609+
return dchid_cmd(iface, rtype, REQ_GET_REPORT, &reportnum, 1, buf + 1, len - 1);
614610
case HID_REQ_SET_REPORT:
615611
return dchid_set_report(iface, buf, len);
616612
default:
@@ -965,7 +961,7 @@ static void dchid_packet_work(struct work_struct *ws)
965961
}
966962

967963
switch (type) {
968-
case GROUP_INPUT:
964+
case HID_INPUT_REPORT:
969965
if (work->hdr.iface == IFACE_COMM)
970966
dchid_handle_event(dchid, payload, shdr->length);
971967
else

0 commit comments

Comments
 (0)