diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-22 02:28:35 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2012-04-22 02:28:35 -0400 |
| commit | 57b8628bb0ac4e47c806e45c5bbd89282e93869b (patch) | |
| tree | ee9289f0898054474b7e5054abdb3ffb78666436 /drivers/input | |
| parent | 486c8aba39e5f194519cd5c0e85e5d1de8b74b03 (diff) | |
| parent | 66f75a5d028beaf67c931435fdc3e7823125730c (diff) | |
Merge commit 'v3.4-rc4' into next
Diffstat (limited to 'drivers/input')
33 files changed, 202 insertions, 98 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index cfe78597eb68..4b2e10d5d641 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -341,7 +341,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer, | |||
| 341 | struct evdev_client *client = file->private_data; | 341 | struct evdev_client *client = file->private_data; |
| 342 | struct evdev *evdev = client->evdev; | 342 | struct evdev *evdev = client->evdev; |
| 343 | struct input_event event; | 343 | struct input_event event; |
| 344 | int retval; | 344 | int retval = 0; |
| 345 | 345 | ||
| 346 | if (count < input_event_size()) | 346 | if (count < input_event_size()) |
| 347 | return -EINVAL; | 347 | return -EINVAL; |
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index c351aa421f8f..da739d9d1905 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
| @@ -449,7 +449,6 @@ static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribut | |||
| 449 | } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) { | 449 | } else if ((drv = driver_find(buf, &gameport_bus)) != NULL) { |
| 450 | gameport_disconnect_port(gameport); | 450 | gameport_disconnect_port(gameport); |
| 451 | error = gameport_bind_driver(gameport, to_gameport_driver(drv)); | 451 | error = gameport_bind_driver(gameport, to_gameport_driver(drv)); |
| 452 | put_driver(drv); | ||
| 453 | } else { | 452 | } else { |
| 454 | error = -EINVAL; | 453 | error = -EINVAL; |
| 455 | } | 454 | } |
diff --git a/drivers/input/input-compat.c b/drivers/input/input-compat.c index e46a86776a6b..64ca7113ff28 100644 --- a/drivers/input/input-compat.c +++ b/drivers/input/input-compat.c | |||
| @@ -17,7 +17,7 @@ | |||
| 17 | int input_event_from_user(const char __user *buffer, | 17 | int input_event_from_user(const char __user *buffer, |
| 18 | struct input_event *event) | 18 | struct input_event *event) |
| 19 | { | 19 | { |
| 20 | if (INPUT_COMPAT_TEST) { | 20 | if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) { |
| 21 | struct input_event_compat compat_event; | 21 | struct input_event_compat compat_event; |
| 22 | 22 | ||
| 23 | if (copy_from_user(&compat_event, buffer, | 23 | if (copy_from_user(&compat_event, buffer, |
| @@ -41,7 +41,7 @@ int input_event_from_user(const char __user *buffer, | |||
| 41 | int input_event_to_user(char __user *buffer, | 41 | int input_event_to_user(char __user *buffer, |
| 42 | const struct input_event *event) | 42 | const struct input_event *event) |
| 43 | { | 43 | { |
| 44 | if (INPUT_COMPAT_TEST) { | 44 | if (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) { |
| 45 | struct input_event_compat compat_event; | 45 | struct input_event_compat compat_event; |
| 46 | 46 | ||
| 47 | compat_event.time.tv_sec = event->time.tv_sec; | 47 | compat_event.time.tv_sec = event->time.tv_sec; |
diff --git a/drivers/input/input-compat.h b/drivers/input/input-compat.h index 22be27b424de..148f66fe3205 100644 --- a/drivers/input/input-compat.h +++ b/drivers/input/input-compat.h | |||
| @@ -67,7 +67,7 @@ struct ff_effect_compat { | |||
| 67 | 67 | ||
| 68 | static inline size_t input_event_size(void) | 68 | static inline size_t input_event_size(void) |
| 69 | { | 69 | { |
| 70 | return INPUT_COMPAT_TEST ? | 70 | return (INPUT_COMPAT_TEST && !COMPAT_USE_64BIT_TIME) ? |
| 71 | sizeof(struct input_event_compat) : sizeof(struct input_event); | 71 | sizeof(struct input_event_compat) : sizeof(struct input_event); |
| 72 | } | 72 | } |
| 73 | 73 | ||
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index c24ec2d5f926..26043cc6a016 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | 13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
| 14 | 14 | ||
| 15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
| 16 | #include <asm/system.h> | ||
| 17 | #include <linux/delay.h> | 16 | #include <linux/delay.h> |
| 18 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
| 19 | #include <linux/joystick.h> | 18 | #include <linux/joystick.h> |
diff --git a/drivers/input/joystick/amijoy.c b/drivers/input/joystick/amijoy.c index 3aa93bf60ae3..c65b5fa69f1e 100644 --- a/drivers/input/joystick/amijoy.c +++ b/drivers/input/joystick/amijoy.c | |||
| @@ -35,7 +35,6 @@ | |||
| 35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
| 36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
| 37 | 37 | ||
| 38 | #include <asm/system.h> | ||
| 39 | #include <asm/amigahw.h> | 38 | #include <asm/amigahw.h> |
| 40 | #include <asm/amigaints.h> | 39 | #include <asm/amigaints.h> |
| 41 | 40 | ||
diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index eeafc30b207b..9d639fa1afbd 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include <mach/jornada720.h> | 28 | #include <mach/jornada720.h> |
| 29 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
| 30 | #include <mach/irqs.h> | ||
| 30 | 31 | ||
| 31 | MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); | 32 | MODULE_AUTHOR("Kristoffer Ericson <Kristoffer.Ericson@gmail.com>"); |
| 32 | MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); | 33 | MODULE_DESCRIPTION("HP Jornada 710/720/728 keyboard driver"); |
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index f2e0cbc5ab64..f9ce1835e4d7 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c | |||
| @@ -105,6 +105,8 @@ static int __devinit pm860x_onkey_probe(struct platform_device *pdev) | |||
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | platform_set_drvdata(pdev, info); | 107 | platform_set_drvdata(pdev, info); |
| 108 | device_init_wakeup(&pdev->dev, 1); | ||
| 109 | |||
| 108 | return 0; | 110 | return 0; |
| 109 | 111 | ||
| 110 | out_irq: | 112 | out_irq: |
| @@ -129,10 +131,34 @@ static int __devexit pm860x_onkey_remove(struct platform_device *pdev) | |||
| 129 | return 0; | 131 | return 0; |
| 130 | } | 132 | } |
| 131 | 133 | ||
| 134 | #ifdef CONFIG_PM_SLEEP | ||
| 135 | static int pm860x_onkey_suspend(struct device *dev) | ||
| 136 | { | ||
| 137 | struct platform_device *pdev = to_platform_device(dev); | ||
| 138 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
| 139 | |||
| 140 | if (device_may_wakeup(dev)) | ||
| 141 | chip->wakeup_flag |= 1 << PM8607_IRQ_ONKEY; | ||
| 142 | return 0; | ||
| 143 | } | ||
| 144 | static int pm860x_onkey_resume(struct device *dev) | ||
| 145 | { | ||
| 146 | struct platform_device *pdev = to_platform_device(dev); | ||
| 147 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | ||
| 148 | |||
| 149 | if (device_may_wakeup(dev)) | ||
| 150 | chip->wakeup_flag &= ~(1 << PM8607_IRQ_ONKEY); | ||
| 151 | return 0; | ||
| 152 | } | ||
| 153 | #endif | ||
| 154 | |||
| 155 | static SIMPLE_DEV_PM_OPS(pm860x_onkey_pm_ops, pm860x_onkey_suspend, pm860x_onkey_resume); | ||
| 156 | |||
| 132 | static struct platform_driver pm860x_onkey_driver = { | 157 | static struct platform_driver pm860x_onkey_driver = { |
| 133 | .driver = { | 158 | .driver = { |
| 134 | .name = "88pm860x-onkey", | 159 | .name = "88pm860x-onkey", |
| 135 | .owner = THIS_MODULE, | 160 | .owner = THIS_MODULE, |
| 161 | .pm = &pm860x_onkey_pm_ops, | ||
| 136 | }, | 162 | }, |
| 137 | .probe = pm860x_onkey_probe, | 163 | .probe = pm860x_onkey_probe, |
| 138 | .remove = __devexit_p(pm860x_onkey_remove), | 164 | .remove = __devexit_p(pm860x_onkey_remove), |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index d62827271802..7faf4a7fcaa9 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
| @@ -380,8 +380,7 @@ config INPUT_TWL4030_VIBRA | |||
| 380 | 380 | ||
| 381 | config INPUT_TWL6040_VIBRA | 381 | config INPUT_TWL6040_VIBRA |
| 382 | tristate "Support for TWL6040 Vibrator" | 382 | tristate "Support for TWL6040 Vibrator" |
| 383 | depends on TWL4030_CORE | 383 | depends on TWL6040_CORE |
| 384 | select TWL6040_CORE | ||
| 385 | select INPUT_FF_MEMLESS | 384 | select INPUT_FF_MEMLESS |
| 386 | help | 385 | help |
| 387 | This option enables support for TWL6040 Vibrator Driver. | 386 | This option enables support for TWL6040 Vibrator Driver. |
| @@ -580,7 +579,7 @@ config INPUT_CMA3000_I2C | |||
| 580 | 579 | ||
| 581 | config INPUT_XEN_KBDDEV_FRONTEND | 580 | config INPUT_XEN_KBDDEV_FRONTEND |
| 582 | tristate "Xen virtual keyboard and mouse support" | 581 | tristate "Xen virtual keyboard and mouse support" |
| 583 | depends on XEN_FBDEV_FRONTEND | 582 | depends on XEN |
| 584 | default y | 583 | default y |
| 585 | select XEN_XENBUS_FRONTEND | 584 | select XEN_XENBUS_FRONTEND |
| 586 | help | 585 | help |
diff --git a/drivers/input/misc/da9052_onkey.c b/drivers/input/misc/da9052_onkey.c index 34aebb8cd080..3c843cd725fa 100644 --- a/drivers/input/misc/da9052_onkey.c +++ b/drivers/input/misc/da9052_onkey.c | |||
| @@ -95,7 +95,8 @@ static int __devinit da9052_onkey_probe(struct platform_device *pdev) | |||
| 95 | input_dev = input_allocate_device(); | 95 | input_dev = input_allocate_device(); |
| 96 | if (!onkey || !input_dev) { | 96 | if (!onkey || !input_dev) { |
| 97 | dev_err(&pdev->dev, "Failed to allocate memory\n"); | 97 | dev_err(&pdev->dev, "Failed to allocate memory\n"); |
| 98 | return -ENOMEM; | 98 | error = -ENOMEM; |
| 99 | goto err_free_mem; | ||
| 99 | } | 100 | } |
| 100 | 101 | ||
| 101 | onkey->input = input_dev; | 102 | onkey->input = input_dev; |
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index 37651373a95b..fc0ed9b43424 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c | |||
| @@ -172,7 +172,7 @@ static void twl4030_vibra_close(struct input_dev *input) | |||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | /*** Module ***/ | 174 | /*** Module ***/ |
| 175 | #if CONFIG_PM | 175 | #ifdef CONFIG_PM_SLEEP |
| 176 | static int twl4030_vibra_suspend(struct device *dev) | 176 | static int twl4030_vibra_suspend(struct device *dev) |
| 177 | { | 177 | { |
| 178 | struct platform_device *pdev = to_platform_device(dev); | 178 | struct platform_device *pdev = to_platform_device(dev); |
| @@ -189,10 +189,10 @@ static int twl4030_vibra_resume(struct device *dev) | |||
| 189 | vibra_disable_leds(); | 189 | vibra_disable_leds(); |
| 190 | return 0; | 190 | return 0; |
| 191 | } | 191 | } |
| 192 | #endif | ||
| 192 | 193 | ||
| 193 | static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, | 194 | static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops, |
| 194 | twl4030_vibra_suspend, twl4030_vibra_resume); | 195 | twl4030_vibra_suspend, twl4030_vibra_resume); |
| 195 | #endif | ||
| 196 | 196 | ||
| 197 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) | 197 | static int __devinit twl4030_vibra_probe(struct platform_device *pdev) |
| 198 | { | 198 | { |
| @@ -273,9 +273,7 @@ static struct platform_driver twl4030_vibra_driver = { | |||
| 273 | .driver = { | 273 | .driver = { |
| 274 | .name = "twl4030-vibra", | 274 | .name = "twl4030-vibra", |
| 275 | .owner = THIS_MODULE, | 275 | .owner = THIS_MODULE, |
| 276 | #ifdef CONFIG_PM | ||
| 277 | .pm = &twl4030_vibra_pm_ops, | 276 | .pm = &twl4030_vibra_pm_ops, |
| 278 | #endif | ||
| 279 | }, | 277 | }, |
| 280 | }; | 278 | }; |
| 281 | module_platform_driver(twl4030_vibra_driver); | 279 | module_platform_driver(twl4030_vibra_driver); |
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c index 45874fed523a..14e94f56cb7d 100644 --- a/drivers/input/misc/twl6040-vibra.c +++ b/drivers/input/misc/twl6040-vibra.c | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
| 29 | #include <linux/platform_device.h> | 29 | #include <linux/platform_device.h> |
| 30 | #include <linux/workqueue.h> | 30 | #include <linux/workqueue.h> |
| 31 | #include <linux/i2c/twl.h> | 31 | #include <linux/input.h> |
| 32 | #include <linux/mfd/twl6040.h> | 32 | #include <linux/mfd/twl6040.h> |
| 33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
| 34 | #include <linux/delay.h> | 34 | #include <linux/delay.h> |
| @@ -257,7 +257,7 @@ static SIMPLE_DEV_PM_OPS(twl6040_vibra_pm_ops, twl6040_vibra_suspend, NULL); | |||
| 257 | 257 | ||
| 258 | static int __devinit twl6040_vibra_probe(struct platform_device *pdev) | 258 | static int __devinit twl6040_vibra_probe(struct platform_device *pdev) |
| 259 | { | 259 | { |
| 260 | struct twl4030_vibra_data *pdata = pdev->dev.platform_data; | 260 | struct twl6040_vibra_data *pdata = pdev->dev.platform_data; |
| 261 | struct vibra_info *info; | 261 | struct vibra_info *info; |
| 262 | int ret; | 262 | int ret; |
| 263 | 263 | ||
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index bd87380bd879..4c6a72d3d48c 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -952,7 +952,9 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int | |||
| 952 | 952 | ||
| 953 | /* | 953 | /* |
| 954 | * First try "E6 report". | 954 | * First try "E6 report". |
| 955 | * ALPS should return 0,0,10 or 0,0,100 | 955 | * ALPS should return 0,0,10 or 0,0,100 if no buttons are pressed. |
| 956 | * The bits 0-2 of the first byte will be 1s if some buttons are | ||
| 957 | * pressed. | ||
| 956 | */ | 958 | */ |
| 957 | param[0] = 0; | 959 | param[0] = 0; |
| 958 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || | 960 | if (ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES) || |
| @@ -968,7 +970,8 @@ static const struct alps_model_info *alps_get_model(struct psmouse *psmouse, int | |||
| 968 | psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", | 970 | psmouse_dbg(psmouse, "E6 report: %2.2x %2.2x %2.2x", |
| 969 | param[0], param[1], param[2]); | 971 | param[0], param[1], param[2]); |
| 970 | 972 | ||
| 971 | if (param[0] != 0 || param[1] != 0 || (param[2] != 10 && param[2] != 100)) | 973 | if ((param[0] & 0xf8) != 0 || param[1] != 0 || |
| 974 | (param[2] != 10 && param[2] != 100)) | ||
| 972 | return NULL; | 975 | return NULL; |
| 973 | 976 | ||
| 974 | /* | 977 | /* |
diff --git a/drivers/input/mouse/amimouse.c b/drivers/input/mouse/amimouse.c index ff5f61a0fd3a..5fa99341a39d 100644 --- a/drivers/input/mouse/amimouse.c +++ b/drivers/input/mouse/amimouse.c | |||
| @@ -25,7 +25,6 @@ | |||
| 25 | 25 | ||
| 26 | #include <asm/irq.h> | 26 | #include <asm/irq.h> |
| 27 | #include <asm/setup.h> | 27 | #include <asm/setup.h> |
| 28 | #include <asm/system.h> | ||
| 29 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
| 30 | #include <asm/amigahw.h> | 29 | #include <asm/amigahw.h> |
| 31 | #include <asm/amigaints.h> | 30 | #include <asm/amigaints.h> |
diff --git a/drivers/input/mouse/atarimouse.c b/drivers/input/mouse/atarimouse.c index 5c4a692bf73a..d1c43236b125 100644 --- a/drivers/input/mouse/atarimouse.c +++ b/drivers/input/mouse/atarimouse.c | |||
| @@ -47,7 +47,6 @@ | |||
| 47 | 47 | ||
| 48 | #include <asm/irq.h> | 48 | #include <asm/irq.h> |
| 49 | #include <asm/setup.h> | 49 | #include <asm/setup.h> |
| 50 | #include <asm/system.h> | ||
| 51 | #include <asm/uaccess.h> | 50 | #include <asm/uaccess.h> |
| 52 | #include <asm/atarihw.h> | 51 | #include <asm/atarihw.h> |
| 53 | #include <asm/atarikb.h> | 52 | #include <asm/atarikb.h> |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index d2c0db159b18..479011004a11 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -486,7 +486,6 @@ static void elantech_input_sync_v4(struct psmouse *psmouse) | |||
| 486 | unsigned char *packet = psmouse->packet; | 486 | unsigned char *packet = psmouse->packet; |
| 487 | 487 | ||
| 488 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); | 488 | input_report_key(dev, BTN_LEFT, packet[0] & 0x01); |
| 489 | input_report_key(dev, BTN_RIGHT, packet[0] & 0x02); | ||
| 490 | input_mt_report_pointer_emulation(dev, true); | 489 | input_mt_report_pointer_emulation(dev, true); |
| 491 | input_sync(dev); | 490 | input_sync(dev); |
| 492 | } | 491 | } |
| @@ -967,6 +966,7 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
| 967 | if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) | 966 | if (elantech_set_range(psmouse, &x_min, &y_min, &x_max, &y_max, &width)) |
| 968 | return -1; | 967 | return -1; |
| 969 | 968 | ||
| 969 | __set_bit(INPUT_PROP_POINTER, dev->propbit); | ||
| 970 | __set_bit(EV_KEY, dev->evbit); | 970 | __set_bit(EV_KEY, dev->evbit); |
| 971 | __set_bit(EV_ABS, dev->evbit); | 971 | __set_bit(EV_ABS, dev->evbit); |
| 972 | __clear_bit(EV_REL, dev->evbit); | 972 | __clear_bit(EV_REL, dev->evbit); |
| @@ -1017,7 +1017,9 @@ static int elantech_set_input_params(struct psmouse *psmouse) | |||
| 1017 | */ | 1017 | */ |
| 1018 | psmouse_warn(psmouse, "couldn't query resolution data.\n"); | 1018 | psmouse_warn(psmouse, "couldn't query resolution data.\n"); |
| 1019 | } | 1019 | } |
| 1020 | 1020 | /* v4 is clickpad, with only one button. */ | |
| 1021 | __set_bit(INPUT_PROP_BUTTONPAD, dev->propbit); | ||
| 1022 | __clear_bit(BTN_RIGHT, dev->keybit); | ||
| 1021 | __set_bit(BTN_TOOL_QUADTAP, dev->keybit); | 1023 | __set_bit(BTN_TOOL_QUADTAP, dev->keybit); |
| 1022 | /* For X to recognize me as touchpad. */ | 1024 | /* For X to recognize me as touchpad. */ |
| 1023 | input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); | 1025 | input_set_abs_params(dev, ABS_X, x_min, x_max, 0, 0); |
| @@ -1245,6 +1247,8 @@ static void elantech_disconnect(struct psmouse *psmouse) | |||
| 1245 | */ | 1247 | */ |
| 1246 | static int elantech_reconnect(struct psmouse *psmouse) | 1248 | static int elantech_reconnect(struct psmouse *psmouse) |
| 1247 | { | 1249 | { |
| 1250 | psmouse_reset(psmouse); | ||
| 1251 | |||
| 1248 | if (elantech_detect(psmouse, 0)) | 1252 | if (elantech_detect(psmouse, 0)) |
| 1249 | return -1; | 1253 | return -1; |
| 1250 | 1254 | ||
| @@ -1324,6 +1328,8 @@ int elantech_init(struct psmouse *psmouse) | |||
| 1324 | if (!etd) | 1328 | if (!etd) |
| 1325 | return -ENOMEM; | 1329 | return -ENOMEM; |
| 1326 | 1330 | ||
| 1331 | psmouse_reset(psmouse); | ||
| 1332 | |||
| 1327 | etd->parity[0] = 1; | 1333 | etd->parity[0] = 1; |
| 1328 | for (i = 1; i < 256; i++) | 1334 | for (i = 1; i < 256; i++) |
| 1329 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; | 1335 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; |
diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index a9ad8e1402be..39fe9b737cae 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c | |||
| @@ -12,9 +12,9 @@ | |||
| 12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
| 13 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
| 14 | #include <linux/input-polldev.h> | 14 | #include <linux/input-polldev.h> |
| 15 | #include <linux/gpio.h> | ||
| 15 | #include <linux/gpio_mouse.h> | 16 | #include <linux/gpio_mouse.h> |
| 16 | 17 | ||
| 17 | #include <asm/gpio.h> | ||
| 18 | 18 | ||
| 19 | /* | 19 | /* |
| 20 | * Timer function which is run every scan_ms ms when the device is opened. | 20 | * Timer function which is run every scan_ms ms when the device is opened. |
diff --git a/drivers/input/mouse/sentelic.c b/drivers/input/mouse/sentelic.c index a977bfaa6821..661a0ca3b3d6 100644 --- a/drivers/input/mouse/sentelic.c +++ b/drivers/input/mouse/sentelic.c | |||
| @@ -741,6 +741,14 @@ static psmouse_ret_t fsp_process_byte(struct psmouse *psmouse) | |||
| 741 | } | 741 | } |
| 742 | } else { | 742 | } else { |
| 743 | /* SFAC packet */ | 743 | /* SFAC packet */ |
| 744 | if ((packet[0] & (FSP_PB0_LBTN|FSP_PB0_PHY_BTN)) == | ||
| 745 | FSP_PB0_LBTN) { | ||
| 746 | /* On-pad click in SFAC mode should be handled | ||
| 747 | * by userspace. On-pad clicks in MFMC mode | ||
| 748 | * are real clickpad clicks, and not ignored. | ||
| 749 | */ | ||
| 750 | packet[0] &= ~FSP_PB0_LBTN; | ||
| 751 | } | ||
| 744 | 752 | ||
| 745 | /* no multi-finger information */ | 753 | /* no multi-finger information */ |
| 746 | ad->last_mt_fgr = 0; | 754 | ad->last_mt_fgr = 0; |
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index 22b218018137..f3102494237d 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
| @@ -304,7 +304,7 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) | |||
| 304 | return 0; | 304 | return 0; |
| 305 | 305 | ||
| 306 | if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { | 306 | if (trackpoint_read(&psmouse->ps2dev, TP_EXT_BTN, &button_info)) { |
| 307 | printk(KERN_WARNING "trackpoint.c: failed to get extended button data\n"); | 307 | psmouse_warn(psmouse, "failed to get extended button data\n"); |
| 308 | button_info = 0; | 308 | button_info = 0; |
| 309 | } | 309 | } |
| 310 | 310 | ||
| @@ -326,16 +326,18 @@ int trackpoint_detect(struct psmouse *psmouse, bool set_properties) | |||
| 326 | 326 | ||
| 327 | error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group); | 327 | error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group); |
| 328 | if (error) { | 328 | if (error) { |
| 329 | printk(KERN_ERR | 329 | psmouse_err(psmouse, |
| 330 | "trackpoint.c: failed to create sysfs attributes, error: %d\n", | 330 | "failed to create sysfs attributes, error: %d\n", |
| 331 | error); | 331 | error); |
| 332 | kfree(psmouse->private); | 332 | kfree(psmouse->private); |
| 333 | psmouse->private = NULL; | 333 | psmouse->private = NULL; |
| 334 | return -1; | 334 | return -1; |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n", | 337 | psmouse_info(psmouse, |
| 338 | firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); | 338 | "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n", |
| 339 | firmware_id, | ||
| 340 | (button_info & 0xf0) >> 4, button_info & 0x0f); | ||
| 339 | 341 | ||
| 340 | return 0; | 342 | return 0; |
| 341 | } | 343 | } |
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index 8407d5b0ced8..2ffd110bd5bc 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
| @@ -208,18 +208,7 @@ static struct amba_driver ambakmi_driver = { | |||
| 208 | .resume = amba_kmi_resume, | 208 | .resume = amba_kmi_resume, |
| 209 | }; | 209 | }; |
| 210 | 210 | ||
| 211 | static int __init amba_kmi_init(void) | 211 | module_amba_driver(ambakmi_driver); |
| 212 | { | ||
| 213 | return amba_driver_register(&ambakmi_driver); | ||
| 214 | } | ||
| 215 | |||
| 216 | static void __exit amba_kmi_exit(void) | ||
| 217 | { | ||
| 218 | amba_driver_unregister(&ambakmi_driver); | ||
| 219 | } | ||
| 220 | |||
| 221 | module_init(amba_kmi_init); | ||
| 222 | module_exit(amba_kmi_exit); | ||
| 223 | 212 | ||
| 224 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); | 213 | MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); |
| 225 | MODULE_DESCRIPTION("AMBA KMI controller driver"); | 214 | MODULE_DESCRIPTION("AMBA KMI controller driver"); |
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index d4d08bd9205b..f5fbdf94de3b 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c | |||
| @@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id) | |||
| 92 | static int ams_delta_serio_open(struct serio *serio) | 92 | static int ams_delta_serio_open(struct serio *serio) |
| 93 | { | 93 | { |
| 94 | /* enable keyboard */ | 94 | /* enable keyboard */ |
| 95 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, | 95 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1); |
| 96 | AMD_DELTA_LATCH2_KEYBRD_PWR); | ||
| 97 | 96 | ||
| 98 | return 0; | 97 | return 0; |
| 99 | } | 98 | } |
| @@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio) | |||
| 101 | static void ams_delta_serio_close(struct serio *serio) | 100 | static void ams_delta_serio_close(struct serio *serio) |
| 102 | { | 101 | { |
| 103 | /* disable keyboard */ | 102 | /* disable keyboard */ |
| 104 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); | 103 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0); |
| 105 | } | 104 | } |
| 106 | 105 | ||
| 106 | static const struct gpio ams_delta_gpios[] __initconst_or_module = { | ||
| 107 | { | ||
| 108 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA, | ||
| 109 | .flags = GPIOF_DIR_IN, | ||
| 110 | .label = "serio-data", | ||
| 111 | }, | ||
| 112 | { | ||
| 113 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK, | ||
| 114 | .flags = GPIOF_DIR_IN, | ||
| 115 | .label = "serio-clock", | ||
| 116 | }, | ||
| 117 | { | ||
| 118 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR, | ||
| 119 | .flags = GPIOF_OUT_INIT_LOW, | ||
| 120 | .label = "serio-power", | ||
| 121 | }, | ||
| 122 | { | ||
| 123 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT, | ||
| 124 | .flags = GPIOF_OUT_INIT_LOW, | ||
| 125 | .label = "serio-dataout", | ||
| 126 | }, | ||
| 127 | }; | ||
| 128 | |||
| 107 | static int __init ams_delta_serio_init(void) | 129 | static int __init ams_delta_serio_init(void) |
| 108 | { | 130 | { |
| 109 | int err; | 131 | int err; |
| @@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void) | |||
| 123 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", | 145 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", |
| 124 | sizeof(ams_delta_serio->phys)); | 146 | sizeof(ams_delta_serio->phys)); |
| 125 | 147 | ||
| 126 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); | 148 | err = gpio_request_array(ams_delta_gpios, |
| 149 | ARRAY_SIZE(ams_delta_gpios)); | ||
| 127 | if (err) { | 150 | if (err) { |
| 128 | pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); | 151 | pr_err("ams_delta_serio: Couldn't request gpio pins\n"); |
| 129 | goto serio; | 152 | goto serio; |
| 130 | } | 153 | } |
| 131 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
| 132 | |||
| 133 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock"); | ||
| 134 | if (err) { | ||
| 135 | pr_err("ams_delta_serio: couldn't request gpio pin for clock\n"); | ||
| 136 | goto gpio_data; | ||
| 137 | } | ||
| 138 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | ||
| 139 | 154 | ||
| 140 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), | 155 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), |
| 141 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, | 156 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, |
| @@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void) | |||
| 143 | if (err < 0) { | 158 | if (err < 0) { |
| 144 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", | 159 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", |
| 145 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); | 160 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); |
| 146 | goto gpio_clk; | 161 | goto gpio; |
| 147 | } | 162 | } |
| 148 | /* | 163 | /* |
| 149 | * Since GPIO register handling for keyboard clock pin is performed | 164 | * Since GPIO register handling for keyboard clock pin is performed |
| @@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void) | |||
| 157 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); | 172 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); |
| 158 | 173 | ||
| 159 | return 0; | 174 | return 0; |
| 160 | gpio_clk: | 175 | gpio: |
| 161 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 176 | gpio_free_array(ams_delta_gpios, |
| 162 | gpio_data: | 177 | ARRAY_SIZE(ams_delta_gpios)); |
| 163 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
| 164 | serio: | 178 | serio: |
| 165 | kfree(ams_delta_serio); | 179 | kfree(ams_delta_serio); |
| 166 | return err; | 180 | return err; |
| @@ -170,8 +184,8 @@ module_init(ams_delta_serio_init); | |||
| 170 | static void __exit ams_delta_serio_exit(void) | 184 | static void __exit ams_delta_serio_exit(void) |
| 171 | { | 185 | { |
| 172 | serio_unregister_port(ams_delta_serio); | 186 | serio_unregister_port(ams_delta_serio); |
| 173 | free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); | 187 | free_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); |
| 174 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 188 | gpio_free_array(ams_delta_gpios, |
| 175 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | 189 | ARRAY_SIZE(ams_delta_gpios)); |
| 176 | } | 190 | } |
| 177 | module_exit(ams_delta_serio_exit); | 191 | module_exit(ams_delta_serio_exit); |
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c index be3316073ae7..09a089996ded 100644 --- a/drivers/input/serio/hp_sdc.c +++ b/drivers/input/serio/hp_sdc.c | |||
| @@ -71,7 +71,6 @@ | |||
| 71 | #include <linux/slab.h> | 71 | #include <linux/slab.h> |
| 72 | #include <linux/hil.h> | 72 | #include <linux/hil.h> |
| 73 | #include <asm/io.h> | 73 | #include <asm/io.h> |
| 74 | #include <asm/system.h> | ||
| 75 | 74 | ||
| 76 | /* Machine-specific abstraction */ | 75 | /* Machine-specific abstraction */ |
| 77 | 76 | ||
diff --git a/drivers/input/serio/maceps2.c b/drivers/input/serio/maceps2.c index 558200e96d0f..61da763b1209 100644 --- a/drivers/input/serio/maceps2.c +++ b/drivers/input/serio/maceps2.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | 21 | ||
| 22 | #include <asm/io.h> | 22 | #include <asm/io.h> |
| 23 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
| 24 | #include <asm/system.h> | ||
| 25 | #include <asm/ip32/mace.h> | 24 | #include <asm/ip32/mace.h> |
| 26 | #include <asm/ip32/ip32_ints.h> | 25 | #include <asm/ip32/ip32_ints.h> |
| 27 | 26 | ||
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c index 8b44ddc8041c..2af5df6a8fba 100644 --- a/drivers/input/serio/rpckbd.c +++ b/drivers/input/serio/rpckbd.c | |||
| @@ -36,16 +36,19 @@ | |||
| 36 | #include <linux/io.h> | 36 | #include <linux/io.h> |
| 37 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
| 38 | 38 | ||
| 39 | #include <asm/irq.h> | ||
| 40 | #include <mach/hardware.h> | 39 | #include <mach/hardware.h> |
| 41 | #include <asm/hardware/iomd.h> | 40 | #include <asm/hardware/iomd.h> |
| 42 | #include <asm/system.h> | ||
| 43 | 41 | ||
| 44 | MODULE_AUTHOR("Vojtech Pavlik, Russell King"); | 42 | MODULE_AUTHOR("Vojtech Pavlik, Russell King"); |
| 45 | MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); | 43 | MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver"); |
| 46 | MODULE_LICENSE("GPL"); | 44 | MODULE_LICENSE("GPL"); |
| 47 | MODULE_ALIAS("platform:kart"); | 45 | MODULE_ALIAS("platform:kart"); |
| 48 | 46 | ||
| 47 | struct rpckbd_data { | ||
| 48 | int tx_irq; | ||
| 49 | int rx_irq; | ||
| 50 | }; | ||
| 51 | |||
| 49 | static int rpckbd_write(struct serio *port, unsigned char val) | 52 | static int rpckbd_write(struct serio *port, unsigned char val) |
| 50 | { | 53 | { |
| 51 | while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) | 54 | while (!(iomd_readb(IOMD_KCTRL) & (1 << 7))) |
| @@ -78,19 +81,21 @@ static irqreturn_t rpckbd_tx(int irq, void *dev_id) | |||
| 78 | 81 | ||
| 79 | static int rpckbd_open(struct serio *port) | 82 | static int rpckbd_open(struct serio *port) |
| 80 | { | 83 | { |
| 84 | struct rpckbd_data *rpckbd = port->port_data; | ||
| 85 | |||
| 81 | /* Reset the keyboard state machine. */ | 86 | /* Reset the keyboard state machine. */ |
| 82 | iomd_writeb(0, IOMD_KCTRL); | 87 | iomd_writeb(0, IOMD_KCTRL); |
| 83 | iomd_writeb(8, IOMD_KCTRL); | 88 | iomd_writeb(8, IOMD_KCTRL); |
| 84 | iomd_readb(IOMD_KARTRX); | 89 | iomd_readb(IOMD_KARTRX); |
| 85 | 90 | ||
| 86 | if (request_irq(IRQ_KEYBOARDRX, rpckbd_rx, 0, "rpckbd", port) != 0) { | 91 | if (request_irq(rpckbd->rx_irq, rpckbd_rx, 0, "rpckbd", port) != 0) { |
| 87 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n"); | 92 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard receive IRQ\n"); |
| 88 | return -EBUSY; | 93 | return -EBUSY; |
| 89 | } | 94 | } |
| 90 | 95 | ||
| 91 | if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) { | 96 | if (request_irq(rpckbd->tx_irq, rpckbd_tx, 0, "rpckbd", port) != 0) { |
| 92 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); | 97 | printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); |
| 93 | free_irq(IRQ_KEYBOARDRX, port); | 98 | free_irq(rpckbd->rx_irq, port); |
| 94 | return -EBUSY; | 99 | return -EBUSY; |
| 95 | } | 100 | } |
| 96 | 101 | ||
| @@ -99,8 +104,10 @@ static int rpckbd_open(struct serio *port) | |||
| 99 | 104 | ||
| 100 | static void rpckbd_close(struct serio *port) | 105 | static void rpckbd_close(struct serio *port) |
| 101 | { | 106 | { |
| 102 | free_irq(IRQ_KEYBOARDRX, port); | 107 | struct rpckbd_data *rpckbd = port->port_data; |
| 103 | free_irq(IRQ_KEYBOARDTX, port); | 108 | |
| 109 | free_irq(rpckbd->rx_irq, port); | ||
| 110 | free_irq(rpckbd->tx_irq, port); | ||
| 104 | } | 111 | } |
| 105 | 112 | ||
| 106 | /* | 113 | /* |
| @@ -109,17 +116,35 @@ static void rpckbd_close(struct serio *port) | |||
| 109 | */ | 116 | */ |
| 110 | static int __devinit rpckbd_probe(struct platform_device *dev) | 117 | static int __devinit rpckbd_probe(struct platform_device *dev) |
| 111 | { | 118 | { |
| 119 | struct rpckbd_data *rpckbd; | ||
| 112 | struct serio *serio; | 120 | struct serio *serio; |
| 121 | int tx_irq, rx_irq; | ||
| 122 | |||
| 123 | rx_irq = platform_get_irq(dev, 0); | ||
| 124 | if (rx_irq <= 0) | ||
| 125 | return rx_irq < 0 ? rx_irq : -ENXIO; | ||
| 126 | |||
| 127 | tx_irq = platform_get_irq(dev, 1); | ||
| 128 | if (tx_irq <= 0) | ||
| 129 | return tx_irq < 0 ? tx_irq : -ENXIO; | ||
| 113 | 130 | ||
| 114 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); | 131 | serio = kzalloc(sizeof(struct serio), GFP_KERNEL); |
| 115 | if (!serio) | 132 | rpckbd = kzalloc(sizeof(*rpckbd), GFP_KERNEL); |
| 133 | if (!serio || !rpckbd) { | ||
| 134 | kfree(rpckbd); | ||
| 135 | kfree(serio); | ||
| 116 | return -ENOMEM; | 136 | return -ENOMEM; |
| 137 | } | ||
| 138 | |||
| 139 | rpckbd->rx_irq = rx_irq; | ||
| 140 | rpckbd->tx_irq = tx_irq; | ||
| 117 | 141 | ||
| 118 | serio->id.type = SERIO_8042; | 142 | serio->id.type = SERIO_8042; |
| 119 | serio->write = rpckbd_write; | 143 | serio->write = rpckbd_write; |
| 120 | serio->open = rpckbd_open; | 144 | serio->open = rpckbd_open; |
| 121 | serio->close = rpckbd_close; | 145 | serio->close = rpckbd_close; |
| 122 | serio->dev.parent = &dev->dev; | 146 | serio->dev.parent = &dev->dev; |
| 147 | serio->port_data = rpckbd; | ||
| 123 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); | 148 | strlcpy(serio->name, "RiscPC PS/2 kbd port", sizeof(serio->name)); |
| 124 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); | 149 | strlcpy(serio->phys, "rpckbd/serio0", sizeof(serio->phys)); |
| 125 | 150 | ||
| @@ -131,7 +156,11 @@ static int __devinit rpckbd_probe(struct platform_device *dev) | |||
| 131 | static int __devexit rpckbd_remove(struct platform_device *dev) | 156 | static int __devexit rpckbd_remove(struct platform_device *dev) |
| 132 | { | 157 | { |
| 133 | struct serio *serio = platform_get_drvdata(dev); | 158 | struct serio *serio = platform_get_drvdata(dev); |
| 159 | struct rpckbd_data *rpckbd = serio->port_data; | ||
| 160 | |||
| 134 | serio_unregister_port(serio); | 161 | serio_unregister_port(serio); |
| 162 | kfree(rpckbd); | ||
| 163 | |||
| 135 | return 0; | 164 | return 0; |
| 136 | } | 165 | } |
| 137 | 166 | ||
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c index 44fc8b4bcd81..389766707534 100644 --- a/drivers/input/serio/sa1111ps2.c +++ b/drivers/input/serio/sa1111ps2.c | |||
| @@ -20,10 +20,29 @@ | |||
| 20 | #include <linux/spinlock.h> | 20 | #include <linux/spinlock.h> |
| 21 | 21 | ||
| 22 | #include <asm/io.h> | 22 | #include <asm/io.h> |
| 23 | #include <asm/system.h> | ||
| 24 | 23 | ||
| 25 | #include <asm/hardware/sa1111.h> | 24 | #include <asm/hardware/sa1111.h> |
| 26 | 25 | ||
| 26 | #define PS2CR 0x0000 | ||
| 27 | #define PS2STAT 0x0004 | ||
| 28 | #define PS2DATA 0x0008 | ||
| 29 | #define PS2CLKDIV 0x000c | ||
| 30 | #define PS2PRECNT 0x0010 | ||
| 31 | |||
| 32 | #define PS2CR_ENA 0x08 | ||
| 33 | #define PS2CR_FKD 0x02 | ||
| 34 | #define PS2CR_FKC 0x01 | ||
| 35 | |||
| 36 | #define PS2STAT_STP 0x0100 | ||
| 37 | #define PS2STAT_TXE 0x0080 | ||
| 38 | #define PS2STAT_TXB 0x0040 | ||
| 39 | #define PS2STAT_RXF 0x0020 | ||
| 40 | #define PS2STAT_RXB 0x0010 | ||
| 41 | #define PS2STAT_ENA 0x0008 | ||
| 42 | #define PS2STAT_RXP 0x0004 | ||
| 43 | #define PS2STAT_KBD 0x0002 | ||
| 44 | #define PS2STAT_KBC 0x0001 | ||
| 45 | |||
| 27 | struct ps2if { | 46 | struct ps2if { |
| 28 | struct serio *io; | 47 | struct serio *io; |
| 29 | struct sa1111_dev *dev; | 48 | struct sa1111_dev *dev; |
| @@ -45,22 +64,22 @@ static irqreturn_t ps2_rxint(int irq, void *dev_id) | |||
| 45 | struct ps2if *ps2if = dev_id; | 64 | struct ps2if *ps2if = dev_id; |
| 46 | unsigned int scancode, flag, status; | 65 | unsigned int scancode, flag, status; |
| 47 | 66 | ||
| 48 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 67 | status = sa1111_readl(ps2if->base + PS2STAT); |
| 49 | while (status & PS2STAT_RXF) { | 68 | while (status & PS2STAT_RXF) { |
| 50 | if (status & PS2STAT_STP) | 69 | if (status & PS2STAT_STP) |
| 51 | sa1111_writel(PS2STAT_STP, ps2if->base + SA1111_PS2STAT); | 70 | sa1111_writel(PS2STAT_STP, ps2if->base + PS2STAT); |
| 52 | 71 | ||
| 53 | flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) | | 72 | flag = (status & PS2STAT_STP ? SERIO_FRAME : 0) | |
| 54 | (status & PS2STAT_RXP ? 0 : SERIO_PARITY); | 73 | (status & PS2STAT_RXP ? 0 : SERIO_PARITY); |
| 55 | 74 | ||
| 56 | scancode = sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff; | 75 | scancode = sa1111_readl(ps2if->base + PS2DATA) & 0xff; |
| 57 | 76 | ||
| 58 | if (hweight8(scancode) & 1) | 77 | if (hweight8(scancode) & 1) |
| 59 | flag ^= SERIO_PARITY; | 78 | flag ^= SERIO_PARITY; |
| 60 | 79 | ||
| 61 | serio_interrupt(ps2if->io, scancode, flag); | 80 | serio_interrupt(ps2if->io, scancode, flag); |
| 62 | 81 | ||
| 63 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 82 | status = sa1111_readl(ps2if->base + PS2STAT); |
| 64 | } | 83 | } |
| 65 | 84 | ||
| 66 | return IRQ_HANDLED; | 85 | return IRQ_HANDLED; |
| @@ -75,12 +94,12 @@ static irqreturn_t ps2_txint(int irq, void *dev_id) | |||
| 75 | unsigned int status; | 94 | unsigned int status; |
| 76 | 95 | ||
| 77 | spin_lock(&ps2if->lock); | 96 | spin_lock(&ps2if->lock); |
| 78 | status = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 97 | status = sa1111_readl(ps2if->base + PS2STAT); |
| 79 | if (ps2if->head == ps2if->tail) { | 98 | if (ps2if->head == ps2if->tail) { |
| 80 | disable_irq_nosync(irq); | 99 | disable_irq_nosync(irq); |
| 81 | /* done */ | 100 | /* done */ |
| 82 | } else if (status & PS2STAT_TXE) { | 101 | } else if (status & PS2STAT_TXE) { |
| 83 | sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + SA1111_PS2DATA); | 102 | sa1111_writel(ps2if->buf[ps2if->tail], ps2if->base + PS2DATA); |
| 84 | ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); | 103 | ps2if->tail = (ps2if->tail + 1) & (sizeof(ps2if->buf) - 1); |
| 85 | } | 104 | } |
| 86 | spin_unlock(&ps2if->lock); | 105 | spin_unlock(&ps2if->lock); |
| @@ -103,8 +122,8 @@ static int ps2_write(struct serio *io, unsigned char val) | |||
| 103 | /* | 122 | /* |
| 104 | * If the TX register is empty, we can go straight out. | 123 | * If the TX register is empty, we can go straight out. |
| 105 | */ | 124 | */ |
| 106 | if (sa1111_readl(ps2if->base + SA1111_PS2STAT) & PS2STAT_TXE) { | 125 | if (sa1111_readl(ps2if->base + PS2STAT) & PS2STAT_TXE) { |
| 107 | sa1111_writel(val, ps2if->base + SA1111_PS2DATA); | 126 | sa1111_writel(val, ps2if->base + PS2DATA); |
| 108 | } else { | 127 | } else { |
| 109 | if (ps2if->head == ps2if->tail) | 128 | if (ps2if->head == ps2if->tail) |
| 110 | enable_irq(ps2if->dev->irq[1]); | 129 | enable_irq(ps2if->dev->irq[1]); |
| @@ -124,13 +143,16 @@ static int ps2_open(struct serio *io) | |||
| 124 | struct ps2if *ps2if = io->port_data; | 143 | struct ps2if *ps2if = io->port_data; |
| 125 | int ret; | 144 | int ret; |
| 126 | 145 | ||
| 127 | sa1111_enable_device(ps2if->dev); | 146 | ret = sa1111_enable_device(ps2if->dev); |
| 147 | if (ret) | ||
| 148 | return ret; | ||
| 128 | 149 | ||
| 129 | ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, | 150 | ret = request_irq(ps2if->dev->irq[0], ps2_rxint, 0, |
| 130 | SA1111_DRIVER_NAME(ps2if->dev), ps2if); | 151 | SA1111_DRIVER_NAME(ps2if->dev), ps2if); |
| 131 | if (ret) { | 152 | if (ret) { |
| 132 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", | 153 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", |
| 133 | ps2if->dev->irq[0], ret); | 154 | ps2if->dev->irq[0], ret); |
| 155 | sa1111_disable_device(ps2if->dev); | ||
| 134 | return ret; | 156 | return ret; |
| 135 | } | 157 | } |
| 136 | 158 | ||
| @@ -140,6 +162,7 @@ static int ps2_open(struct serio *io) | |||
| 140 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", | 162 | printk(KERN_ERR "sa1111ps2: could not allocate IRQ%d: %d\n", |
| 141 | ps2if->dev->irq[1], ret); | 163 | ps2if->dev->irq[1], ret); |
| 142 | free_irq(ps2if->dev->irq[0], ps2if); | 164 | free_irq(ps2if->dev->irq[0], ps2if); |
| 165 | sa1111_disable_device(ps2if->dev); | ||
| 143 | return ret; | 166 | return ret; |
| 144 | } | 167 | } |
| 145 | 168 | ||
| @@ -147,7 +170,7 @@ static int ps2_open(struct serio *io) | |||
| 147 | 170 | ||
| 148 | enable_irq_wake(ps2if->dev->irq[0]); | 171 | enable_irq_wake(ps2if->dev->irq[0]); |
| 149 | 172 | ||
| 150 | sa1111_writel(PS2CR_ENA, ps2if->base + SA1111_PS2CR); | 173 | sa1111_writel(PS2CR_ENA, ps2if->base + PS2CR); |
| 151 | return 0; | 174 | return 0; |
| 152 | } | 175 | } |
| 153 | 176 | ||
| @@ -155,7 +178,7 @@ static void ps2_close(struct serio *io) | |||
| 155 | { | 178 | { |
| 156 | struct ps2if *ps2if = io->port_data; | 179 | struct ps2if *ps2if = io->port_data; |
| 157 | 180 | ||
| 158 | sa1111_writel(0, ps2if->base + SA1111_PS2CR); | 181 | sa1111_writel(0, ps2if->base + PS2CR); |
| 159 | 182 | ||
| 160 | disable_irq_wake(ps2if->dev->irq[0]); | 183 | disable_irq_wake(ps2if->dev->irq[0]); |
| 161 | 184 | ||
| @@ -175,7 +198,7 @@ static void __devinit ps2_clear_input(struct ps2if *ps2if) | |||
| 175 | int maxread = 100; | 198 | int maxread = 100; |
| 176 | 199 | ||
| 177 | while (maxread--) { | 200 | while (maxread--) { |
| 178 | if ((sa1111_readl(ps2if->base + SA1111_PS2DATA) & 0xff) == 0xff) | 201 | if ((sa1111_readl(ps2if->base + PS2DATA) & 0xff) == 0xff) |
| 179 | break; | 202 | break; |
| 180 | } | 203 | } |
| 181 | } | 204 | } |
| @@ -185,11 +208,11 @@ static unsigned int __devinit ps2_test_one(struct ps2if *ps2if, | |||
| 185 | { | 208 | { |
| 186 | unsigned int val; | 209 | unsigned int val; |
| 187 | 210 | ||
| 188 | sa1111_writel(PS2CR_ENA | mask, ps2if->base + SA1111_PS2CR); | 211 | sa1111_writel(PS2CR_ENA | mask, ps2if->base + PS2CR); |
| 189 | 212 | ||
| 190 | udelay(2); | 213 | udelay(2); |
| 191 | 214 | ||
| 192 | val = sa1111_readl(ps2if->base + SA1111_PS2STAT); | 215 | val = sa1111_readl(ps2if->base + PS2STAT); |
| 193 | return val & (PS2STAT_KBC | PS2STAT_KBD); | 216 | return val & (PS2STAT_KBC | PS2STAT_KBD); |
| 194 | } | 217 | } |
| 195 | 218 | ||
| @@ -220,7 +243,7 @@ static int __devinit ps2_test(struct ps2if *ps2if) | |||
| 220 | ret = -ENODEV; | 243 | ret = -ENODEV; |
| 221 | } | 244 | } |
| 222 | 245 | ||
| 223 | sa1111_writel(0, ps2if->base + SA1111_PS2CR); | 246 | sa1111_writel(0, ps2if->base + PS2CR); |
| 224 | 247 | ||
| 225 | return ret; | 248 | return ret; |
| 226 | } | 249 | } |
| @@ -274,8 +297,8 @@ static int __devinit ps2_probe(struct sa1111_dev *dev) | |||
| 274 | sa1111_enable_device(ps2if->dev); | 297 | sa1111_enable_device(ps2if->dev); |
| 275 | 298 | ||
| 276 | /* Incoming clock is 8MHz */ | 299 | /* Incoming clock is 8MHz */ |
| 277 | sa1111_writel(0, ps2if->base + SA1111_PS2CLKDIV); | 300 | sa1111_writel(0, ps2if->base + PS2CLKDIV); |
| 278 | sa1111_writel(127, ps2if->base + SA1111_PS2PRECNT); | 301 | sa1111_writel(127, ps2if->base + PS2PRECNT); |
| 279 | 302 | ||
| 280 | /* | 303 | /* |
| 281 | * Flush any pending input. | 304 | * Flush any pending input. |
| @@ -330,6 +353,7 @@ static int __devexit ps2_remove(struct sa1111_dev *dev) | |||
| 330 | static struct sa1111_driver ps2_driver = { | 353 | static struct sa1111_driver ps2_driver = { |
| 331 | .drv = { | 354 | .drv = { |
| 332 | .name = "sa1111-ps2", | 355 | .name = "sa1111-ps2", |
| 356 | .owner = THIS_MODULE, | ||
| 333 | }, | 357 | }, |
| 334 | .devid = SA1111_DEVID_PS2, | 358 | .devid = SA1111_DEVID_PS2, |
| 335 | .probe = ps2_probe, | 359 | .probe = ps2_probe, |
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index ba70058e2be3..d0f7533dbf88 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c | |||
| @@ -441,7 +441,6 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute * | |||
| 441 | } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { | 441 | } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { |
| 442 | serio_disconnect_port(serio); | 442 | serio_disconnect_port(serio); |
| 443 | error = serio_bind_driver(serio, to_serio_driver(drv)); | 443 | error = serio_bind_driver(serio, to_serio_driver(drv)); |
| 444 | put_driver(drv); | ||
| 445 | serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT); | 444 | serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT); |
| 446 | } else { | 445 | } else { |
| 447 | error = -EINVAL; | 446 | error = -EINVAL; |
diff --git a/drivers/input/tablet/Kconfig b/drivers/input/tablet/Kconfig index 0edeb949109b..bed7cbf84cfd 100644 --- a/drivers/input/tablet/Kconfig +++ b/drivers/input/tablet/Kconfig | |||
| @@ -78,6 +78,8 @@ config TABLET_USB_WACOM | |||
| 78 | depends on USB_ARCH_HAS_HCD | 78 | depends on USB_ARCH_HAS_HCD |
| 79 | select POWER_SUPPLY | 79 | select POWER_SUPPLY |
| 80 | select USB | 80 | select USB |
| 81 | select NEW_LEDS | ||
| 82 | select LEDS_CLASS | ||
| 81 | help | 83 | help |
| 82 | Say Y here if you want to use the USB version of the Wacom Intuos | 84 | Say Y here if you want to use the USB version of the Wacom Intuos |
| 83 | or Graphire tablet. Make sure to say Y to "Mouse support" | 85 | or Graphire tablet. Make sure to say Y to "Mouse support" |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 1c874adb7053..98e9dd692d68 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
| @@ -1052,6 +1052,8 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
| 1052 | return -EINVAL; | 1052 | return -EINVAL; |
| 1053 | 1053 | ||
| 1054 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 1054 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
| 1055 | if (!wacom) | ||
| 1056 | return -ENOMEM; | ||
| 1055 | 1057 | ||
| 1056 | wacom_wac = &wacom->wacom_wac; | 1058 | wacom_wac = &wacom->wacom_wac; |
| 1057 | wacom_wac->features = *((struct wacom_features *)id->driver_info); | 1059 | wacom_wac->features = *((struct wacom_features *)id->driver_info); |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index a6173431d803..d96e186f71dc 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -977,7 +977,7 @@ static int wacom_bpt3_touch(struct wacom_wac *wacom) | |||
| 977 | { | 977 | { |
| 978 | struct input_dev *input = wacom->input; | 978 | struct input_dev *input = wacom->input; |
| 979 | unsigned char *data = wacom->data; | 979 | unsigned char *data = wacom->data; |
| 980 | int count = data[1] & 0x03; | 980 | int count = data[1] & 0x07; |
| 981 | int i; | 981 | int i; |
| 982 | 982 | ||
| 983 | if (data[0] != 0x02) | 983 | if (data[0] != 0x02) |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index c5eb2b925be6..ba7c56567ee7 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -260,7 +260,7 @@ config TOUCHSCREEN_ILI210X | |||
| 260 | 260 | ||
| 261 | config TOUCHSCREEN_S3C2410 | 261 | config TOUCHSCREEN_S3C2410 |
| 262 | tristate "Samsung S3C2410/generic touchscreen input driver" | 262 | tristate "Samsung S3C2410/generic touchscreen input driver" |
| 263 | depends on ARCH_S3C2410 || SAMSUNG_DEV_TS | 263 | depends on ARCH_S3C24XX || SAMSUNG_DEV_TS |
| 264 | select S3C_ADC | 264 | select S3C_ADC |
| 265 | help | 265 | help |
| 266 | Say Y here if you have the s3c2410 touchscreen. | 266 | Say Y here if you have the s3c2410 touchscreen. |
diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c index c3848ad2325b..d9be6eac99b1 100644 --- a/drivers/input/touchscreen/jornada720_ts.c +++ b/drivers/input/touchscreen/jornada720_ts.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
| 24 | #include <mach/jornada720.h> | 24 | #include <mach/jornada720.h> |
| 25 | #include <mach/irqs.h> | ||
| 25 | 26 | ||
| 26 | MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); | 27 | MODULE_AUTHOR("Kristoffer Ericson <kristoffer.ericson@gmail.com>"); |
| 27 | MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver"); | 28 | MODULE_DESCRIPTION("HP Jornada 710/720/728 touchscreen driver"); |
diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index ede02743eac1..48dc5b0d26f1 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c | |||
| @@ -39,6 +39,7 @@ struct mc13783_ts_priv { | |||
| 39 | struct delayed_work work; | 39 | struct delayed_work work; |
| 40 | struct workqueue_struct *workq; | 40 | struct workqueue_struct *workq; |
| 41 | unsigned int sample[4]; | 41 | unsigned int sample[4]; |
| 42 | struct mc13xxx_ts_platform_data *touch; | ||
| 42 | }; | 43 | }; |
| 43 | 44 | ||
| 44 | static irqreturn_t mc13783_ts_handler(int irq, void *data) | 45 | static irqreturn_t mc13783_ts_handler(int irq, void *data) |
| @@ -125,7 +126,9 @@ static void mc13783_ts_work(struct work_struct *work) | |||
| 125 | unsigned int channel = 12; | 126 | unsigned int channel = 12; |
| 126 | 127 | ||
| 127 | if (mc13xxx_adc_do_conversion(priv->mc13xxx, | 128 | if (mc13xxx_adc_do_conversion(priv->mc13xxx, |
| 128 | mode, channel, priv->sample) == 0) | 129 | mode, channel, |
| 130 | priv->touch->ato, priv->touch->atox, | ||
| 131 | priv->sample) == 0) | ||
| 129 | mc13783_ts_report_sample(priv); | 132 | mc13783_ts_report_sample(priv); |
| 130 | } | 133 | } |
| 131 | 134 | ||
| @@ -179,6 +182,12 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) | |||
| 179 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); | 182 | INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); |
| 180 | priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); | 183 | priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); |
| 181 | priv->idev = idev; | 184 | priv->idev = idev; |
| 185 | priv->touch = dev_get_platdata(&pdev->dev); | ||
| 186 | if (!priv->touch) { | ||
| 187 | dev_err(&pdev->dev, "missing platform data\n"); | ||
| 188 | ret = -ENODEV; | ||
| 189 | goto err_free_mem; | ||
| 190 | } | ||
| 182 | 191 | ||
| 183 | /* | 192 | /* |
| 184 | * We need separate workqueue because mc13783_adc_do_conversion | 193 | * We need separate workqueue because mc13783_adc_do_conversion |
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index 6c6f6d8ea9b4..f7eda3d00fad 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c | |||
| @@ -1,6 +1,4 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * drivers/input/touchscreen/tps6507x_ts.c | ||
| 3 | * | ||
| 4 | * Touchscreen driver for the tps6507x chip. | 2 | * Touchscreen driver for the tps6507x chip. |
| 5 | * | 3 | * |
| 6 | * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com) | 4 | * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com) |
| @@ -376,4 +374,4 @@ module_platform_driver(tps6507x_ts_driver); | |||
| 376 | MODULE_AUTHOR("Todd Fischer <todd.fischer@ridgerun.com>"); | 374 | MODULE_AUTHOR("Todd Fischer <todd.fischer@ridgerun.com>"); |
| 377 | MODULE_DESCRIPTION("TPS6507x - TouchScreen driver"); | 375 | MODULE_DESCRIPTION("TPS6507x - TouchScreen driver"); |
| 378 | MODULE_LICENSE("GPL v2"); | 376 | MODULE_LICENSE("GPL v2"); |
| 379 | MODULE_ALIAS("platform:tps6507x-tsc"); | 377 | MODULE_ALIAS("platform:tps6507x-ts"); |
