Merge branch 'for-6.3/hid-bpf' into for-linus
[linux-block.git] / include / linux / hid.h
index cd3c52fae7b107eb39f91ac8cdfd787616f47470..eaf8ab1773033214f59d556e4ab686300a51e8d1 100644 (file)
@@ -313,6 +313,7 @@ struct hid_item {
 #define HID_DG_LATENCYMODE     0x000d0060
 
 #define HID_BAT_ABSOLUTESTATEOFCHARGE  0x00850065
+#define HID_BAT_CHARGING               0x00850044
 
 #define HID_VD_ASUS_CUSTOM_MEDIA_KEYS  0xff310076
 
@@ -596,7 +597,7 @@ struct hid_device {                                                 /* device report descriptor */
        struct device dev;                                              /* device */
        struct hid_driver *driver;
 
-       struct hid_ll_driver *ll_driver;
+       const struct hid_ll_driver *ll_driver;
        struct mutex ll_open_lock;
        unsigned int ll_open_count;
 
@@ -612,6 +613,7 @@ struct hid_device {                                                 /* device report descriptor */
        __s32 battery_max;
        __s32 battery_report_type;
        __s32 battery_report_id;
+       __s32 battery_charge_status;
        enum hid_battery_status battery_status;
        bool battery_avoid_query;
        ktime_t battery_ratelimit_time;
@@ -620,6 +622,7 @@ struct hid_device {                                                 /* device report descriptor */
        unsigned long status;                                           /* see STAT flags above */
        unsigned claimed;                                               /* Claimed by hidinput, hiddev? */
        unsigned quirks;                                                /* Various quirks the device can pull on us */
+       unsigned initial_quirks;                                        /* Initial set of quirks supplied when creating device */
        bool io_started;                                                /* If IO has started */
 
        struct list_head inputs;                                        /* The list of inputs */
@@ -858,21 +861,7 @@ struct hid_ll_driver {
        bool (*may_wakeup)(struct hid_device *hdev);
 };
 
-extern struct hid_ll_driver i2c_hid_ll_driver;
-extern struct hid_ll_driver hidp_hid_driver;
-extern struct hid_ll_driver uhid_hid_driver;
-extern struct hid_ll_driver usb_hid_driver;
-
-static inline bool hid_is_using_ll_driver(struct hid_device *hdev,
-               struct hid_ll_driver *driver)
-{
-       return hdev->ll_driver == driver;
-}
-
-static inline bool hid_is_usb(struct hid_device *hdev)
-{
-       return hid_is_using_ll_driver(hdev, &usb_hid_driver);
-}
+extern bool hid_is_usb(const struct hid_device *hdev);
 
 #define        PM_HINT_FULLON  1<<5
 #define PM_HINT_NORMAL 1<<1
@@ -887,8 +876,6 @@ static inline bool hid_is_usb(struct hid_device *hdev)
 
 /* HID core API */
 
-extern int hid_debug;
-
 extern bool hid_ignore(struct hid_device *);
 extern int hid_add_device(struct hid_device *);
 extern void hid_destroy_device(struct hid_device *);
@@ -1196,11 +1183,7 @@ int hid_pidff_init(struct hid_device *hid);
 #define hid_pidff_init NULL
 #endif
 
-#define dbg_hid(fmt, ...)                                              \
-do {                                                                   \
-       if (hid_debug)                                                  \
-               printk(KERN_DEBUG "%s: " fmt, __FILE__, ##__VA_ARGS__); \
-} while (0)
+#define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
 
 #define hid_err(hid, fmt, ...)                         \
        dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)