summaryrefslogtreecommitdiff
path: root/backport-include/linux/hid.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2019-03-04 12:01:54 +0100
committerDominik Sliwa <dominik.sliwa@toradex.com>2019-03-04 12:01:54 +0100
commit348fa3f6871f56a37dcd16c99ca98118c6d79a38 (patch)
tree6fcae7785bae4ffb838fd6549f7d01ba6abf0763 /backport-include/linux/hid.h
Backports v4.19.24
Backports generated by toradex backports 515a1fa55cda2b1d952872e1786857481bd54fcc against mainline kernel tag v4.19.24 Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/linux/hid.h')
-rw-r--r--backport-include/linux/hid.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/backport-include/linux/hid.h b/backport-include/linux/hid.h
new file mode 100644
index 0000000..887c6b1
--- /dev/null
+++ b/backport-include/linux/hid.h
@@ -0,0 +1,87 @@
+#ifndef __BACKPORT_HID_H
+#define __BACKPORT_HID_H
+#include_next <linux/hid.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(3,8,0)
+#define hid_ignore LINUX_BACKPORT(hid_ignore)
+extern bool hid_ignore(struct hid_device *);
+#endif
+
+#if LINUX_VERSION_IS_LESS(3,1,0)
+#define HID_TYPE_USBNONE 2
+#endif
+
+#ifndef HID_QUIRK_NO_IGNORE
+#define HID_QUIRK_NO_IGNORE 0x40000000
+#endif
+
+#ifndef HID_QUIRK_HIDDEV_FORCE
+#define HID_QUIRK_HIDDEV_FORCE 0x00000010
+#endif
+
+#ifndef HID_QUIRK_IGNORE
+#define HID_QUIRK_IGNORE 0x00000004
+#endif
+
+#ifndef HID_USB_DEVICE
+#define HID_USB_DEVICE(ven, prod) \
+ .bus = BUS_USB, .vendor = (ven), .product = (prod)
+#endif
+
+#ifndef HID_BLUETOOTH_DEVICE
+#define HID_BLUETOOTH_DEVICE(ven, prod) \
+ .bus = BUS_BLUETOOTH, .vendor = (ven), .product = (prod)
+#endif
+
+#ifndef hid_printk
+#define hid_printk(level, hid, fmt, arg...) \
+ dev_printk(level, &(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_emerg
+#define hid_emerg(hid, fmt, arg...) \
+ dev_emerg(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_crit
+#define hid_crit(hid, fmt, arg...) \
+ dev_crit(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_alert
+#define hid_alert(hid, fmt, arg...) \
+ dev_alert(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_err
+#define hid_err(hid, fmt, arg...) \
+ dev_err(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_notice
+#define hid_notice(hid, fmt, arg...) \
+ dev_notice(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_warn
+#define hid_warn(hid, fmt, arg...) \
+ dev_warn(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_info
+#define hid_info(hid, fmt, arg...) \
+ dev_info(&(hid)->dev, fmt, ##arg)
+#endif
+
+#ifndef hid_dbg
+#define hid_dbg(hid, fmt, arg...) \
+ dev_dbg(&(hid)->dev, fmt, ##arg)
+#endif
+
+#if LINUX_VERSION_IS_LESS(3,12,0)
+#define hid_alloc_report_buf LINUX_BACKPORT(hid_alloc_report_buf)
+u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
+#endif
+
+#endif /* __BACKPORT_HID_H */