]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
Merge commit 'v3.4-rc4' into next
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 22 Apr 2012 06:28:35 +0000 (23:28 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sun, 22 Apr 2012 06:28:35 +0000 (23:28 -0700)
1  2 
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/touchscreen/Kconfig

index 1c874adb7053f01a94a494e027d4bd54133e32eb,0d269212931e86be95d4c77c26b667ac781200c2..98e9dd692d680cb888a4ae3eae6777a77124851d
@@@ -233,9 -233,6 +233,9 @@@ static int wacom_parse_logical_collecti
   * 3rd gen Bamboo Touch no longer define a Digitizer-Finger Pysical
   * Collection. Instead they define a Logical Collection with a single
   * Logical Maximum for both X and Y.
 + *
 + * Intuos5 touch interface does not contain useful data. We deal with
 + * this after returning from this function.
   */
  static int wacom_parse_hid(struct usb_interface *intf,
                           struct hid_descriptor *hid_desc,
@@@ -577,39 -574,23 +577,39 @@@ static void wacom_remove_shared_data(st
  static int wacom_led_control(struct wacom *wacom)
  {
        unsigned char *buf;
 -      int retval, led = 0;
 +      int retval;
  
        buf = kzalloc(9, GFP_KERNEL);
        if (!buf)
                return -ENOMEM;
  
 -      if (wacom->wacom_wac.features.type == WACOM_21UX2 ||
 -          wacom->wacom_wac.features.type == WACOM_24HD)
 -              led = (wacom->led.select[1] << 4) | 0x40;
 -
 -      led |=  wacom->led.select[0] | 0x4;
 -
 -      buf[0] = WAC_CMD_LED_CONTROL;
 -      buf[1] = led;
 -      buf[2] = wacom->led.llv;
 -      buf[3] = wacom->led.hlv;
 -      buf[4] = wacom->led.img_lum;
 +      if (wacom->wacom_wac.features.type >= INTUOS5S &&
 +          wacom->wacom_wac.features.type <= INTUOS5L) {
 +              /*
 +               * Touch Ring and crop mark LED luminance may take on
 +               * one of four values:
 +               *    0 = Low; 1 = Medium; 2 = High; 3 = Off
 +               */
 +              int ring_led = wacom->led.select[0] & 0x03;
 +              int ring_lum = (((wacom->led.llv & 0x60) >> 5) - 1) & 0x03;
 +              int crop_lum = 0;
 +
 +              buf[0] = WAC_CMD_LED_CONTROL;
 +              buf[1] = (crop_lum << 4) | (ring_lum << 2) | (ring_led);
 +      }
 +      else {
 +              int led = wacom->led.select[0] | 0x4;
 +
 +              if (wacom->wacom_wac.features.type == WACOM_21UX2 ||
 +                  wacom->wacom_wac.features.type == WACOM_24HD)
 +                      led |= (wacom->led.select[1] << 4) | 0x40;
 +
 +              buf[0] = WAC_CMD_LED_CONTROL;
 +              buf[1] = led;
 +              buf[2] = wacom->led.llv;
 +              buf[3] = wacom->led.hlv;
 +              buf[4] = wacom->led.img_lum;
 +      }
  
        retval = wacom_set_report(wacom->intf, 0x03, WAC_CMD_LED_CONTROL,
                                  buf, 9, WAC_CMD_RETRIES);
@@@ -802,17 -783,6 +802,17 @@@ static struct attribute_group intuos4_l
        .attrs = intuos4_led_attrs,
  };
  
 +static struct attribute *intuos5_led_attrs[] = {
 +      &dev_attr_status0_luminance.attr,
 +      &dev_attr_status_led0_select.attr,
 +      NULL
 +};
 +
 +static struct attribute_group intuos5_led_attr_group = {
 +      .name = "wacom_led",
 +      .attrs = intuos5_led_attrs,
 +};
 +
  static int wacom_initialize_leds(struct wacom *wacom)
  {
        int error;
                                           &cintiq_led_attr_group);
                break;
  
 +      case INTUOS5S:
 +      case INTUOS5:
 +      case INTUOS5L:
 +              wacom->led.select[0] = 0;
 +              wacom->led.select[1] = 0;
 +              wacom->led.llv = 32;
 +              wacom->led.hlv = 0;
 +              wacom->led.img_lum = 0;
 +
 +              error = sysfs_create_group(&wacom->intf->dev.kobj,
 +                                         &intuos5_led_attr_group);
 +              break;
 +
        default:
                return 0;
        }
@@@ -883,13 -840,6 +883,13 @@@ static void wacom_destroy_leds(struct w
                sysfs_remove_group(&wacom->intf->dev.kobj,
                                   &cintiq_led_attr_group);
                break;
 +
 +      case INTUOS5S:
 +      case INTUOS5:
 +      case INTUOS5L:
 +              sysfs_remove_group(&wacom->intf->dev.kobj,
 +                                 &intuos5_led_attr_group);
 +              break;
        }
  }
  
@@@ -1052,6 -1002,8 +1052,8 @@@ static int wacom_probe(struct usb_inter
                return -EINVAL;
  
        wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL);
+       if (!wacom)
+               return -ENOMEM;
  
        wacom_wac = &wacom->wacom_wac;
        wacom_wac->features = *((struct wacom_features *)id->driver_info);
        if (error)
                goto fail3;
  
 +      /*
 +       * Intuos5 has no useful data about its touch interface in its
 +       * HID descriptor. If this is the touch interface (wMaxPacketSize
 +       * of WACOM_PKGLEN_BBTOUCH3), override the table values.
 +       */
 +      if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
 +              if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
 +                      features->device_type = BTN_TOOL_FINGER;
 +                      features->pktlen = WACOM_PKGLEN_BBTOUCH3;
 +
 +                      features->x_phy =
 +                              (features->x_max * 100) / features->x_resolution;
 +                      features->y_phy =
 +                              (features->y_max * 100) / features->y_resolution;
 +
 +                      features->x_max = 4096;
 +                      features->y_max = 4096;
 +              } else {
 +                      features->device_type = BTN_TOOL_PEN;
 +              }
 +      }
 +
        wacom_setup_device_quirks(features);
  
        strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name));
