Merge tag 'arm-dt-5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / include / linux / hid.h
index 10e922c..9e067f9 100644 (file)
@@ -102,6 +102,7 @@ struct hid_item {
 #define HID_COLLECTION_PHYSICAL                0
 #define HID_COLLECTION_APPLICATION     1
 #define HID_COLLECTION_LOGICAL         2
+#define HID_COLLECTION_NAMED_ARRAY     4
 
 /*
  * HID report descriptor global item tags
@@ -800,6 +801,7 @@ struct hid_driver {
  * @raw_request: send raw report request to device (e.g. feature report)
  * @output_report: send output report to device
  * @idle: send idle request to device
+ * @may_wakeup: return if device may act as a wakeup source during system-suspend
  */
 struct hid_ll_driver {
        int (*start)(struct hid_device *hdev);
@@ -824,6 +826,7 @@ struct hid_ll_driver {
        int (*output_report) (struct hid_device *hdev, __u8 *buf, size_t len);
 
        int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype);
+       bool (*may_wakeup)(struct hid_device *hdev);
 };
 
 extern struct hid_ll_driver i2c_hid_ll_driver;
@@ -1149,6 +1152,22 @@ static inline int hid_hw_idle(struct hid_device *hdev, int report, int idle,
        return 0;
 }
 
+/**
+ * hid_may_wakeup - return if the hid device may act as a wakeup source during system-suspend
+ *
+ * @hdev: hid device
+ */
+static inline bool hid_hw_may_wakeup(struct hid_device *hdev)
+{
+       if (hdev->ll_driver->may_wakeup)
+               return hdev->ll_driver->may_wakeup(hdev);
+
+       if (hdev->dev.parent)
+               return device_may_wakeup(hdev->dev.parent);
+
+       return false;
+}
+
 /**
  * hid_hw_wait - wait for buffered io to complete
  *