__le16 reg;
__u8 reportTypeID;
__u8 opcode;
+ __u8 reportID;
} __packed c;
};
if (length > 2) {
cmd->c.opcode = command->opcode;
- cmd->c.reportTypeID = reportID | reportType << 4;
+ if (reportID < 0x0F) {
+ cmd->c.reportTypeID = reportType << 4 | reportID;
+ } else {
+ cmd->c.reportTypeID = reportType << 4 | 0x0F;
+ cmd->c.reportID = reportID;
+ length++;
+ }
}
memcpy(cmd->data + length, args, args_len);
u8 reportID, unsigned char *buf_recv, int data_len)
{
struct i2c_hid *ihid = i2c_get_clientdata(client);
- u8 args[3];
+ u8 args[2];
int ret;
int args_len = 0;
u16 readRegister = le16_to_cpu(ihid->hdesc.wDataRegister);
i2c_hid_dbg(ihid, "%s\n", __func__);
- if (reportID >= 0x0F) {
- args[args_len++] = reportID;
- reportID = 0x0F;
- }
-
args[args_len++] = readRegister & 0xFF;
args[args_len++] = readRegister >> 8;
size = 2 /* size */ +
(reportID ? 1 : 0) /* reportID */ +
data_len /* buf */;
- args_len = (reportID >= 0x0F ? 1 : 0) /* optional third byte */ +
- 2 /* dataRegister */ +
+ args_len = 2 /* dataRegister */ +
size /* args */;
if (!use_data && maxOutputLength == 0)
return -ENOSYS;
- if (reportID >= 0x0F) {
- args[index++] = reportID;
- reportID = 0x0F;
- }
-
/*
* use the data register for feature reports or if the device does not
* support the output register