Merge branch 'for-4.14/wacom' into for-linus
authorJiri Kosina <jkosina@suse.cz>
Tue, 5 Sep 2017 09:14:10 +0000 (11:14 +0200)
committerJiri Kosina <jkosina@suse.cz>
Tue, 5 Sep 2017 09:14:10 +0000 (11:14 +0200)
- name generation improvement for Wacom devices from Jason Gerecke
- Kconfig dependency fix for Wacom driver from Arnd Bergmann

1  2 
drivers/hid/usbhid/hid-core.c
include/linux/hid.h

@@@ -680,21 -680,18 +680,21 @@@ static int usbhid_open(struct hid_devic
        struct usbhid_device *usbhid = hid->driver_data;
        int res;
  
 +      set_bit(HID_OPENED, &usbhid->iofl);
 +
        if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
                return 0;
  
        res = usb_autopm_get_interface(usbhid->intf);
        /* the device must be awake to reliably request remote wakeup */
 -      if (res < 0)
 +      if (res < 0) {
 +              clear_bit(HID_OPENED, &usbhid->iofl);
                return -EIO;
 +      }
  
        usbhid->intf->needs_remote_wakeup = 1;
  
        set_bit(HID_RESUME_RUNNING, &usbhid->iofl);
 -      set_bit(HID_OPENED, &usbhid->iofl);
        set_bit(HID_IN_POLLING, &usbhid->iofl);
  
        res = hid_start_in(hid);
@@@ -730,20 -727,19 +730,20 @@@ static void usbhid_close(struct hid_dev
  {
        struct usbhid_device *usbhid = hid->driver_data;
  
 -      if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
 -              return;
 -
        /*
         * Make sure we don't restart data acquisition due to
         * a resumption we no longer care about by avoiding racing
         * with hid_start_in().
         */
        spin_lock_irq(&usbhid->lock);
 -      clear_bit(HID_IN_POLLING, &usbhid->iofl);
        clear_bit(HID_OPENED, &usbhid->iofl);
 +      if (!(hid->quirks & HID_QUIRK_ALWAYS_POLL))
 +              clear_bit(HID_IN_POLLING, &usbhid->iofl);
        spin_unlock_irq(&usbhid->lock);
  
 +      if (hid->quirks & HID_QUIRK_ALWAYS_POLL)
 +              return;
 +
        hid_cancel_delayed_stuff(usbhid);
        usb_kill_urb(usbhid->urbin);
        usbhid->intf->needs_remote_wakeup = 0;
@@@ -1265,7 -1261,7 +1265,7 @@@ static int usbhid_idle(struct hid_devic
        return hid_set_idle(dev, ifnum, report, idle);
  }
  
- static struct hid_ll_driver usb_hid_driver = {
+ struct hid_ll_driver usb_hid_driver = {
        .parse = usbhid_parse,
        .start = usbhid_start,
        .stop = usbhid_stop,
        .output_report = usbhid_output_report,
        .idle = usbhid_idle,
  };
+ EXPORT_SYMBOL_GPL(usb_hid_driver);
  
  static int usbhid_probe(struct usb_interface *intf, const struct usb_device_id *id)
  {
diff --combined include/linux/hid.h
@@@ -173,7 -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
  
  #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!
   */
@@@ -528,6 -526,7 +528,6 @@@ struct hid_device {                                                        /* device rep
        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;
         * 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 */
@@@ -780,6 -777,17 +780,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