Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Apr 2015 16:25:26 +0000 (08:25 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 14 Apr 2015 16:25:26 +0000 (09:25 -0700)
Pull HID updates from Jiri Kosina:

 - quite a few firmware fixes for RMI driver by Andrew Duggan

 - huion and uclogic drivers have been substantially overlaping in
   functionality laterly.  This redundancy is fixed by hid-huion driver
   being merged into hid-uclogic; work done by Benjamin Tissoires and
   Nikolai Kondrashov

 - i2c-hid now supports ACPI GPIO interrupts; patch from Mika Westerberg

 - Some of the quirks, that got separated into individual drivers, have
   historically had EXPERT dependency.  As HID subsystem matured (as
   well as the individual drivers), this made less and less sense.  This
   dependency is now being removed by patch from Jean Delvare

 - Logitech lg4ff driver received a couple of improvements for mode
   switching, by Michal MalĂ˝

 - multitouch driver now supports clickpads, patches by Benjamin
   Tissoires and Seth Forshee

 - hid-sensor framework received a substantial update; namely support
   for Custom and Generic pages is being added; work done by Srinivas
   Pandruvada

 - wacom driver received substantial update; it now supports
   i2c-conntected devices (Mika Westerberg), Bamboo PADs are now
   properly supported (Benjamin Tissoires), much improved battery
   reporting (Jason Gerecke) and pen proximity cleanups (Ping Cheng)

 - small assorted fixes and device ID additions

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (68 commits)
  HID: sensor: Update document for custom sensor
  HID: sensor: Custom and Generic sensor support
  HID: debug: fix error handling in hid_debug_events_read()
  Input - mt: Fix input_mt_get_slot_by_key
  HID: logitech-hidpp: fix error return code
  HID: wacom: Add support for Cintiq 13HD Touch
  HID: logitech-hidpp: add a module parameter to keep firmware gestures
  HID: usbhid: yet another mouse with ALWAYS_POLL
  HID: usbhid: more mice with ALWAYS_POLL
  HID: wacom: set stylus_in_proximity before checking touch_down
  HID: wacom: use wacom_wac_finger_count_touches to set touch_down
  HID: wacom: remove hardcoded WACOM_QUIRK_MULTI_INPUT
  HID: pidff: effect can't be NULL
  HID: add quirk for PIXART OEM mouse used by HP
  HID: add HP OEM mouse to quirk ALWAYS_POLL
  HID: wacom: ask for a in-prox report when it was missed
  HID: hid-sensor-hub: Fix sparse warning
  HID: hid-sensor-hub: fix attribute read for logical usage id
  HID: plantronics: fix Kconfig default
  HID: pidff: support more than one concurrent effect
  ...

1  2 
drivers/hid/hid-input.c
drivers/hid/hid-sony.c
drivers/hid/wacom.h
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c
include/linux/hid.h
include/uapi/linux/input.h

Simple merge
Simple merge
Simple merge
index ba9af470bea06fe4bbcf1f7e0c0724c75f613dae,1b00d8d4466c9eb6c2b9e9af7a5829ede946fd15..e8607d0961384684ad94d94f2f4777adfdfbf42f
@@@ -1045,12 -1063,11 +1067,11 @@@ static int wacom_initialize_battery(str
  
  static void wacom_destroy_battery(struct wacom *wacom)
  {
-       if ((wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
-            wacom->battery) {
 -      if (wacom->battery.dev) {
 -              power_supply_unregister(&wacom->battery);
 -              wacom->battery.dev = NULL;
 -              power_supply_unregister(&wacom->ac);
 -              wacom->ac.dev = NULL;
++      if (wacom->battery) {
 +              power_supply_unregister(wacom->battery);
 +              wacom->battery = NULL;
 +              power_supply_unregister(wacom->ac);
 +              wacom->ac = NULL;
        }
  }
  
@@@ -1317,6 -1334,20 +1338,20 @@@ fail
        return;
  }
  
 -           !wacom->battery.dev) {
+ void wacom_battery_work(struct work_struct *work)
+ {
+       struct wacom *wacom = container_of(work, struct wacom, work);
+       if ((wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
 -               wacom->battery.dev) {
++           !wacom->battery) {
+               wacom_initialize_battery(wacom);
+       }
+       else if (!(wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
++               wacom->battery) {
+               wacom_destroy_battery(wacom);
+       }
+ }
  /*
   * Not all devices report physical dimensions from HID.
   * Compute the default from hardcoded logical dimension
index bbe32d66e5000157b4d3670c23350ff3fa1a0104,69c7df78281d1c918ca4a2f4750d480403cc68d7..fa54d329065945bade5b9048df9cb5a98c0bf7f2
@@@ -45,6 -45,27 +45,27 @@@ static unsigned short batcap_gr[8] = { 
   */
  static unsigned short batcap_i4[8] = { 1, 15, 30, 45, 60, 70, 85, 100 };
  
 -              if (wacom->battery.dev)
 -                      power_supply_changed(&wacom->battery);
+ static void wacom_notify_battery(struct wacom_wac *wacom_wac,
+       int bat_capacity, bool bat_charging, bool bat_connected,
+       bool ps_connected)
+ {
+       struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);
+       bool changed = wacom_wac->battery_capacity != bat_capacity  ||
+                      wacom_wac->bat_charging     != bat_charging  ||
+                      wacom_wac->bat_connected    != bat_connected ||
+                      wacom_wac->ps_connected     != ps_connected;
+       if (changed) {
+               wacom_wac->battery_capacity = bat_capacity;
+               wacom_wac->bat_charging = bat_charging;
+               wacom_wac->bat_connected = bat_connected;
+               wacom_wac->ps_connected = ps_connected;
++              if (wacom->battery)
++                      power_supply_changed(wacom->battery);
+       }
+ }
  static int wacom_penpartner_irq(struct wacom_wac *wacom)
  {
        unsigned char *data = wacom->data;
@@@ -1890,11 -1961,50 +1961,50 @@@ static int wacom_wireless_irq(struct wa
                /* disconnected while previously connected */
                wacom->pid = 0;
                wacom_schedule_work(wacom);
-               wacom->battery_capacity = 0;
-               wacom->bat_charging = 0;
-               wacom->ps_connected = 0;
+               wacom_notify_battery(wacom, 0, 0, 0, 0);
+       }
+       return 0;
+ }
+ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
+ {
+       struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac);
+       struct wacom_features *features = &wacom_wac->features;
+       unsigned char *data = wacom_wac->data;
+       if (data[0] != WACOM_REPORT_USB)
+               return 0;
+       if (features->type == INTUOSHT &&
+           wacom_wac->shared->touch_input &&
+           features->touch_max) {
+               input_report_switch(wacom_wac->shared->touch_input,
+                                   SW_MUTE_DEVICE, data[8] & 0x40);
+               input_sync(wacom_wac->shared->touch_input);
        }
  
 -              if (!wacom->battery.dev &&
+       if (data[9] & 0x02) { /* wireless module is attached */
+               int battery = (data[8] & 0x3f) * 100 / 31;
+               bool charging = !!(data[8] & 0x80);
+               wacom_notify_battery(wacom_wac, battery, charging,
+                                    battery || charging, 1);
 -               wacom->battery.dev) {
++              if (!wacom->battery &&
+                   !(features->quirks & WACOM_QUIRK_BATTERY)) {
+                       features->quirks |= WACOM_QUIRK_BATTERY;
+                       INIT_WORK(&wacom->work, wacom_battery_work);
+                       wacom_schedule_work(wacom_wac);
+               }
+       }
+       else if ((features->quirks & WACOM_QUIRK_BATTERY) &&
++               wacom->battery) {
+               features->quirks &= ~WACOM_QUIRK_BATTERY;
+               INIT_WORK(&wacom->work, wacom_battery_work);
+               wacom_schedule_work(wacom_wac);
+               wacom_notify_battery(wacom_wac, 0, 0, 0, 0);
+       }
        return 0;
  }
  
Simple merge
Simple merge