]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'input/next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 13 Dec 2013 01:10:37 +0000 (12:10 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 13 Dec 2013 01:10:37 +0000 (12:10 +1100)
1  2 
arch/sh/boards/mach-ecovec24/setup.c
drivers/input/keyboard/adp5588-keys.c
drivers/input/keyboard/adp5589-keys.c
drivers/input/keyboard/bf54x-keys.c
drivers/input/misc/adxl34x.c
drivers/input/tablet/wacom_sys.c
drivers/input/tablet/wacom_wac.c
drivers/input/touchscreen/cyttsp_core.c

index 122f737a901fbad4e22de06652e6eb9b04abdfc8,23d7e45f9d14935c97a73b788d08666253badd1a..5bc3a15465c71a53906ed0f99a848298c30b2831
@@@ -15,7 -15,6 +15,7 @@@
  #include <linux/mmc/sh_mmcif.h>
  #include <linux/mmc/sh_mobile_sdhi.h>
  #include <linux/mtd/physmap.h>
 +#include <linux/mfd/tmio.h>
  #include <linux/gpio.h>
  #include <linux/interrupt.h>
  #include <linux/io.h>
@@@ -502,7 -501,7 +502,7 @@@ static struct platform_device keysc_dev
  /* TouchScreen */
  #define IRQ0 evt2irq(0x600)
  
