]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/hid.h
Merge branches 'for-3.19/hid-report-len', 'for-3.19/i2c-hid', 'for-3.19/lenovo',...
[mirror_ubuntu-artful-kernel.git] / include / linux / hid.h
index 58a89ed86acc2cace0486c1faa6fb3239ff2a1ab..06c4607744f637156d14a667b9b5b55f0a37b693 100644 (file)
@@ -339,11 +339,8 @@ struct hid_item {
  * Vendor specific HID device groups
  */
 #define HID_GROUP_RMI                          0x0100
-
-/*
- * Vendor specific HID device groups
- */
 #define HID_GROUP_WACOM                                0x0101
+#define HID_GROUP_LOGITECH_DJ_DEVICE           0x0102
 
 /*
  * This is the global environment of the parser. This information is
@@ -1090,6 +1087,17 @@ static inline void hid_hw_wait(struct hid_device *hdev)
                hdev->ll_driver->wait(hdev);
 }
 
+/**
+ * hid_report_len - calculate the report length
+ *
+ * @report: the report we want to know the length
+ */
+static inline int hid_report_len(struct hid_report *report)
+{
+       /* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */
+       return ((report->size - 1) >> 3) + 1 + (report->id > 0);
+}
+
 int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
                int interrupt);