]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'battery/master'
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 04:13:18 +0000 (14:13 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 9 Apr 2015 04:13:20 +0000 (14:13 +1000)
Conflicts:
drivers/hid/wacom.h
drivers/hid/wacom_sys.c

1  2 
MAINTAINERS
drivers/acpi/battery.c
drivers/hid/hid-input.c
drivers/hid/hid-sony.c
drivers/hid/wacom.h
drivers/hid/wacom_sys.c
drivers/hid/wacom_wac.c
drivers/iio/adc/Kconfig
include/linux/hid.h

diff --cc MAINTAINERS
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 1b00d8d4466c9eb6c2b9e9af7a5829ede946fd15,ba9af470bea06fe4bbcf1f7e0c0724c75f613dae..e8607d0961384684ad94d94f2f4777adfdfbf42f
@@@ -1063,11 -1045,12 +1067,11 @@@ static int wacom_initialize_battery(str
  
  static void wacom_destroy_battery(struct wacom *wacom)
  {
-       if (wacom->battery.dev) {
-               power_supply_unregister(&wacom->battery);
-               wacom->battery.dev = NULL;
-               power_supply_unregister(&wacom->ac);
-               wacom->ac.dev = NULL;
 -      if ((wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
 -           wacom->battery) {
++      if (wacom->battery) {
+               power_supply_unregister(wacom->battery);
+               wacom->battery = NULL;
+               power_supply_unregister(wacom->ac);
+               wacom->ac = NULL;
        }
  }
  
@@@ -1334,20 -1317,6 +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 69c7df78281d1c918ca4a2f4750d480403cc68d7,1a6507999a6534f0b851e209bb702696d1f50e58..fa54d329065945bade5b9048df9cb5a98c0bf7f2
@@@ -45,27 -45,6 +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;
@@@ -1961,50 -1867,11 +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;
  }
  
index 46379b1fb25b59b10018a121b2cc8dc78082d4a6,fc6f90614218fa8ba193a8d95249401a862862d6..d82af14986ba44c1fde7498bb378fa9f4fe9513f
@@@ -135,10 -135,18 +135,19 @@@ config AXP288_AD
          device. Depending on platform configuration, this general purpose ADC can
          be used for sampling sensors such as thermal resistors.
  
+ config DA9150_GPADC
+       tristate "Dialog DA9150 GPADC driver support"
+       depends on MFD_DA9150
+       help
+         Say yes here to build support for Dialog DA9150 GPADC.
+         This driver can also be built as a module. If chosen, the module name
+         will be da9150-gpadc.
  config CC10001_ADC
        tristate "Cosmic Circuits 10001 ADC driver"
 -      depends on HAS_IOMEM || HAVE_CLK || REGULATOR
 +      depends on HAVE_CLK || REGULATOR
 +      depends on HAS_IOMEM
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
        help
Simple merge