- static int ts_get_pendown_state(void)
+ static int ts_get_pendown_state(struct device *dev)
  {
        int val = 0;
        gpio_free(GPIO_FN_INTC_IRQ0);
index 3ed23513d881301fa06c1bde1ed14f56546d0147,e3874d3410b4db8e8c09e7ac6069d55857a85faf..a8f5f92165654e4f536875b352f189ddb1ee100d
@@@ -173,7 -173,7 +173,7 @@@ static int adp5588_build_gpiomap(struc
  static int adp5588_gpio_add(struct adp5588_kpad *kpad)
  {
        struct device *dev = &kpad->client->dev;
-       const struct adp5588_kpad_platform_data *pdata = dev->platform_data;
+       const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev);
        const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
        int i, error;
  
  static void adp5588_gpio_remove(struct adp5588_kpad *kpad)
  {
        struct device *dev = &kpad->client->dev;
-       const struct adp5588_kpad_platform_data *pdata = dev->platform_data;
+       const struct adp5588_kpad_platform_data *pdata = dev_get_platdata(dev);
        const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
        int error;
  
@@@ -321,7 -321,8 +321,8 @@@ static irqreturn_t adp5588_irq(int irq
  
  static int adp5588_setup(struct i2c_client *client)
  {
-       const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
+       const struct adp5588_kpad_platform_data *pdata =
+                       dev_get_platdata(&client->dev);
        const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data;
        int i, ret;
        unsigned char evt_mode1 = 0, evt_mode2 = 0, evt_mode3 = 0;
@@@ -424,7 -425,8 +425,8 @@@ static int adp5588_probe(struct i2c_cli
                         const struct i2c_device_id *id)
  {
        struct adp5588_kpad *kpad;
-       const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data;
+       const struct adp5588_kpad_platform_data *pdata =
+                       dev_get_platdata(&client->dev);
        struct input_dev *input;
        unsigned int revid;
        int ret, i;
                __set_bit(EV_REP, input->evbit);
  
        for (i = 0; i < input->keycodemax; i++)
 -              __set_bit(kpad->keycode[i] & KEY_MAX, input->keybit);
 +              if (kpad->keycode[i] <= KEY_MAX)
 +                      __set_bit(kpad->keycode[i], input->keybit);
        __clear_bit(KEY_RESERVED, input->keybit);
  
        if (kpad->gpimapsize)
index 60dafd4fa692e1d41457c471d5a79ef0bcdf21f0,e43efa03f3e790a2c6f4b0cbab3632fa6db6f26d..ff7725a00776dd4e8d17b6f07ef75b02ce533c96
@@@ -499,7 -499,7 +499,7 @@@ static int adp5589_build_gpiomap(struc
  static int adp5589_gpio_add(struct adp5589_kpad *kpad)
  {
        struct device *dev = &kpad->client->dev;
-       const struct adp5589_kpad_platform_data *pdata = dev->platform_data;
+       const struct adp5589_kpad_platform_data *pdata = dev_get_platdata(dev);
        const struct adp5589_gpio_platform_data *gpio_data = pdata->gpio_data;
        int i, error;
  
  static void adp5589_gpio_remove(struct adp5589_kpad *kpad)
  {
        struct device *dev = &kpad->client->dev;
-       const struct adp5589_kpad_platform_data *pdata = dev->platform_data;
+       const struct adp5589_kpad_platform_data *pdata = dev_get_platdata(dev);
        const struct adp5589_gpio_platform_data *gpio_data = pdata->gpio_data;
        int error;
  
@@@ -658,7 -658,7 +658,7 @@@ static int adp5589_setup(struct adp5589
  {
        struct i2c_client *client = kpad->client;
        const struct adp5589_kpad_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        u8 (*reg) (u8) = kpad->var->reg;
        unsigned char evt_mode1 = 0, evt_mode2 = 0, evt_mode3 = 0;
        unsigned char pull_mask = 0;
@@@ -864,7 -864,7 +864,7 @@@ static int adp5589_probe(struct i2c_cli
  {
        struct adp5589_kpad *kpad;
        const struct adp5589_kpad_platform_data *pdata =
-               client->dev.platform_data;
+               dev_get_platdata(&client->dev);
        struct input_dev *input;
        unsigned int revid;
        int ret, i;
                __set_bit(EV_REP, input->evbit);
  
        for (i = 0; i < input->keycodemax; i++)
 -              __set_bit(kpad->keycode[i] & KEY_MAX, input->keybit);
 +              if (kpad->keycode[i] <= KEY_MAX)
 +                      __set_bit(kpad->keycode[i], input->keybit);
        __clear_bit(KEY_RESERVED, input->keybit);
  
        if (kpad->gpimapsize)
index 09b91d09308780ceebc25d9f860f88eb56b68183,16fa3400d86ab0b99f663898c6d2f797cb23b0e8..16223f4599d425704c9ddf3ad613e9ab03790ae9
@@@ -180,7 -180,7 +180,7 @@@ static irqreturn_t bfin_kpad_isr(int ir
  static int bfin_kpad_probe(struct platform_device *pdev)
  {
        struct bf54x_kpad *bf54x_kpad;
-       struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
+       struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct input_dev *input;
        int i, error;
  
                __set_bit(EV_REP, input->evbit);
  
        for (i = 0; i < input->keycodemax; i++)
 -              __set_bit(bf54x_kpad->keycode[i] & KEY_MAX, input->keybit);
 +              if (bf54x_kpad->keycode[i] <= KEY_MAX)
 +                      __set_bit(bf54x_kpad->keycode[i], input->keybit);
        __clear_bit(KEY_RESERVED, input->keybit);
  
        error = input_register_device(input);
@@@ -333,7 -332,7 +333,7 @@@ out
  
  static int bfin_kpad_remove(struct platform_device *pdev)
  {
-       struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data;
+       struct bfin_kpad_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev);
  
        del_timer_sync(&bf54x_kpad->timer);
index 1cb1da2944191cdefbec3c8b910ce16ea994a758,d2049972f70a9ce634581a73e1b15d8f155d655a..86c9ec48804f75400eded459f287d190cde03ce6
  
  /* ORIENT ADXL346 only */
  #define ADXL346_2D_VALID              (1 << 6)
 -#define ADXL346_2D_ORIENT(x)          (((x) & 0x3) >> 4)
 +#define ADXL346_2D_ORIENT(x)          (((x) & 0x30) >> 4)
  #define ADXL346_3D_VALID              (1 << 3)
  #define ADXL346_3D_ORIENT(x)          ((x) & 0x7)
  #define ADXL346_2D_PORTRAIT_POS               0       /* +X */
@@@ -714,7 -714,7 +714,7 @@@ struct adxl34x *adxl34x_probe(struct de
  
        ac->fifo_delay = fifo_delay_default;
  
-       pdata = dev->platform_data;
+       pdata = dev_get_platdata(dev);
        if (!pdata) {
                dev_dbg(dev,
                        "No platform data: Using default initialization\n");
index 867e7c33ac55072b19f2ff339705c4e90f6b428d,3a7d99c720cd31e90f843054ed3b3807691d17df..8318826d976eabdc55a5cd1c13269d720901edcf
@@@ -304,7 -304,7 +304,7 @@@ static int wacom_parse_hid(struct usb_i
        struct usb_device *dev = interface_to_usbdev(intf);
        char limit = 0;
        /* result has to be defined as int for some devices */
-       int result = 0;
+       int result = 0, touch_max = 0;
        int i = 0, usage = WCM_UNDEFINED, finger = 0, pen = 0;
        unsigned char *report;
  
                                if (usage == WCM_DESKTOP) {
                                        if (finger) {
                                                features->device_type = BTN_TOOL_FINGER;
+                                               /* touch device at least supports one touch point */
+                                               touch_max = 1;
                                                switch (features->type) {
                                                case TABLETPC2FG:
                                                        features->pktlen = WACOM_PKGLEN_TPC2FG;
        }
  
   out:
+       if (!features->touch_max && touch_max)
+               features->touch_max = touch_max;
        result = 0;
        kfree(report);
        return result;
@@@ -1038,7 -1041,6 +1041,7 @@@ static void wacom_destroy_leds(struct w
  }
  
  static enum power_supply_property wacom_battery_props[] = {
 +      POWER_SUPPLY_PROP_SCOPE,
        POWER_SUPPLY_PROP_CAPACITY
  };
  
@@@ -1050,9 -1052,6 +1053,9 @@@ static int wacom_battery_get_property(s
        int ret = 0;
  
        switch (psp) {
 +              case POWER_SUPPLY_PROP_SCOPE:
 +                      val->intval = POWER_SUPPLY_SCOPE_DEVICE;
 +                      break;
                case POWER_SUPPLY_PROP_CAPACITY:
                        val->intval =
                                wacom->wacom_wac.battery_capacity * 100 / 31;
@@@ -1199,7 -1198,8 +1202,8 @@@ static void wacom_wireless_work(struct 
                        goto fail;
  
                /* Touch interface */
-               if (wacom_wac1->features.touch_max) {
+               if (wacom_wac1->features.touch_max ||
+                   wacom_wac1->features.type == INTUOSHT) {
                        wacom_wac2->features =
                                *((struct wacom_features *)id->driver_info);
                        wacom_wac2->features.pktlen = WACOM_PKGLEN_BBTOUCH3;
@@@ -1322,7 -1322,7 +1326,7 @@@ static int wacom_probe(struct usb_inter
         * HID descriptor. If this is the touch interface (wMaxPacketSize
         * of WACOM_PKGLEN_BBTOUCH3), override the table values.
         */
-       if (features->type >= INTUOS5S && features->type <= INTUOSPL) {
+       if (features->type >= INTUOS5S && features->type <= INTUOSHT) {
                if (endpoint->wMaxPacketSize == WACOM_PKGLEN_BBTOUCH3) {
                        features->device_type = BTN_TOOL_FINGER;
                        features->pktlen = WACOM_PKGLEN_BBTOUCH3;
                        goto fail5;
                }
        }
        return 0;
  
   fail5: wacom_destroy_leds(wacom);
index 782c2535f1d81a26db96716ac406405b2b03a78b,eb60a284be057af5b17a3143846d9c588e92f6f9..7655088f78e0efc4bab45fa62cfc442230b460c1
@@@ -1151,8 -1151,8 +1151,8 @@@ static void wacom_bpt3_touch_msg(struc
                int width, height;
  
                if (features->type >= INTUOSPS && features->type <= INTUOSPL) {
-                       width  = data[5];
-                       height = data[6];
+                       width  = data[5] * 100;
+                       height = data[6] * 100;
                } else {
                        /*
                         * "a" is a scaled-down area which we assume is
  static void wacom_bpt3_button_msg(struct wacom_wac *wacom, unsigned char *data)
  {
        struct input_dev *input = wacom->input;
+       struct wacom_features *features = &wacom->features;
  
-       input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
+       if (features->type == INTUOSHT) {
+               input_report_key(input, BTN_LEFT, (data[1] & 0x02) != 0);
+               input_report_key(input, BTN_BACK, (data[1] & 0x08) != 0);
+       } else {
+               input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
+               input_report_key(input, BTN_LEFT, (data[1] & 0x08) != 0);
+       }
        input_report_key(input, BTN_FORWARD, (data[1] & 0x04) != 0);
-       input_report_key(input, BTN_BACK, (data[1] & 0x02) != 0);
        input_report_key(input, BTN_RIGHT, (data[1] & 0x01) != 0);
  }
  
@@@ -1217,7 -1223,7 +1223,7 @@@ static int wacom_bpt_pen(struct wacom_w
        unsigned char *data = wacom->data;
        int prox = 0, x = 0, y = 0, p = 0, d = 0, pen = 0, btn1 = 0, btn2 = 0;
  
-       if (data[0] != 0x02)
+       if (data[0] != WACOM_REPORT_PENABLED)
            return 0;
  
        prox = (data[1] & 0x20) == 0x20;
@@@ -1297,7 -1303,7 +1303,7 @@@ static int wacom_wireless_irq(struct wa
        unsigned char *data = wacom->data;
        int connected;
  
-       if (len != WACOM_PKGLEN_WIRELESS || data[0] != 0x80)
+       if (len != WACOM_PKGLEN_WIRELESS || data[0] != WACOM_REPORT_WL)
                return 0;
  
        connected = data[1] & 0x01;
@@@ -1391,6 -1397,7 +1397,7 @@@ void wacom_wac_irq(struct wacom_wac *wa
                break;
  
        case BAMBOO_PT:
+       case INTUOSHT:
                sync = wacom_bpt_irq(wacom_wac, len);
                break;
  
@@@ -1459,7 -1466,7 +1466,7 @@@ void wacom_setup_device_quirks(struct w
  
        /* these device have multiple inputs */
        if (features->type >= WIRELESS ||
-           (features->type >= INTUOS5S && features->type <= INTUOSPL) ||
+           (features->type >= INTUOS5S && features->type <= INTUOSHT) ||
            (features->oVid && features->oPid))
                features->quirks |= WACOM_QUIRK_MULTI_INPUT;
  
@@@ -1771,33 -1778,43 +1778,43 @@@ int wacom_setup_input_capabilities(stru
                __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
                break;
  
+       case INTUOSHT:
        case BAMBOO_PT:
                __clear_bit(ABS_MISC, input_dev->absbit);
  
-               __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
                if (features->device_type == BTN_TOOL_FINGER) {
-                       unsigned int flags = INPUT_MT_POINTER;
  
                        __set_bit(BTN_LEFT, input_dev->keybit);
                        __set_bit(BTN_FORWARD, input_dev->keybit);
                        __set_bit(BTN_BACK, input_dev->keybit);
                        __set_bit(BTN_RIGHT, input_dev->keybit);
  
-                       if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
-                               input_set_abs_params(input_dev,
+                       if (features->touch_max) {
+                               /* touch interface */
+                               unsigned int flags = INPUT_MT_POINTER;
+                               __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
+                               if (features->pktlen == WACOM_PKGLEN_BBTOUCH3) {
+                                       input_set_abs_params(input_dev,
                                                     ABS_MT_TOUCH_MAJOR,
                                                     0, features->x_max, 0, 0);
-                               input_set_abs_params(input_dev,
+                                       input_set_abs_params(input_dev,
                                                     ABS_MT_TOUCH_MINOR,
                                                     0, features->y_max, 0, 0);
+                               } else {
+                                       __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
+                                       __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
+                                       flags = 0;
+                               }
+                               input_mt_init_slots(input_dev, features->touch_max, flags);
                        } else {
-                               __set_bit(BTN_TOOL_FINGER, input_dev->keybit);
-                               __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
-                               flags = 0;
+                               /* buttons/keys only interface */
+                               __clear_bit(ABS_X, input_dev->absbit);
+                               __clear_bit(ABS_Y, input_dev->absbit);
+                               __clear_bit(BTN_TOUCH, input_dev->keybit);
                        }
-                       input_mt_init_slots(input_dev, features->touch_max, flags);
                } else if (features->device_type == BTN_TOOL_PEN) {
+                       __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
                        __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
                        __set_bit(BTN_TOOL_PEN, input_dev->keybit);
                        __set_bit(BTN_STYLUS, input_dev->keybit);
@@@ -2126,12 -2143,6 +2143,12 @@@ static const struct wacom_features waco
  static const struct wacom_features wacom_features_0x10D =
        { "Wacom ISDv4 10D",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
          0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 +static const struct wacom_features wacom_features_0x10E =
 +      { "Wacom ISDv4 10E",      WACOM_PKGLEN_MTTPC,     27760, 15694,  255,
 +        0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
 +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_0x4001 =
        { "Wacom ISDv4 4001",      WACOM_PKGLEN_MTTPC,     26202, 16325,  255,
          0, MTTPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@@ -2200,6 -2211,17 +2217,17 @@@ static const struct wacom_features waco
  static const struct wacom_features wacom_features_0x301 =
        { "Wacom Bamboo One M",    WACOM_PKGLEN_BBPEN,    21648, 13530, 1023,
          31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+ static const struct wacom_features wacom_features_0x302 =
+       { "Wacom Intuos PT S",     WACOM_PKGLEN_BBPEN,    15200,  9500, 1023,
+         31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+         .touch_max = 16 };
+ static const struct wacom_features wacom_features_0x303 =
+       { "Wacom Intuos PT M",     WACOM_PKGLEN_BBPEN,    21600, 13500, 1023,
+         31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+         .touch_max = 16 };
+ static const struct wacom_features wacom_features_0x30E =
+       { "Wacom Intuos S",        WACOM_PKGLEN_BBPEN,    15200,  9500, 1023,
+         31, INTUOSHT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
  static const struct wacom_features wacom_features_0x6004 =
        { "ISD-V4",               WACOM_PKGLEN_GRAPHIRE,  12800,  8000,  255,
          0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@@ -2333,10 -2355,11 +2361,13 @@@ const struct usb_device_id wacom_ids[] 
        { USB_DEVICE_WACOM(0x100) },
        { USB_DEVICE_WACOM(0x101) },
        { USB_DEVICE_WACOM(0x10D) },
 +      { USB_DEVICE_WACOM(0x10E) },
 +      { USB_DEVICE_WACOM(0x10F) },
        { USB_DEVICE_WACOM(0x300) },
        { USB_DEVICE_WACOM(0x301) },
+       { USB_DEVICE_DETAILED(0x302, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x303, USB_CLASS_HID, 0, 0) },
+       { USB_DEVICE_DETAILED(0x30E, USB_CLASS_HID, 0, 0) },
        { USB_DEVICE_WACOM(0x304) },
        { USB_DEVICE_DETAILED(0x314, USB_CLASS_HID, 0, 0) },
        { USB_DEVICE_DETAILED(0x315, USB_CLASS_HID, 0, 0) },
index 4204841cdc49743054f284cd4fcae8b7131255e8,56088eceacdc54d19f3b91a31d606c63b485cc8a..eee656f77a2e3daa28a98727dbba5278026febc3
@@@ -242,7 -242,7 +242,7 @@@ static int cyttsp_soft_reset(struct cyt
        int retval;
  
        /* wait for interrupt to set ready completion */
 -      INIT_COMPLETION(ts->bl_ready);
 +      reinit_completion(&ts->bl_ready);
        ts->state = CY_BL_STATE;
  
        enable_irq(ts->irq);
@@@ -534,7 -534,7 +534,7 @@@ static void cyttsp_close(struct input_d
  struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
                            struct device *dev, int irq, size_t xfer_buf_size)
  {
-       const struct cyttsp_platform_data *pdata = dev->platform_data;
+       const struct cyttsp_platform_data *pdata = dev_get_platdata(dev);
        struct cyttsp *ts;
        struct input_dev *input_dev;
        int error;
  
        ts->dev = dev;
        ts->input = input_dev;
-       ts->pdata = dev->platform_data;
+       ts->pdata = dev_get_platdata(dev);
        ts->bus_ops = bus_ops;
        ts->irq = irq;