Merge tag 'v3.15-rc5' into next
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 May 2014 23:49:19 +0000 (16:49 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 14 May 2014 23:49:19 +0000 (16:49 -0700)
Merge with Linux 3.15-rc5 to sync up Wacom and other changes.

1  2 
drivers/input/evdev.c
drivers/input/misc/Kconfig
drivers/input/tablet/wacom_wac.c
drivers/input/touchscreen/ads7846.c

diff --combined drivers/input/evdev.c
@@@ -629,10 -629,12 +629,10 @@@ static int str_to_user(const char *str
        return copy_to_user(p, str, len) ? -EFAULT : len;
  }
  
 -#define OLD_KEY_MAX   0x1ff
  static int handle_eviocgbit(struct input_dev *dev,
                            unsigned int type, unsigned int size,
                            void __user *p, int compat_mode)
  {
 -      static unsigned long keymax_warn_time;
        unsigned long *bits;
        int len;
  
        default: return -EINVAL;
        }
  
 -      /*
 -       * Work around bugs in userspace programs that like to do
 -       * EVIOCGBIT(EV_KEY, KEY_MAX) and not realize that 'len'
 -       * should be in bytes, not in bits.
 -       */
 -      if (type == EV_KEY && size == OLD_KEY_MAX) {
 -              len = OLD_KEY_MAX;
 -              if (printk_timed_ratelimit(&keymax_warn_time, 10 * 1000))
 -                      pr_warning("(EVIOCGBIT): Suspicious buffer size %u, "
 -                                 "limiting output to %zu bytes. See "
 -                                 "http://userweb.kernel.org/~dtor/eviocgbit-bug.html\n",
 -                                 OLD_KEY_MAX,
 -                                 BITS_TO_LONGS(OLD_KEY_MAX) * sizeof(long));
 -      }
 -
        return bits_to_user(bits, len, size, p, compat_mode);
  }
 -#undef OLD_KEY_MAX
  
  static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p)
  {
@@@ -936,11 -954,13 +936,13 @@@ static long evdev_do_ioctl(struct file 
                        return -EFAULT;
  
                error = input_ff_upload(dev, &effect, file);
+               if (error)
+                       return error;
  
                if (put_user(effect.id, &(((struct ff_effect __user *)p)->id)))
                        return -EFAULT;
  
-               return error;
+               return 0;
        }
  
        /* Multi-number variable-length handlers */
@@@ -156,7 -156,7 +156,7 @@@ config INPUT_MAX8925_ONKE
  
  config INPUT_MAX8997_HAPTIC
        tristate "MAXIM MAX8997 haptic controller support"
-       depends on PWM && HAVE_PWM && MFD_MAX8997
+       depends on PWM && MFD_MAX8997
        select INPUT_FF_MEMLESS
        help
          This option enables device driver support for the haptic controller
@@@ -224,7 -224,7 +224,7 @@@ config INPUT_GP2
  
  config INPUT_GPIO_BEEPER
        tristate "Generic GPIO Beeper support"
 -      depends on OF_GPIO
 +      depends on GPIOLIB
        help
          Say Y here if you have a beeper connected to a GPIO pin.
  
@@@ -470,7 -470,7 +470,7 @@@ config INPUT_PCF857
  
  config INPUT_PWM_BEEPER
        tristate "PWM beeper support"
-       depends on PWM && HAVE_PWM
+       depends on PWM
        help
          Say Y here to get support for PWM based beeper devices.
  
@@@ -178,10 -178,9 +178,9 @@@ static int wacom_ptu_irq(struct wacom_w
  
  static int wacom_dtu_irq(struct wacom_wac *wacom)
  {
-       struct wacom_features *features = &wacom->features;
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
        struct input_dev *input = wacom->input;
-       int prox = data[1] & 0x20, pressure;
+       int prox = data[1] & 0x20;
  
        dev_dbg(input->dev.parent,
                "%s: received report #%d", __func__, data[0]);
        input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
        input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
        input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
-       pressure = ((data[7] & 0x01) << 8) | data[6];
-       if (pressure < 0)
-               pressure = features->pressure_max + pressure + 1;
-       input_report_abs(input, ABS_PRESSURE, pressure);
+       input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x01) << 8) | data[6]);
        input_report_key(input, BTN_TOUCH, data[1] & 0x05);
        if (!prox) /* out-prox */
                wacom->id[0] = 0;
