Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
[sfrench/cifs-2.6.git] / include / linux / hid.h
index 5006f9b5d83701a77529988644cd9b018485bf7b..ab05a86269dc1770181340b8b21c460d83412cb9 100644 (file)
@@ -173,6 +173,7 @@ struct hid_item {
 #define HID_UP_LOGIVENDOR3   0xff430000
 #define HID_UP_LNVENDOR                0xffa00000
 #define HID_UP_SENSOR          0x00200000
+#define HID_UP_ASUSVENDOR      0xff310000
 
 #define HID_USAGE              0x0000ffff
 
@@ -292,6 +293,7 @@ struct hid_item {
 #define HID_DG_BARRELSWITCH2   0x000d005a
 #define HID_DG_TOOLSERIALNUMBER        0x000d005b
 
+#define HID_VD_ASUS_CUSTOM_MEDIA_KEYS  0xff310076
 /*
  * HID report types --- Ouch! HID spec says 1 2 3!
  */
@@ -362,6 +364,12 @@ struct hid_item {
 #define HID_GROUP_WACOM                                0x0101
 #define HID_GROUP_LOGITECH_DJ_DEVICE           0x0102
 
+/*
+ * HID protocol status
+ */
+#define HID_REPORT_PROTOCOL    1
+#define HID_BOOT_PROTOCOL      0
+
 /*
  * This is the global environment of the parser. This information is
  * persistent for main-items. The global environment can be saved and
@@ -526,7 +534,6 @@ struct hid_device {                                                 /* device report descriptor */
        struct hid_report_enum report_enum[HID_REPORT_TYPES];
        struct work_struct led_work;                                    /* delayed LED worker */
 
-       struct semaphore driver_lock;                                   /* protects the current driver, except during input */
        struct semaphore driver_input_lock;                             /* protects the current driver */
        struct device dev;                                              /* device */
        struct hid_driver *driver;
@@ -542,16 +549,18 @@ struct hid_device {                                                       /* device report descriptor */
         * battery is non-NULL.
         */
        struct power_supply *battery;
+       __s32 battery_capacity;
        __s32 battery_min;
        __s32 battery_max;
        __s32 battery_report_type;
        __s32 battery_report_id;
+       bool battery_reported;
 #endif
 
        unsigned int status;                                            /* see STAT flags above */
        unsigned claimed;                                               /* Claimed by hidinput, hiddev? */
        unsigned quirks;                                                /* Various quirks the device can pull on us */
-       bool io_started;                                                /* Protected by driver_lock. If IO has started */
+       bool io_started;                                                /* If IO has started */
 
        struct list_head inputs;                                        /* The list of inputs */
        void *hiddev;                                                   /* The hiddev structure */
@@ -777,6 +786,17 @@ struct hid_ll_driver {
        int (*idle)(struct hid_device *hdev, int report, int idle, int reqtype);
 };
 
+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;
+}
+
 #define        PM_HINT_FULLON  1<<5
 #define PM_HINT_NORMAL 1<<1