index a6173431d803ba16f4d62046a6487a08a554f276,cecd35c8f0b3ce46cb82bd51514f7b468ab282cd..d96e186f71dc56d22765ad90b03348db1187656c
@@@ -321,9 -321,6 +321,9 @@@ static int wacom_intuos_inout(struct wa
  
        /* Enter report */
        if ((data[1] & 0xfc) == 0xc0) {
 +              if (features->type >= INTUOS5S && features->type <= INTUOS5L)
 +                      wacom->shared->stylus_in_proximity = true;
 +
                /* serial number of the tool */
                wacom->serial[idx] = ((data[3] & 0x0f) << 28) +
                        (data[4] << 20) + (data[5] << 12) +
  
        /* Exit report */
        if ((data[1] & 0xfe) == 0x80) {
 +              if (features->type >= INTUOS5S && features->type <= INTUOS5L)
 +                      wacom->shared->stylus_in_proximity = false;
 +
                /*
                 * Reset all states otherwise we lose the initial states
                 * when in-prox next time
@@@ -458,7 -452,6 +458,7 @@@ static void wacom_intuos_general(struc
        if ((data[1] & 0xb8) == 0xa0) {
                t = (data[6] << 2) | ((data[7] >> 6) & 3);
                if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
 +                    (features->type >= INTUOS5S && features->type <= INTUOS5L) ||
                    features->type == WACOM_21UX2 || features->type == WACOM_24HD) {
                        t = (t << 1) | (data[1] & 1);
                }
@@@ -490,8 -483,7 +490,8 @@@ static int wacom_intuos_irq(struct waco
        int idx = 0, result;
  
        if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
 -              && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD) {
 +              && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD
 +              && data[0] != WACOM_REPORT_INTUOS5PAD) {
                dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
                  return 0;
        }
                idx = data[1] & 0x01;
  
        /* pad packets. Works as a second tool and is always in prox */
 -      if (data[0] == WACOM_REPORT_INTUOSPAD) {
 +      if (data[0] == WACOM_REPORT_INTUOSPAD || data[0] == WACOM_REPORT_INTUOS5PAD) {
                if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
                        input_report_key(input, BTN_0, (data[2] & 0x01));
                        input_report_key(input, BTN_1, (data[3] & 0x01));
                                input_report_key(input, wacom->tool[1], 0);
                                input_report_abs(input, ABS_MISC, 0);
                        }
 +              } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
 +                      int i;
 +
 +                      /* Touch ring mode switch has no capacitive sensor */
 +                      input_report_key(input, BTN_0, (data[3] & 0x01));
 +
 +                      /*
 +                       * ExpressKeys on Intuos5 have a capacitive sensor in
 +                       * addition to the mechanical switch. Switch data is
 +                       * stored in data[4], capacitive data in data[5].
 +                       */
 +                      for (i = 0; i < 8; i++)
 +                              input_report_key(input, BTN_1 + i, data[4] & (1 << i));
 +
 +                      if (data[2] & 0x80) {
 +                              input_report_abs(input, ABS_WHEEL, (data[2] & 0x7f));
 +                      } else {
 +                              /* Out of proximity, clear wheel value. */
 +                              input_report_abs(input, ABS_WHEEL, 0);
 +                      }
 +
 +                      if (data[2] | (data[3] & 0x01) | data[4]) {
 +                              input_report_key(input, wacom->tool[1], 1);
 +                              input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
 +                      } else {
 +                              input_report_key(input, wacom->tool[1], 0);
 +                              input_report_abs(input, ABS_MISC, 0);
 +                      }
                } else {
                        if (features->type == WACOM_21UX2) {
                                input_report_key(input, BTN_0, (data[5] & 0x01));
            (features->type == INTUOS3 ||
             features->type == INTUOS3S ||
             features->type == INTUOS4 ||
 -           features->type == INTUOS4S)) {
 +           features->type == INTUOS4S ||
 +           features->type == INTUOS5 ||
 +           features->type == INTUOS5S)) {
  
                return 0;
        }
  
                } else if (wacom->tool[idx] == BTN_TOOL_MOUSE) {
                        /* I4 mouse */
 -                      if (features->type >= INTUOS4S && features->type <= INTUOS4L) {
 +                      if ((features->type >= INTUOS4S && features->type <= INTUOS4L) ||
 +                          (features->type >= INTUOS5S && features->type <= INTUOS5L)) {
                                input_report_key(input, BTN_LEFT,   data[6] & 0x01);
                                input_report_key(input, BTN_MIDDLE, data[6] & 0x02);
                                input_report_key(input, BTN_RIGHT,  data[6] & 0x04);
                                }
                        }
                } else if ((features->type < INTUOS3S || features->type == INTUOS3L ||
 -                              features->type == INTUOS4L) &&
 +                              features->type == INTUOS4L || features->type == INTUOS5L) &&
                           wacom->tool[idx] == BTN_TOOL_LENS) {
                        /* Lens cursor packets */
                        input_report_key(input, BTN_LEFT,   data[8] & 0x01);
@@@ -977,7 -938,7 +977,7 @@@ static int wacom_bpt3_touch(struct waco
  {
        struct input_dev *input = wacom->input;
        unsigned char *data = wacom->data;
-       int count = data[1] & 0x03;
+       int count = data[1] & 0x07;
        int i;
  
        if (data[0] != 0x02)
@@@ -1153,15 -1114,6 +1153,15 @@@ void wacom_wac_irq(struct wacom_wac *wa
                sync = wacom_intuos_irq(wacom_wac);
                break;
  
 +      case INTUOS5S:
 +      case INTUOS5:
 +      case INTUOS5L:
 +              if (len == WACOM_PKGLEN_BBTOUCH3)
 +                      sync = wacom_bpt3_touch(wacom_wac);
 +              else
 +                      sync = wacom_intuos_irq(wacom_wac);
 +              break;
 +
        case TABLETPC:
        case TABLETPC2FG:
                sync = wacom_tpc_irq(wacom_wac, len);
@@@ -1236,8 -1188,7 +1236,8 @@@ void wacom_setup_device_quirks(struct w
  
        /* these device have multiple inputs */
        if (features->type == TABLETPC || features->type == TABLETPC2FG ||
 -          features->type == BAMBOO_PT || features->type == WIRELESS)
 +          features->type == BAMBOO_PT || features->type == WIRELESS ||
 +          (features->type >= INTUOS5S && features->type <= INTUOS5L))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
  
        /* quirk for bamboo touch with 2 low res touches */
@@@ -1404,50 -1355,6 +1404,50 @@@ void wacom_setup_input_capabilities(str
                wacom_setup_intuos(wacom_wac);
                break;
  
 +      case INTUOS5:
 +      case INTUOS5L:
 +              if (features->device_type == BTN_TOOL_PEN) {
 +                      __set_bit(BTN_7, input_dev->keybit);
 +                      __set_bit(BTN_8, input_dev->keybit);
 +              }
 +              /* fall through */
 +
 +      case INTUOS5S:
 +              __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
 +
 +              if (features->device_type == BTN_TOOL_PEN) {
 +                      for (i = 0; i < 7; i++)
 +                              __set_bit(BTN_0 + i, input_dev->keybit);
 +
 +                      input_set_abs_params(input_dev, ABS_DISTANCE, 0,
 +                                            features->distance_max,
 +                                            0, 0);
 +
 +                      input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
 +
 +                      wacom_setup_intuos(wacom_wac);
 +              } else if (features->device_type == BTN_TOOL_FINGER) {
 +                      __clear_bit(ABS_MISC, input_dev->absbit);
 +
 +                      __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
 +                      __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
 +                      __set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
 +                      __set_bit(BTN_TOOL_QUADTAP, input_dev->keybit);
 +
 +                      input_mt_init_slots(input_dev, 16);
 +
 +                      input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
 +                                           0, 255, 0, 0);
 +
 +                      input_set_abs_params(input_dev, ABS_MT_POSITION_X,
 +                                           0, features->x_max,
 +                                           features->x_fuzz, 0);
 +                      input_set_abs_params(input_dev, ABS_MT_POSITION_Y,
 +                                           0, features->y_max,
 +                                           features->y_fuzz, 0);
 +              }
 +              break;
 +
        case INTUOS4:
        case INTUOS4L:
                __set_bit(BTN_7, input_dev->keybit);
@@@ -1722,21 -1629,6 +1722,21 @@@ static const struct wacom_features waco
  static const struct wacom_features wacom_features_0xBC =
        { "Wacom Intuos4 WL",     WACOM_PKGLEN_INTUOS,    40840, 25400, 2047,
          63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 +static const struct wacom_features wacom_features_0x26 =
 +      { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
 +        63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 +static const struct wacom_features wacom_features_0x27 =
 +      { "Wacom Intuos5 touch M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
 +        63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 +static const struct wacom_features wacom_features_0x28 =
 +      { "Wacom Intuos5 touch L", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
 +        63, INTUOS5L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 +static const struct wacom_features wacom_features_0x29 =
 +      { "Wacom Intuos5 S", WACOM_PKGLEN_INTUOS,  31496, 19685, 2047,
 +        63, INTUOS5S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
 +static const struct wacom_features wacom_features_0x2A =
 +      { "Wacom Intuos5 M", WACOM_PKGLEN_INTUOS,  44704, 27940, 2047,
 +        63, INTUOS5, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
  static const struct wacom_features wacom_features_0xF4 =
        { "Wacom Cintiq 24HD",    WACOM_PKGLEN_INTUOS,   104480, 65600, 2047,
          63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
@@@ -1909,11 -1801,6 +1909,11 @@@ const struct usb_device_id wacom_ids[] 
        { USB_DEVICE_WACOM(0xBA) },
        { USB_DEVICE_WACOM(0xBB) },
        { USB_DEVICE_WACOM(0xBC) },
 +      { USB_DEVICE_WACOM(0x26) },
 +      { USB_DEVICE_WACOM(0x27) },
 +      { USB_DEVICE_WACOM(0x28) },
 +      { USB_DEVICE_WACOM(0x29) },
 +      { USB_DEVICE_WACOM(0x2A) },
        { USB_DEVICE_WACOM(0x3F) },
        { USB_DEVICE_WACOM(0xC5) },
        { USB_DEVICE_WACOM(0xC6) },
index c5eb2b925be6c5a916ca0d299a3f6eb656d7e705,2a2141915aa04939a4a1f9f9f96b0ef9a58072b6..ba7c56567ee7056c202e6c515bf6c5e831529959
@@@ -260,7 -260,7 +260,7 @@@ config TOUCHSCREEN_ILI210
  
  config TOUCHSCREEN_S3C2410
        tristate "Samsung S3C2410/generic touchscreen input driver"
-       depends on ARCH_S3C2410 || SAMSUNG_DEV_TS
+       depends on ARCH_S3C24XX || SAMSUNG_DEV_TS
        select S3C_ADC
        help
          Say Y here if you have the s3c2410 touchscreen.
@@@ -306,18 -306,6 +306,18 @@@ config TOUCHSCREEN_WACOM_W800
          To compile this driver as a module, choose M here: the
          module will be called wacom_w8001.
  
 +config TOUCHSCREEN_WACOM_I2C
 +      tristate "Wacom Tablet support (I2C)"
 +      depends on I2C
 +      help
 +        Say Y here if you want to use the I2C version of the Wacom
 +        Pen Tablet.
 +
 +        If unsure, say N.
 +
 +        To compile this driver as a module, choose M here: the module
 +        will be called wacom_i2c.
 +
  config TOUCHSCREEN_LPC32XX
        tristate "LPC32XX touchscreen controller"
        depends on ARCH_LPC32XX