@@@ -906,7 -902,7 +902,7 @@@ static int int_dist(int x1, int y1, in
  static int wacom_24hdt_irq(struct wacom_wac *wacom)
  {
        struct input_dev *input = wacom->input;
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
        int i;
        int current_num_contacts = data[61];
        int contacts_to_send = 0;
  static int wacom_mt_touch(struct wacom_wac *wacom)
  {
        struct input_dev *input = wacom->input;
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
        int i;
        int current_num_contacts = data[2];
        int contacts_to_send = 0;
@@@ -1038,7 -1034,7 +1034,7 @@@ static int wacom_tpc_mt_touch(struct wa
  
  static int wacom_tpc_single_touch(struct wacom_wac *wacom, size_t len)
  {
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
        struct input_dev *input = wacom->input;
        bool prox;
        int x = 0, y = 0;
                        prox = data[0] & 0x01;
                        x = get_unaligned_le16(&data[1]);
                        y = get_unaligned_le16(&data[3]);
 +              } else if (len == WACOM_PKGLEN_TPC1FG_B) {
 +                      prox = data[2] & 0x01;
 +                      x = get_unaligned_le16(&data[3]);
 +                      y = get_unaligned_le16(&data[5]);
                } else {
                        prox = data[1] & 0x01;
                        x = le16_to_cpup((__le16 *)&data[2]);
  
  static int wacom_tpc_pen(struct wacom_wac *wacom)
  {
-       struct wacom_features *features = &wacom->features;
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
        struct input_dev *input = wacom->input;
-       int pressure;
        bool prox = data[1] & 0x20;
  
        if (!wacom->shared->stylus_in_proximity) /* first in prox */
                input_report_key(input, BTN_STYLUS2, data[1] & 0x10);
                input_report_abs(input, ABS_X, le16_to_cpup((__le16 *)&data[2]));
                input_report_abs(input, ABS_Y, le16_to_cpup((__le16 *)&data[4]));
-               pressure = ((data[7] & 0x01) << 8) | data[6];
-               if (pressure < 0)
-                       pressure = features->pressure_max + pressure + 1;
-               input_report_abs(input, ABS_PRESSURE, pressure);
+               input_report_abs(input, ABS_PRESSURE, ((data[7] & 0x03) << 8) | data[6]);
                input_report_key(input, BTN_TOUCH, data[1] & 0x05);
                input_report_key(input, wacom->tool[0], prox);
                return 1;
  
  static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
  {
-       char *data = wacom->data;
+       unsigned char *data = wacom->data;
  
        dev_dbg(wacom->input->dev.parent,
                "%s: received report #%d\n", __func__, data[0]);
@@@ -1842,7 -1829,7 +1833,7 @@@ int wacom_setup_input_capabilities(stru
        case DTU:
                if (features->type == DTUS) {
                        input_set_capability(input_dev, EV_MSC, MSC_SERIAL);
-                       for (i = 0; i < 3; i++)
+                       for (i = 0; i < 4; i++)
                                __set_bit(BTN_0 + i, input_dev->keybit);
                }
                __set_bit(BTN_TOOL_PEN, input_dev->keybit);
@@@ -2246,9 -2233,6 +2237,9 @@@ static const struct wacom_features waco
  static const struct wacom_features wacom_features_0x10F =
        { "Wacom ISDv4 10F",      WACOM_PKGLEN_MTTPC,     27760, 15694,  255,
          0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 +static const struct wacom_features wacom_features_0x116 =
 +      { "Wacom ISDv4 116",      WACOM_PKGLEN_GRAPHIRE,  26202, 16325,  255,
 +        0, TABLETPCE, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  static const struct wacom_features wacom_features_0x4001 =
        { "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
          0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@@ -2463,7 -2447,6 +2454,7 @@@ const struct usb_device_id wacom_ids[] 
        { USB_DEVICE_WACOM(0x10D) },
        { USB_DEVICE_WACOM(0x10E) },
        { USB_DEVICE_WACOM(0x10F) },
 +      { USB_DEVICE_WACOM(0x116) },
        { USB_DEVICE_WACOM(0x300) },
        { USB_DEVICE_WACOM(0x301) },
        { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
@@@ -425,7 -425,7 +425,7 @@@ static int ads7845_read12_ser(struct de
  name ## _show(struct device *dev, struct device_attribute *attr, char *buf) \
  { \
        struct ads7846 *ts = dev_get_drvdata(dev); \
-       ssize_t v = ads7846_read12_ser(dev, \
+       ssize_t v = ads7846_read12_ser(&ts->spi->dev, \
                        READ_12BIT_SER(var)); \
        if (v < 0) \
                return v; \
@@@ -706,7 -706,7 +706,7 @@@ static void ads7846_read_state(struct a
                m = &ts->msg[msg_idx];
                error = spi_sync(ts->spi, m);
                if (error) {
 -                      dev_err(&ts->spi->dev, "spi_async --> %d\n", error);
 +                      dev_err(&ts->spi->dev, "spi_sync --> %d\n", error);
                        packet->tc.ignore = true;
                        return;
                }