aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-04-23 02:35:25 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-04-23 02:35:25 -0400
commit03351ff4d897098a590cb247b6eebc470b8ecb5a (patch)
treeaed7a98a3d035689364c9ad5d7623d954403681e /drivers/input
parent8b86c1c28f569301aa1a113a060f9ed803300903 (diff)
parentf0e615c3cb72b42191b558c130409335812621d8 (diff)
Merge commit 'v2.6.39-rc4' into next
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/evdev.c43
-rw-r--r--drivers/input/gameport/gameport.c2
-rw-r--r--drivers/input/input.c77
-rw-r--r--drivers/input/joydev.c4
-rw-r--r--drivers/input/joystick/a3d.c4
-rw-r--r--drivers/input/keyboard/davinci_keyscan.c2
-rw-r--r--drivers/input/keyboard/lm8323.c4
-rw-r--r--drivers/input/keyboard/spear-keyboard.c2
-rw-r--r--drivers/input/keyboard/tegra-kbc.c62
-rw-r--r--drivers/input/keyboard/twl4030_keypad.c6
-rw-r--r--drivers/input/misc/88pm860x_onkey.c2
-rw-r--r--drivers/input/misc/adxl34x.c2
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c6
-rw-r--r--drivers/input/misc/keyspan_remote.c2
-rw-r--r--drivers/input/misc/rotary_encoder.c4
-rw-r--r--drivers/input/misc/sparcspkr.c22
-rw-r--r--drivers/input/misc/twl4030-vibra.c3
-rw-r--r--drivers/input/misc/uinput.c6
-rw-r--r--drivers/input/misc/wistron_btns.c2
-rw-r--r--drivers/input/misc/xen-kbdfront.c13
-rw-r--r--drivers/input/mouse/bcm5974.c10
-rw-r--r--drivers/input/mouse/synaptics.c4
-rw-r--r--drivers/input/mouse/synaptics.h23
-rw-r--r--drivers/input/mouse/synaptics_i2c.c2
-rw-r--r--drivers/input/mouse/vsxxxaa.c2
-rw-r--r--drivers/input/serio/altera_ps2.c15
-rw-r--r--drivers/input/serio/ambakmi.c3
-rw-r--r--drivers/input/serio/ams_delta_serio.c2
-rw-r--r--drivers/input/serio/hp_sdc.c2
-rw-r--r--drivers/input/serio/i8042-sparcio.h8
-rw-r--r--drivers/input/serio/i8042-unicore32io.h73
-rw-r--r--drivers/input/serio/i8042.c7
-rw-r--r--drivers/input/serio/i8042.h2
-rw-r--r--drivers/input/serio/rpckbd.c2
-rw-r--r--drivers/input/serio/serio.c13
-rw-r--r--drivers/input/serio/xilinx_ps2.c11
-rw-r--r--drivers/input/sparse-keymap.c14
-rw-r--r--drivers/input/tablet/wacom_sys.c2
-rw-r--r--drivers/input/tablet/wacom_wac.c291
-rw-r--r--drivers/input/tablet/wacom_wac.h2
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/ads7846.c38
-rw-r--r--drivers/input/touchscreen/h3600_ts_input.c19
-rw-r--r--drivers/input/touchscreen/intel-mid-touch.c2
-rw-r--r--drivers/input/touchscreen/mainstone-wm97xx.c2
-rw-r--r--drivers/input/touchscreen/tps6507x-ts.c12
-rw-r--r--drivers/input/touchscreen/tsc2005.c18
-rw-r--r--drivers/input/touchscreen/ucb1400_ts.c2
-rw-r--r--drivers/input/touchscreen/wacom_w8001.c13
-rw-r--r--drivers/input/touchscreen/wm9705.c2
-rw-r--r--drivers/input/touchscreen/wm9712.c2
-rw-r--r--drivers/input/touchscreen/wm9713.c2
-rw-r--r--drivers/input/touchscreen/wm97xx-core.c4
-rw-r--r--drivers/input/touchscreen/zylonite-wm97xx.c2
54 files changed, 611 insertions, 265 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index c8471a2552e7..88d8e4cb419a 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -39,13 +39,13 @@ struct evdev {
39}; 39};
40 40
41struct evdev_client { 41struct evdev_client {
42 int head; 42 unsigned int head;
43 int tail; 43 unsigned int tail;
44 spinlock_t buffer_lock; /* protects access to buffer, head and tail */ 44 spinlock_t buffer_lock; /* protects access to buffer, head and tail */
45 struct fasync_struct *fasync; 45 struct fasync_struct *fasync;
46 struct evdev *evdev; 46 struct evdev *evdev;
47 struct list_head node; 47 struct list_head node;
48 int bufsize; 48 unsigned int bufsize;
49 struct input_event buffer[]; 49 struct input_event buffer[];
50}; 50};
51 51
@@ -55,16 +55,25 @@ static DEFINE_MUTEX(evdev_table_mutex);
55static void evdev_pass_event(struct evdev_client *client, 55static void evdev_pass_event(struct evdev_client *client,
56 struct input_event *event) 56 struct input_event *event)
57{ 57{
58 /* 58 /* Interrupts are disabled, just acquire the lock. */
59 * Interrupts are disabled, just acquire the lock.
60 * Make sure we don't leave with the client buffer
61 * "empty" by having client->head == client->tail.
62 */
63 spin_lock(&client->buffer_lock); 59 spin_lock(&client->buffer_lock);
64 do { 60
65 client->buffer[client->head++] = *event; 61 client->buffer[client->head++] = *event;
66 client->head &= client->bufsize - 1; 62 client->head &= client->bufsize - 1;
67 } while (client->head == client->tail); 63
64 if (unlikely(client->head == client->tail)) {
65 /*
66 * This effectively "drops" all unconsumed events, leaving
67 * EV_SYN/SYN_DROPPED plus the newest event in the queue.
68 */
69 client->tail = (client->head - 2) & (client->bufsize - 1);
70
71 client->buffer[client->tail].time = event->time;
72 client->buffer[client->tail].type = EV_SYN;
73 client->buffer[client->tail].code = SYN_DROPPED;
74 client->buffer[client->tail].value = 0;
75 }
76
68 spin_unlock(&client->buffer_lock); 77 spin_unlock(&client->buffer_lock);
69 78
70 if (event->type == EV_SYN) 79 if (event->type == EV_SYN)
@@ -321,6 +330,9 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
321 struct input_event event; 330 struct input_event event;
322 int retval; 331 int retval;
323 332
333 if (count < input_event_size())
334 return -EINVAL;
335
324 retval = mutex_lock_interruptible(&evdev->mutex); 336 retval = mutex_lock_interruptible(&evdev->mutex);
325 if (retval) 337 if (retval)
326 return retval; 338 return retval;
@@ -330,17 +342,16 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
330 goto out; 342 goto out;
331 } 343 }
332 344
333 while (retval < count) { 345 do {
334
335 if (input_event_from_user(buffer + retval, &event)) { 346 if (input_event_from_user(buffer + retval, &event)) {
336 retval = -EFAULT; 347 retval = -EFAULT;
337 goto out; 348 goto out;
338 } 349 }
350 retval += input_event_size();
339 351
340 input_inject_event(&evdev->handle, 352 input_inject_event(&evdev->handle,
341 event.type, event.code, event.value); 353 event.type, event.code, event.value);
342 retval += input_event_size(); 354 } while (retval + input_event_size() <= count);
343 }
344 355
345 out: 356 out:
346 mutex_unlock(&evdev->mutex); 357 mutex_unlock(&evdev->mutex);
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 23cf8fc933ec..5b8f59d6c3e8 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -360,7 +360,7 @@ static int gameport_queue_event(void *object, struct module *owner,
360 event->owner = owner; 360 event->owner = owner;
361 361
362 list_add_tail(&event->node, &gameport_event_list); 362 list_add_tail(&event->node, &gameport_event_list);
363 schedule_work(&gameport_event_work); 363 queue_work(system_long_wq, &gameport_event_work);
364 364
365out: 365out:
366 spin_unlock_irqrestore(&gameport_event_lock, flags); 366 spin_unlock_irqrestore(&gameport_event_lock, flags);
diff --git a/drivers/input/input.c b/drivers/input/input.c
index ee2959bd322c..ebbceedc92f4 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -75,7 +75,6 @@ static int input_defuzz_abs_event(int value, int old_val, int fuzz)
75 * dev->event_lock held and interrupts disabled. 75 * dev->event_lock held and interrupts disabled.
76 */ 76 */
77static void input_pass_event(struct input_dev *dev, 77static void input_pass_event(struct input_dev *dev,
78 struct input_handler *src_handler,
79 unsigned int type, unsigned int code, int value) 78 unsigned int type, unsigned int code, int value)
80{ 79{
81 struct input_handler *handler; 80 struct input_handler *handler;
@@ -94,15 +93,6 @@ static void input_pass_event(struct input_dev *dev,
94 continue; 93 continue;
95 94
96 handler = handle->handler; 95 handler = handle->handler;
97
98 /*
99 * If this is the handler that injected this
100 * particular event we want to skip it to avoid
101 * filters firing again and again.
102 */
103 if (handler == src_handler)
104 continue;
105
106 if (!handler->filter) { 96 if (!handler->filter) {
107 if (filtered) 97 if (filtered)
108 break; 98 break;
@@ -132,7 +122,7 @@ static void input_repeat_key(unsigned long data)
132 if (test_bit(dev->repeat_key, dev->key) && 122 if (test_bit(dev->repeat_key, dev->key) &&
133 is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) { 123 is_event_supported(dev->repeat_key, dev->keybit, KEY_MAX)) {
134 124
135 input_pass_event(dev, NULL, EV_KEY, dev->repeat_key, 2); 125 input_pass_event(dev, EV_KEY, dev->repeat_key, 2);
136 126
137 if (dev->sync) { 127 if (dev->sync) {
138 /* 128 /*
@@ -141,7 +131,7 @@ static void input_repeat_key(unsigned long data)
141 * Otherwise assume that the driver will send 131 * Otherwise assume that the driver will send
142 * SYN_REPORT once it's done. 132 * SYN_REPORT once it's done.
143 */ 133 */
144 input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); 134 input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
145 } 135 }
146 136
147 if (dev->rep[REP_PERIOD]) 137 if (dev->rep[REP_PERIOD])
@@ -174,7 +164,6 @@ static void input_stop_autorepeat(struct input_dev *dev)
174#define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE) 164#define INPUT_PASS_TO_ALL (INPUT_PASS_TO_HANDLERS | INPUT_PASS_TO_DEVICE)
175 165
176static int input_handle_abs_event(struct input_dev *dev, 166static int input_handle_abs_event(struct input_dev *dev,
177 struct input_handler *src_handler,
178 unsigned int code, int *pval) 167 unsigned int code, int *pval)
179{ 168{
180 bool is_mt_event; 169 bool is_mt_event;
@@ -218,15 +207,13 @@ static int input_handle_abs_event(struct input_dev *dev,
218 /* Flush pending "slot" event */ 207 /* Flush pending "slot" event */
219 if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) { 208 if (is_mt_event && dev->slot != input_abs_get_val(dev, ABS_MT_SLOT)) {
220 input_abs_set_val(dev, ABS_MT_SLOT, dev->slot); 209 input_abs_set_val(dev, ABS_MT_SLOT, dev->slot);
221 input_pass_event(dev, src_handler, 210 input_pass_event(dev, EV_ABS, ABS_MT_SLOT, dev->slot);
222 EV_ABS, ABS_MT_SLOT, dev->slot);
223 } 211 }
224 212
225 return INPUT_PASS_TO_HANDLERS; 213 return INPUT_PASS_TO_HANDLERS;
226} 214}
227 215
228static void input_handle_event(struct input_dev *dev, 216static void input_handle_event(struct input_dev *dev,
229 struct input_handler *src_handler,
230 unsigned int type, unsigned int code, int value) 217 unsigned int type, unsigned int code, int value)
231{ 218{
232 int disposition = INPUT_IGNORE_EVENT; 219 int disposition = INPUT_IGNORE_EVENT;
@@ -279,8 +266,7 @@ static void input_handle_event(struct input_dev *dev,
279 266
280 case EV_ABS: 267 case EV_ABS:
281 if (is_event_supported(code, dev->absbit, ABS_MAX)) 268 if (is_event_supported(code, dev->absbit, ABS_MAX))
282 disposition = input_handle_abs_event(dev, src_handler, 269 disposition = input_handle_abs_event(dev, code, &value);
283 code, &value);
284 270
285 break; 271 break;
286 272
@@ -338,7 +324,7 @@ static void input_handle_event(struct input_dev *dev,
338 dev->event(dev, type, code, value); 324 dev->event(dev, type, code, value);
339 325
340 if (disposition & INPUT_PASS_TO_HANDLERS) 326 if (disposition & INPUT_PASS_TO_HANDLERS)
341 input_pass_event(dev, src_handler, type, code, value); 327 input_pass_event(dev, type, code, value);
342} 328}
343 329
344/** 330/**
@@ -367,7 +353,7 @@ void input_event(struct input_dev *dev,
367 353
368 spin_lock_irqsave(&dev->event_lock, flags); 354 spin_lock_irqsave(&dev->event_lock, flags);
369 add_input_randomness(type, code, value); 355 add_input_randomness(type, code, value);
370 input_handle_event(dev, NULL, type, code, value); 356 input_handle_event(dev, type, code, value);
371 spin_unlock_irqrestore(&dev->event_lock, flags); 357 spin_unlock_irqrestore(&dev->event_lock, flags);
372 } 358 }
373} 359}
@@ -397,8 +383,7 @@ void input_inject_event(struct input_handle *handle,
397 rcu_read_lock(); 383 rcu_read_lock();
398 grab = rcu_dereference(dev->grab); 384 grab = rcu_dereference(dev->grab);
399 if (!grab || grab == handle) 385 if (!grab || grab == handle)
400 input_handle_event(dev, handle->handler, 386 input_handle_event(dev, type, code, value);
401 type, code, value);
402 rcu_read_unlock(); 387 rcu_read_unlock();
403 388
404 spin_unlock_irqrestore(&dev->event_lock, flags); 389 spin_unlock_irqrestore(&dev->event_lock, flags);
@@ -611,10 +596,10 @@ static void input_dev_release_keys(struct input_dev *dev)
611 for (code = 0; code <= KEY_MAX; code++) { 596 for (code = 0; code <= KEY_MAX; code++) {
612 if (is_event_supported(code, dev->keybit, KEY_MAX) && 597 if (is_event_supported(code, dev->keybit, KEY_MAX) &&
613 __test_and_clear_bit(code, dev->key)) { 598 __test_and_clear_bit(code, dev->key)) {
614 input_pass_event(dev, NULL, EV_KEY, code, 0); 599 input_pass_event(dev, EV_KEY, code, 0);
615 } 600 }
616 } 601 }
617 input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); 602 input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
618 } 603 }
619} 604}
620 605
@@ -848,9 +833,9 @@ int input_set_keycode(struct input_dev *dev,
848 !is_event_supported(old_keycode, dev->keybit, KEY_MAX) && 833 !is_event_supported(old_keycode, dev->keybit, KEY_MAX) &&
849 __test_and_clear_bit(old_keycode, dev->key)) { 834 __test_and_clear_bit(old_keycode, dev->key)) {
850 835
851 input_pass_event(dev, NULL, EV_KEY, old_keycode, 0); 836 input_pass_event(dev, EV_KEY, old_keycode, 0);
852 if (dev->sync) 837 if (dev->sync)
853 input_pass_event(dev, NULL, EV_SYN, SYN_REPORT, 1); 838 input_pass_event(dev, EV_SYN, SYN_REPORT, 1);
854 } 839 }
855 840
856 out: 841 out:
@@ -1761,6 +1746,42 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int
1761} 1746}
1762EXPORT_SYMBOL(input_set_capability); 1747EXPORT_SYMBOL(input_set_capability);
1763 1748
1749static unsigned int input_estimate_events_per_packet(struct input_dev *dev)
1750{
1751 int mt_slots;
1752 int i;
1753 unsigned int events;
1754
1755 if (dev->mtsize) {
1756 mt_slots = dev->mtsize;
1757 } else if (test_bit(ABS_MT_TRACKING_ID, dev->absbit)) {
1758 mt_slots = dev->absinfo[ABS_MT_TRACKING_ID].maximum -
1759 dev->absinfo[ABS_MT_TRACKING_ID].minimum + 1,
1760 clamp(mt_slots, 2, 32);
1761 } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) {
1762 mt_slots = 2;
1763 } else {
1764 mt_slots = 0;
1765 }
1766
1767 events = mt_slots + 1; /* count SYN_MT_REPORT and SYN_REPORT */
1768
1769 for (i = 0; i < ABS_CNT; i++) {
1770 if (test_bit(i, dev->absbit)) {
1771 if (input_is_mt_axis(i))
1772 events += mt_slots;
1773 else
1774 events++;
1775 }
1776 }
1777
1778 for (i = 0; i < REL_CNT; i++)
1779 if (test_bit(i, dev->relbit))
1780 events++;
1781
1782 return events;
1783}
1784
1764#define INPUT_CLEANSE_BITMASK(dev, type, bits) \ 1785#define INPUT_CLEANSE_BITMASK(dev, type, bits) \
1765 do { \ 1786 do { \
1766 if (!test_bit(EV_##type, dev->evbit)) \ 1787 if (!test_bit(EV_##type, dev->evbit)) \
@@ -1808,6 +1829,10 @@ int input_register_device(struct input_dev *dev)
1808 /* Make sure that bitmasks not mentioned in dev->evbit are clean. */ 1829 /* Make sure that bitmasks not mentioned in dev->evbit are clean. */
1809 input_cleanse_bitmasks(dev); 1830 input_cleanse_bitmasks(dev);
1810 1831
1832 if (!dev->hint_events_per_packet)
1833 dev->hint_events_per_packet =
1834 input_estimate_events_per_packet(dev);
1835
1811 /* 1836 /*
1812 * If delay and period are pre-set by the driver, then autorepeating 1837 * If delay and period are pre-set by the driver, then autorepeating
1813 * is handled by the driver itself and we don't do it in input.c. 1838 * is handled by the driver itself and we don't do it in input.c.
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 3182c9cd1b0e..5688b5c88f24 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -758,7 +758,7 @@ static void joydev_remove_chrdev(struct joydev *joydev)
758} 758}
759 759
760/* 760/*
761 * Mark device non-existant. This disables writes, ioctls and 761 * Mark device non-existent. This disables writes, ioctls and
762 * prevents new users from opening the device. Already posted 762 * prevents new users from opening the device. Already posted
763 * blocking reads will stay, however new ones will fail. 763 * blocking reads will stay, however new ones will fail.
764 */ 764 */
@@ -777,7 +777,7 @@ static void joydev_cleanup(struct joydev *joydev)
777 joydev_hangup(joydev); 777 joydev_hangup(joydev);
778 joydev_remove_chrdev(joydev); 778 joydev_remove_chrdev(joydev);
779 779
780 /* joydev is marked dead so noone else accesses joydev->open */ 780 /* joydev is marked dead so no one else accesses joydev->open */
781 if (joydev->open) 781 if (joydev->open)
782 input_close_device(handle); 782 input_close_device(handle);
783} 783}
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
index d259b41354b8..1639ab2b94b7 100644
--- a/drivers/input/joystick/a3d.c
+++ b/drivers/input/joystick/a3d.c
@@ -3,7 +3,7 @@
3 */ 3 */
4 4
5/* 5/*
6 * FP-Gaming Assasin 3D joystick driver for Linux 6 * FP-Gaming Assassin 3D joystick driver for Linux
7 */ 7 */
8 8
9/* 9/*
@@ -34,7 +34,7 @@
34#include <linux/input.h> 34#include <linux/input.h>
35#include <linux/jiffies.h> 35#include <linux/jiffies.h>
36 36
37#define DRIVER_DESC "FP-Gaming Assasin 3D joystick driver" 37#define DRIVER_DESC "FP-Gaming Assassin 3D joystick driver"
38 38
39MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); 39MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
40MODULE_DESCRIPTION(DRIVER_DESC); 40MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
index a91ee941b5c1..cd89d17162a3 100644
--- a/drivers/input/keyboard/davinci_keyscan.c
+++ b/drivers/input/keyboard/davinci_keyscan.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com> 6 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
7 * 7 *
8 * Intial Code: Sandeep Paulraj <s-paulraj@ti.com> 8 * Initial Code: Sandeep Paulraj <s-paulraj@ti.com>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index b732870ecc89..71f744a8e686 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -809,7 +809,7 @@ static int lm8323_suspend(struct device *dev)
809 struct lm8323_chip *lm = i2c_get_clientdata(client); 809 struct lm8323_chip *lm = i2c_get_clientdata(client);
810 int i; 810 int i;
811 811
812 set_irq_wake(client->irq, 0); 812 irq_set_irq_wake(client->irq, 0);
813 disable_irq(client->irq); 813 disable_irq(client->irq);
814 814
815 mutex_lock(&lm->lock); 815 mutex_lock(&lm->lock);
@@ -838,7 +838,7 @@ static int lm8323_resume(struct device *dev)
838 led_classdev_resume(&lm->pwm[i].cdev); 838 led_classdev_resume(&lm->pwm[i].cdev);
839 839
840 enable_irq(client->irq); 840 enable_irq(client->irq);
841 set_irq_wake(client->irq, 1); 841 irq_set_irq_wake(client->irq, 1);
842 842
843 return 0; 843 return 0;
844} 844}
diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c
index bee03d64c453..d712dffd2157 100644
--- a/drivers/input/keyboard/spear-keyboard.c
+++ b/drivers/input/keyboard/spear-keyboard.c
@@ -69,7 +69,7 @@ static irqreturn_t spear_kbd_interrupt(int irq, void *dev_id)
69 u8 sts, val; 69 u8 sts, val;
70 70
71 sts = readb(kbd->io_base + STATUS_REG); 71 sts = readb(kbd->io_base + STATUS_REG);
72 if (sts & DATA_AVAIL) 72 if (!(sts & DATA_AVAIL))
73 return IRQ_NONE; 73 return IRQ_NONE;
74 74
75 if (kbd->last_key != KEY_RESERVED) { 75 if (kbd->last_key != KEY_RESERVED) {
diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c
index ac471b77c18e..99ce9032d08c 100644
--- a/drivers/input/keyboard/tegra-kbc.c
+++ b/drivers/input/keyboard/tegra-kbc.c
@@ -71,8 +71,9 @@ struct tegra_kbc {
71 spinlock_t lock; 71 spinlock_t lock;
72 unsigned int repoll_dly; 72 unsigned int repoll_dly;
73 unsigned long cp_dly_jiffies; 73 unsigned long cp_dly_jiffies;
74 bool use_fn_map;
74 const struct tegra_kbc_platform_data *pdata; 75 const struct tegra_kbc_platform_data *pdata;
75 unsigned short keycode[KBC_MAX_KEY]; 76 unsigned short keycode[KBC_MAX_KEY * 2];
76 unsigned short current_keys[KBC_MAX_KPENT]; 77 unsigned short current_keys[KBC_MAX_KPENT];
77 unsigned int num_pressed_keys; 78 unsigned int num_pressed_keys;
78 struct timer_list timer; 79 struct timer_list timer;
@@ -178,6 +179,40 @@ static const u32 tegra_kbc_default_keymap[] = {
178 KEY(15, 5, KEY_F2), 179 KEY(15, 5, KEY_F2),
179 KEY(15, 6, KEY_CAPSLOCK), 180 KEY(15, 6, KEY_CAPSLOCK),
180 KEY(15, 7, KEY_F6), 181 KEY(15, 7, KEY_F6),
182
183 /* Software Handled Function Keys */
184 KEY(20, 0, KEY_KP7),
185
186 KEY(21, 0, KEY_KP9),
187 KEY(21, 1, KEY_KP8),
188 KEY(21, 2, KEY_KP4),
189 KEY(21, 4, KEY_KP1),
190
191 KEY(22, 1, KEY_KPSLASH),
192 KEY(22, 2, KEY_KP6),
193 KEY(22, 3, KEY_KP5),
194 KEY(22, 4, KEY_KP3),
195 KEY(22, 5, KEY_KP2),
196 KEY(22, 7, KEY_KP0),
197
198 KEY(27, 1, KEY_KPASTERISK),
199 KEY(27, 3, KEY_KPMINUS),
200 KEY(27, 4, KEY_KPPLUS),
201 KEY(27, 5, KEY_KPDOT),
202
203 KEY(28, 5, KEY_VOLUMEUP),
204
205 KEY(29, 3, KEY_HOME),
206 KEY(29, 4, KEY_END),
207 KEY(29, 5, KEY_BRIGHTNESSDOWN),
208 KEY(29, 6, KEY_VOLUMEDOWN),
209 KEY(29, 7, KEY_BRIGHTNESSUP),
210
211 KEY(30, 0, KEY_NUMLOCK),
212 KEY(30, 1, KEY_SCROLLLOCK),
213 KEY(30, 2, KEY_MUTE),
214
215 KEY(31, 4, KEY_HELP),
181}; 216};
182 217
183static const struct matrix_keymap_data tegra_kbc_default_keymap_data = { 218static const struct matrix_keymap_data tegra_kbc_default_keymap_data = {
@@ -224,6 +259,7 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc)
224 unsigned int i; 259 unsigned int i;
225 unsigned int num_down = 0; 260 unsigned int num_down = 0;
226 unsigned long flags; 261 unsigned long flags;
262 bool fn_keypress = false;
227 263
228 spin_lock_irqsave(&kbc->lock, flags); 264 spin_lock_irqsave(&kbc->lock, flags);
229 for (i = 0; i < KBC_MAX_KPENT; i++) { 265 for (i = 0; i < KBC_MAX_KPENT; i++) {
@@ -237,11 +273,28 @@ static void tegra_kbc_report_keys(struct tegra_kbc *kbc)
237 MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT); 273 MATRIX_SCAN_CODE(row, col, KBC_ROW_SHIFT);
238 274
239 scancodes[num_down] = scancode; 275 scancodes[num_down] = scancode;
240 keycodes[num_down++] = kbc->keycode[scancode]; 276 keycodes[num_down] = kbc->keycode[scancode];
277 /* If driver uses Fn map, do not report the Fn key. */
278 if ((keycodes[num_down] == KEY_FN) && kbc->use_fn_map)
279 fn_keypress = true;
280 else
281 num_down++;
241 } 282 }
242 283
243 val >>= 8; 284 val >>= 8;
244 } 285 }
286
287 /*
288 * If the platform uses Fn keymaps, translate keys on a Fn keypress.
289 * Function keycodes are KBC_MAX_KEY apart from the plain keycodes.
290 */
291 if (fn_keypress) {
292 for (i = 0; i < num_down; i++) {
293 scancodes[i] += KBC_MAX_KEY;
294 keycodes[i] = kbc->keycode[scancodes[i]];
295 }
296 }
297
245 spin_unlock_irqrestore(&kbc->lock, flags); 298 spin_unlock_irqrestore(&kbc->lock, flags);
246 299
247 tegra_kbc_report_released_keys(kbc->idev, 300 tegra_kbc_report_released_keys(kbc->idev,
@@ -594,8 +647,11 @@ static int __devinit tegra_kbc_probe(struct platform_device *pdev)
594 647
595 input_dev->keycode = kbc->keycode; 648 input_dev->keycode = kbc->keycode;
596 input_dev->keycodesize = sizeof(kbc->keycode[0]); 649 input_dev->keycodesize = sizeof(kbc->keycode[0]);
597 input_dev->keycodemax = ARRAY_SIZE(kbc->keycode); 650 input_dev->keycodemax = KBC_MAX_KEY;
651 if (pdata->use_fn_map)
652 input_dev->keycodemax *= 2;
598 653
654 kbc->use_fn_map = pdata->use_fn_map;
599 keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data; 655 keymap_data = pdata->keymap_data ?: &tegra_kbc_default_keymap_data;
600 matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT, 656 matrix_keypad_build_keymap(keymap_data, KBC_ROW_SHIFT,
601 input_dev->keycode, input_dev->keybit); 657 input_dev->keycode, input_dev->keybit);
diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c
index 09bef79d9da1..a26922cf0e84 100644
--- a/drivers/input/keyboard/twl4030_keypad.c
+++ b/drivers/input/keyboard/twl4030_keypad.c
@@ -332,18 +332,20 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp)
332static int __devinit twl4030_kp_probe(struct platform_device *pdev) 332static int __devinit twl4030_kp_probe(struct platform_device *pdev)
333{ 333{
334 struct twl4030_keypad_data *pdata = pdev->dev.platform_data; 334 struct twl4030_keypad_data *pdata = pdev->dev.platform_data;
335 const struct matrix_keymap_data *keymap_data = pdata->keymap_data; 335 const struct matrix_keymap_data *keymap_data;
336 struct twl4030_keypad *kp; 336 struct twl4030_keypad *kp;
337 struct input_dev *input; 337 struct input_dev *input;
338 u8 reg; 338 u8 reg;
339 int error; 339 int error;
340 340
341 if (!pdata || !pdata->rows || !pdata->cols || 341 if (!pdata || !pdata->rows || !pdata->cols || !pdata->keymap_data ||
342 pdata->rows > TWL4030_MAX_ROWS || pdata->cols > TWL4030_MAX_COLS) { 342 pdata->rows > TWL4030_MAX_ROWS || pdata->cols > TWL4030_MAX_COLS) {
343 dev_err(&pdev->dev, "Invalid platform_data\n"); 343 dev_err(&pdev->dev, "Invalid platform_data\n");
344 return -EINVAL; 344 return -EINVAL;
345 } 345 }
346 346
347 keymap_data = pdata->keymap_data;
348
347 kp = kzalloc(sizeof(*kp), GFP_KERNEL); 349 kp = kzalloc(sizeof(*kp), GFP_KERNEL);
348 input = input_allocate_device(); 350 input = input_allocate_device();
349 if (!kp || !input) { 351 if (!kp || !input) {
diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c
index 4cc82826ea6b..3dca3c14510e 100644
--- a/drivers/input/misc/88pm860x_onkey.c
+++ b/drivers/input/misc/88pm860x_onkey.c
@@ -74,7 +74,7 @@ static int __devinit pm860x_onkey_probe(struct platform_device *pdev)
74 info->chip = chip; 74 info->chip = chip;
75 info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion; 75 info->i2c = (chip->id == CHIP_PM8607) ? chip->client : chip->companion;
76 info->dev = &pdev->dev; 76 info->dev = &pdev->dev;
77 info->irq = irq + chip->irq_base; 77 info->irq = irq;
78 78
79 info->idev = input_allocate_device(); 79 info->idev = input_allocate_device();
80 if (!info->idev) { 80 if (!info->idev) {
diff --git a/drivers/input/misc/adxl34x.c b/drivers/input/misc/adxl34x.c
index de5900d50788..144ddbdeb9b3 100644
--- a/drivers/input/misc/adxl34x.c
+++ b/drivers/input/misc/adxl34x.c
@@ -716,7 +716,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,
716 pdata = dev->platform_data; 716 pdata = dev->platform_data;
717 if (!pdata) { 717 if (!pdata) {
718 dev_dbg(dev, 718 dev_dbg(dev,
719 "No platfrom data: Using default initialization\n"); 719 "No platform data: Using default initialization\n");
720 pdata = &adxl34x_default_init; 720 pdata = &adxl34x_default_init;
721 } 721 }
722 722
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index 9dfd6e5f786f..1f38302a5951 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -69,11 +69,7 @@ static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned
69 } 69 }
70 70
71 if (value > 20 && value < 32767) 71 if (value > 20 && value < 32767)
72#ifndef FREQ 72 count = (IXP4XX_TIMER_FREQ / (value * 4)) - 1;
73 count = (ixp4xx_get_board_tick_rate() / (value * 4)) - 1;
74#else
75 count = (FREQ / (value * 4)) - 1;
76#endif
77 73
78 ixp4xx_spkr_control(pin, count); 74 ixp4xx_spkr_control(pin, count);
79 75
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index a93c525475c6..fc62256c963f 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -312,7 +312,7 @@ static void keyspan_check_data(struct usb_keyspan *remote)
312 remote->data.tester = remote->data.tester >> 5; 312 remote->data.tester = remote->data.tester >> 5;
313 remote->data.bits_left -= 5; 313 remote->data.bits_left -= 5;
314 } else { 314 } else {
315 err("Bad message recieved, no stop bit found.\n"); 315 err("Bad message received, no stop bit found.\n");
316 } 316 }
317 317
318 dev_dbg(&remote->udev->dev, 318 dev_dbg(&remote->udev->dev,
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 1f8e0108962e..7e64d01da2be 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -176,7 +176,7 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
176 176
177 /* request the IRQs */ 177 /* request the IRQs */
178 err = request_irq(encoder->irq_a, &rotary_encoder_irq, 178 err = request_irq(encoder->irq_a, &rotary_encoder_irq,
179 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE, 179 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
180 DRV_NAME, encoder); 180 DRV_NAME, encoder);
181 if (err) { 181 if (err) {
182 dev_err(&pdev->dev, "unable to request IRQ %d\n", 182 dev_err(&pdev->dev, "unable to request IRQ %d\n",
@@ -185,7 +185,7 @@ static int __devinit rotary_encoder_probe(struct platform_device *pdev)
185 } 185 }
186 186
187 err = request_irq(encoder->irq_b, &rotary_encoder_irq, 187 err = request_irq(encoder->irq_b, &rotary_encoder_irq,
188 IORESOURCE_IRQ_HIGHEDGE | IORESOURCE_IRQ_LOWEDGE, 188 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
189 DRV_NAME, encoder); 189 DRV_NAME, encoder);
190 if (err) { 190 if (err) {
191 dev_err(&pdev->dev, "unable to request IRQ %d\n", 191 dev_err(&pdev->dev, "unable to request IRQ %d\n",
diff --git a/drivers/input/misc/sparcspkr.c b/drivers/input/misc/sparcspkr.c
index 8e130bf7d32b..0122f5351577 100644
--- a/drivers/input/misc/sparcspkr.c
+++ b/drivers/input/misc/sparcspkr.c
@@ -173,18 +173,16 @@ static int __devinit sparcspkr_probe(struct device *dev)
173 return 0; 173 return 0;
174} 174}
175 175
176static int sparcspkr_shutdown(struct platform_device *dev) 176static void sparcspkr_shutdown(struct platform_device *dev)
177{ 177{
178 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev); 178 struct sparcspkr_state *state = dev_get_drvdata(&dev->dev);
179 struct input_dev *input_dev = state->input_dev; 179 struct input_dev *input_dev = state->input_dev;
180 180
181 /* turn off the speaker */ 181 /* turn off the speaker */
182 state->event(input_dev, EV_SND, SND_BELL, 0); 182 state->event(input_dev, EV_SND, SND_BELL, 0);
183
184 return 0;
185} 183}
186 184
187static int __devinit bbc_beep_probe(struct platform_device *op, const struct of_device_id *match) 185static int __devinit bbc_beep_probe(struct platform_device *op)
188{ 186{
189 struct sparcspkr_state *state; 187 struct sparcspkr_state *state;
190 struct bbc_beep_info *info; 188 struct bbc_beep_info *info;
@@ -258,7 +256,7 @@ static const struct of_device_id bbc_beep_match[] = {
258 {}, 256 {},
259}; 257};
260 258
261static struct of_platform_driver bbc_beep_driver = { 259static struct platform_driver bbc_beep_driver = {
262 .driver = { 260 .driver = {
263 .name = "bbcbeep", 261 .name = "bbcbeep",
264 .owner = THIS_MODULE, 262 .owner = THIS_MODULE,
@@ -269,7 +267,7 @@ static struct of_platform_driver bbc_beep_driver = {
269 .shutdown = sparcspkr_shutdown, 267 .shutdown = sparcspkr_shutdown,
270}; 268};
271 269
272static int __devinit grover_beep_probe(struct platform_device *op, const struct of_device_id *match) 270static int __devinit grover_beep_probe(struct platform_device *op)
273{ 271{
274 struct sparcspkr_state *state; 272 struct sparcspkr_state *state;
275 struct grover_beep_info *info; 273 struct grover_beep_info *info;
@@ -340,7 +338,7 @@ static const struct of_device_id grover_beep_match[] = {
340 {}, 338 {},
341}; 339};
342 340
343static struct of_platform_driver grover_beep_driver = { 341static struct platform_driver grover_beep_driver = {
344 .driver = { 342 .driver = {
345 .name = "groverbeep", 343 .name = "groverbeep",
346 .owner = THIS_MODULE, 344 .owner = THIS_MODULE,
@@ -353,12 +351,12 @@ static struct of_platform_driver grover_beep_driver = {
353 351
354static int __init sparcspkr_init(void) 352static int __init sparcspkr_init(void)
355{ 353{
356 int err = of_register_platform_driver(&bbc_beep_driver); 354 int err = platform_driver_register(&bbc_beep_driver);
357 355
358 if (!err) { 356 if (!err) {
359 err = of_register_platform_driver(&grover_beep_driver); 357 err = platform_driver_register(&grover_beep_driver);
360 if (err) 358 if (err)
361 of_unregister_platform_driver(&bbc_beep_driver); 359 platform_driver_unregister(&bbc_beep_driver);
362 } 360 }
363 361
364 return err; 362 return err;
@@ -366,8 +364,8 @@ static int __init sparcspkr_init(void)
366 364
367static void __exit sparcspkr_exit(void) 365static void __exit sparcspkr_exit(void)
368{ 366{
369 of_unregister_platform_driver(&bbc_beep_driver); 367 platform_driver_unregister(&bbc_beep_driver);
370 of_unregister_platform_driver(&grover_beep_driver); 368 platform_driver_unregister(&grover_beep_driver);
371} 369}
372 370
373module_init(sparcspkr_init); 371module_init(sparcspkr_init);
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 014dd4ad0d4f..6a11694e3fc7 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -29,6 +29,7 @@
29#include <linux/workqueue.h> 29#include <linux/workqueue.h>
30#include <linux/i2c/twl.h> 30#include <linux/i2c/twl.h>
31#include <linux/mfd/twl4030-codec.h> 31#include <linux/mfd/twl4030-codec.h>
32#include <linux/mfd/core.h>
32#include <linux/input.h> 33#include <linux/input.h>
33#include <linux/slab.h> 34#include <linux/slab.h>
34 35
@@ -196,7 +197,7 @@ static SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
196 197
197static int __devinit twl4030_vibra_probe(struct platform_device *pdev) 198static int __devinit twl4030_vibra_probe(struct platform_device *pdev)
198{ 199{
199 struct twl4030_codec_vibra_data *pdata = pdev->dev.platform_data; 200 struct twl4030_codec_vibra_data *pdata = mfd_get_data(pdev);
200 struct vibra_info *info; 201 struct vibra_info *info;
201 int ret; 202 int ret;
202 203
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 364bdf43a381..736056897e50 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -302,10 +302,14 @@ static int uinput_validate_absbits(struct input_dev *dev)
302 int retval = 0; 302 int retval = 0;
303 303
304 for (cnt = 0; cnt < ABS_CNT; cnt++) { 304 for (cnt = 0; cnt < ABS_CNT; cnt++) {
305 int min, max;
305 if (!test_bit(cnt, dev->absbit)) 306 if (!test_bit(cnt, dev->absbit))
306 continue; 307 continue;
307 308
308 if (input_abs_get_max(dev, cnt) <= input_abs_get_min(dev, cnt)) { 309 min = input_abs_get_min(dev, cnt);
310 max = input_abs_get_max(dev, cnt);
311
312 if ((min != 0 || max != 0) && max <= min) {
309 printk(KERN_DEBUG 313 printk(KERN_DEBUG
310 "%s: invalid abs[%02x] min:%d max:%d\n", 314 "%s: invalid abs[%02x] min:%d max:%d\n",
311 UINPUT_NAME, cnt, 315 UINPUT_NAME, cnt,
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
index 12501de0c5cd..52b419348983 100644
--- a/drivers/input/misc/wistron_btns.c
+++ b/drivers/input/misc/wistron_btns.c
@@ -274,7 +274,7 @@ static struct key_entry keymap_fs_amilo_pro_v3505[] __initdata = {
274 { KE_BLUETOOTH, 0x30 }, /* Fn+F10 */ 274 { KE_BLUETOOTH, 0x30 }, /* Fn+F10 */
275 { KE_KEY, 0x31, {KEY_MAIL} }, /* mail button */ 275 { KE_KEY, 0x31, {KEY_MAIL} }, /* mail button */
276 { KE_KEY, 0x36, {KEY_WWW} }, /* www button */ 276 { KE_KEY, 0x36, {KEY_WWW} }, /* www button */
277 { KE_WIFI, 0x78 }, /* satelite dish button */ 277 { KE_WIFI, 0x78 }, /* satellite dish button */
278 { KE_END, 0 } 278 { KE_END, 0 }
279}; 279};
280 280
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 7077f9bf5ead..62bae99424e6 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -303,7 +303,7 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
303 enum xenbus_state backend_state) 303 enum xenbus_state backend_state)
304{ 304{
305 struct xenkbd_info *info = dev_get_drvdata(&dev->dev); 305 struct xenkbd_info *info = dev_get_drvdata(&dev->dev);
306 int val; 306 int ret, val;
307 307
308 switch (backend_state) { 308 switch (backend_state) {
309 case XenbusStateInitialising: 309 case XenbusStateInitialising:
@@ -316,6 +316,17 @@ static void xenkbd_backend_changed(struct xenbus_device *dev,
316 316
317 case XenbusStateInitWait: 317 case XenbusStateInitWait:
318InitWait: 318InitWait:
319 ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
320 "feature-abs-pointer", "%d", &val);
321 if (ret < 0)
322 val = 0;
323 if (val) {
324 ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,
325 "request-abs-pointer", "1");
326 if (ret)
327 pr_warning("xenkbd: can't request abs-pointer");
328 }
329
319 xenbus_switch_state(dev, XenbusStateConnected); 330 xenbus_switch_state(dev, XenbusStateConnected);
320 break; 331 break;
321 332
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index 318531424848..3126983c004a 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -450,10 +450,6 @@ static int report_tp_state(struct bcm5974 *dev, int size)
450 ptest = int2bound(&c->p, raw_p); 450 ptest = int2bound(&c->p, raw_p);
451 origin = raw2int(f->origin); 451 origin = raw2int(f->origin);
452 452
453 /* set the integrated button if applicable */
454 if (c->tp_type == TYPE2)
455 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
456
457 /* while tracking finger still valid, count all fingers */ 453 /* while tracking finger still valid, count all fingers */
458 if (ptest > PRESSURE_LOW && origin) { 454 if (ptest > PRESSURE_LOW && origin) {
459 abs_p = ptest; 455 abs_p = ptest;
@@ -472,6 +468,10 @@ static int report_tp_state(struct bcm5974 *dev, int size)
472 } 468 }
473 } 469 }
474 470
471 /* set the integrated button if applicable */
472 if (c->tp_type == TYPE2)
473 ibt = raw2int(dev->tp_data[BUTTON_TYPE2]);
474
475 if (dev->fingers < nmin) 475 if (dev->fingers < nmin)
476 dev->fingers = nmin; 476 dev->fingers = nmin;
477 if (dev->fingers > nmax) 477 if (dev->fingers > nmax)
@@ -639,7 +639,7 @@ exit:
639 * device, resulting in trackpad malfunction under certain 639 * device, resulting in trackpad malfunction under certain
640 * circumstances. To get around this problem, there is at least one 640 * circumstances. To get around this problem, there is at least one
641 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to 641 * example that utilizes the USB_QUIRK_RESET_RESUME quirk in order to
642 * recieve a reset_resume request rather than the normal resume. 642 * receive a reset_resume request rather than the normal resume.
643 * Since the implementation of reset_resume is equal to mode switch 643 * Since the implementation of reset_resume is equal to mode switch
644 * plus start_traffic, it seems easier to always do the switch when 644 * plus start_traffic, it seems easier to always do the switch when
645 * starting traffic on the device. 645 * starting traffic on the device.
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index aa186cf6c514..e06e045bf907 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -836,8 +836,8 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
836 }, 836 },
837 837
838 }, 838 },
839 { }
840#endif 839#endif
840 { }
841}; 841};
842 842
843static bool broken_olpc_ec; 843static bool broken_olpc_ec;
@@ -851,8 +851,8 @@ static const struct dmi_system_id __initconst olpc_dmi_table[] = {
851 DMI_MATCH(DMI_PRODUCT_NAME, "XO"), 851 DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
852 }, 852 },
853 }, 853 },
854 { }
855#endif 854#endif
855 { }
856}; 856};
857 857
858void __init synaptics_module_init(void) 858void __init synaptics_module_init(void)
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h
index 25e5d042a72c..7453938bf5ef 100644
--- a/drivers/input/mouse/synaptics.h
+++ b/drivers/input/mouse/synaptics.h
@@ -51,6 +51,29 @@
51#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) 51#define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20)
52#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) 52#define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12)
53#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) 53#define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16)
54
55/*
56 * The following describes response for the 0x0c query.
57 *
58 * byte mask name meaning
59 * ---- ---- ------- ------------
60 * 1 0x01 adjustable threshold capacitive button sensitivity
61 * can be adjusted
62 * 1 0x02 report max query 0x0d gives max coord reported
63 * 1 0x04 clearpad sensor is ClearPad product
64 * 1 0x08 advanced gesture not particularly meaningful
65 * 1 0x10 clickpad bit 0 1-button ClickPad
66 * 1 0x60 multifinger mode identifies firmware finger counting
67 * (not reporting!) algorithm.
68 * Not particularly meaningful
69 * 1 0x80 covered pad W clipped to 14, 15 == pad mostly covered
70 * 2 0x01 clickpad bit 1 2-button ClickPad
71 * 2 0x02 deluxe LED controls touchpad support LED commands
72 * ala multimedia control bar
73 * 2 0x04 reduced filtering firmware does less filtering on
74 * position data, driver should watch
75 * for noise.
76 */
54#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ 77#define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */
55#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ 78#define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */
56#define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) 79#define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000)
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index f6aa26d305ed..cba3c84d2f21 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -462,7 +462,7 @@ static void synaptics_i2c_work_handler(struct work_struct *work)
462 * While interrupt driven, there is no real need to poll the device. 462 * While interrupt driven, there is no real need to poll the device.
463 * But touchpads are very sensitive, so there could be errors 463 * But touchpads are very sensitive, so there could be errors
464 * related to physical environment and the attention line isn't 464 * related to physical environment and the attention line isn't
465 * neccesarily asserted. In such case we can lose the touchpad. 465 * necessarily asserted. In such case we can lose the touchpad.
466 * We poll the device once in THREAD_IRQ_SLEEP_SECS and 466 * We poll the device once in THREAD_IRQ_SLEEP_SECS and
467 * if error is detected, we try to reset and reconfigure the touchpad. 467 * if error is detected, we try to reset and reconfigure the touchpad.
468 */ 468 */
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
index bf2c0c80d6cc..eb9a3cfbeefa 100644
--- a/drivers/input/mouse/vsxxxaa.c
+++ b/drivers/input/mouse/vsxxxaa.c
@@ -334,7 +334,7 @@ static void vsxxxaa_handle_POR_packet(struct vsxxxaa *mouse)
334 * M: manufacturer location code 334 * M: manufacturer location code
335 * R: revision code 335 * R: revision code
336 * E: Error code. If it's in the range of 0x00..0x1f, only some 336 * E: Error code. If it's in the range of 0x00..0x1f, only some
337 * minor problem occured. Errors >= 0x20 are considered bad 337 * minor problem occurred. Errors >= 0x20 are considered bad
338 * and the device may not work properly... 338 * and the device may not work properly...
339 * D: <0010> == mouse, <0100> == tablet 339 * D: <0010> == mouse, <0100> == tablet
340 */ 340 */
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c
index 7998560a1904..d363dc4571a3 100644
--- a/drivers/input/serio/altera_ps2.c
+++ b/drivers/input/serio/altera_ps2.c
@@ -19,6 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/slab.h> 21#include <linux/slab.h>
22#include <linux/of.h>
22 23
23#define DRV_NAME "altera_ps2" 24#define DRV_NAME "altera_ps2"
24 25
@@ -173,6 +174,16 @@ static int __devexit altera_ps2_remove(struct platform_device *pdev)
173 return 0; 174 return 0;
174} 175}
175 176
177#ifdef CONFIG_OF
178static const struct of_device_id altera_ps2_match[] = {
179 { .compatible = "ALTR,ps2-1.0", },
180 {},
181};
182MODULE_DEVICE_TABLE(of, altera_ps2_match);
183#else /* CONFIG_OF */
184#define altera_ps2_match NULL
185#endif /* CONFIG_OF */
186
176/* 187/*
177 * Our device driver structure 188 * Our device driver structure
178 */ 189 */
@@ -182,6 +193,7 @@ static struct platform_driver altera_ps2_driver = {
182 .driver = { 193 .driver = {
183 .name = DRV_NAME, 194 .name = DRV_NAME,
184 .owner = THIS_MODULE, 195 .owner = THIS_MODULE,
196 .of_match_table = altera_ps2_match,
185 }, 197 },
186}; 198};
187 199
@@ -189,13 +201,12 @@ static int __init altera_ps2_init(void)
189{ 201{
190 return platform_driver_register(&altera_ps2_driver); 202 return platform_driver_register(&altera_ps2_driver);
191} 203}
204module_init(altera_ps2_init);
192 205
193static void __exit altera_ps2_exit(void) 206static void __exit altera_ps2_exit(void)
194{ 207{
195 platform_driver_unregister(&altera_ps2_driver); 208 platform_driver_unregister(&altera_ps2_driver);
196} 209}
197
198module_init(altera_ps2_init);
199module_exit(altera_ps2_exit); 210module_exit(altera_ps2_exit);
200 211
201MODULE_DESCRIPTION("Altera University Program PS2 controller driver"); 212MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index 92563a681d65..12abc50508e5 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -107,7 +107,8 @@ static void amba_kmi_close(struct serio *io)
107 clk_disable(kmi->clk); 107 clk_disable(kmi->clk);
108} 108}
109 109
110static int __devinit amba_kmi_probe(struct amba_device *dev, struct amba_id *id) 110static int __devinit amba_kmi_probe(struct amba_device *dev,
111 const struct amba_id *id)
111{ 112{
112 struct amba_kmi_port *kmi; 113 struct amba_kmi_port *kmi;
113 struct serio *io; 114 struct serio *io;
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c
index ebe955325677..4b2a42f9f0bb 100644
--- a/drivers/input/serio/ams_delta_serio.c
+++ b/drivers/input/serio/ams_delta_serio.c
@@ -149,7 +149,7 @@ static int __init ams_delta_serio_init(void)
149 * at FIQ level, switch back from edge to simple interrupt handler 149 * at FIQ level, switch back from edge to simple interrupt handler
150 * to avoid bad interaction. 150 * to avoid bad interaction.
151 */ 151 */
152 set_irq_handler(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 152 irq_set_handler(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK),
153 handle_simple_irq); 153 handle_simple_irq);
154 154
155 serio_register_port(ams_delta_serio); 155 serio_register_port(ams_delta_serio);
diff --git a/drivers/input/serio/hp_sdc.c b/drivers/input/serio/hp_sdc.c
index 8c0b51c31424..42206205e4f5 100644
--- a/drivers/input/serio/hp_sdc.c
+++ b/drivers/input/serio/hp_sdc.c
@@ -955,7 +955,7 @@ static int __init hp_sdc_init_hppa(struct parisc_device *d)
955 INIT_DELAYED_WORK(&moduleloader_work, request_module_delayed); 955 INIT_DELAYED_WORK(&moduleloader_work, request_module_delayed);
956 956
957 ret = hp_sdc_init(); 957 ret = hp_sdc_init();
958 /* after successfull initialization give SDC some time to settle 958 /* after successful initialization give SDC some time to settle
959 * and then load the hp_sdc_mlc upper layer driver */ 959 * and then load the hp_sdc_mlc upper layer driver */
960 if (!ret) 960 if (!ret)
961 schedule_delayed_work(&moduleloader_work, 961 schedule_delayed_work(&moduleloader_work,
diff --git a/drivers/input/serio/i8042-sparcio.h b/drivers/input/serio/i8042-sparcio.h
index c5cc4508d6df..395a9af3adcd 100644
--- a/drivers/input/serio/i8042-sparcio.h
+++ b/drivers/input/serio/i8042-sparcio.h
@@ -49,7 +49,7 @@ static inline void i8042_write_command(int val)
49#define OBP_PS2MS_NAME1 "kdmouse" 49#define OBP_PS2MS_NAME1 "kdmouse"
50#define OBP_PS2MS_NAME2 "mouse" 50#define OBP_PS2MS_NAME2 "mouse"
51 51
52static int __devinit sparc_i8042_probe(struct platform_device *op, const struct of_device_id *match) 52static int __devinit sparc_i8042_probe(struct platform_device *op)
53{ 53{
54 struct device_node *dp = op->dev.of_node; 54 struct device_node *dp = op->dev.of_node;
55 55
@@ -95,7 +95,7 @@ static const struct of_device_id sparc_i8042_match[] = {
95}; 95};
96MODULE_DEVICE_TABLE(of, sparc_i8042_match); 96MODULE_DEVICE_TABLE(of, sparc_i8042_match);
97 97
98static struct of_platform_driver sparc_i8042_driver = { 98static struct platform_driver sparc_i8042_driver = {
99 .driver = { 99 .driver = {
100 .name = "i8042", 100 .name = "i8042",
101 .owner = THIS_MODULE, 101 .owner = THIS_MODULE,
@@ -116,7 +116,7 @@ static int __init i8042_platform_init(void)
116 if (!kbd_iobase) 116 if (!kbd_iobase)
117 return -ENODEV; 117 return -ENODEV;
118 } else { 118 } else {
119 int err = of_register_platform_driver(&sparc_i8042_driver); 119 int err = platform_driver_register(&sparc_i8042_driver);
120 if (err) 120 if (err)
121 return err; 121 return err;
122 122
@@ -140,7 +140,7 @@ static inline void i8042_platform_exit(void)
140 struct device_node *root = of_find_node_by_path("/"); 140 struct device_node *root = of_find_node_by_path("/");
141 141
142 if (strcmp(root->name, "SUNW,JavaStation-1")) 142 if (strcmp(root->name, "SUNW,JavaStation-1"))
143 of_unregister_platform_driver(&sparc_i8042_driver); 143 platform_driver_unregister(&sparc_i8042_driver);
144} 144}
145 145
146#else /* !CONFIG_PCI */ 146#else /* !CONFIG_PCI */
diff --git a/drivers/input/serio/i8042-unicore32io.h b/drivers/input/serio/i8042-unicore32io.h
new file mode 100644
index 000000000000..73f5cc124a36
--- /dev/null
+++ b/drivers/input/serio/i8042-unicore32io.h
@@ -0,0 +1,73 @@
1/*
2 * Code specific to PKUnity SoC and UniCore ISA
3 *
4 * Maintained by GUAN Xue-tao <gxt@mprc.pku.edu.cn>
5 * Copyright (C) 2001-2011 Guan Xuetao
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11#ifndef _I8042_UNICORE32_H
12#define _I8042_UNICORE32_H
13
14#include <mach/hardware.h>
15
16/*
17 * Names.
18 */
19#define I8042_KBD_PHYS_DESC "isa0060/serio0"
20#define I8042_AUX_PHYS_DESC "isa0060/serio1"
21#define I8042_MUX_PHYS_DESC "isa0060/serio%d"
22
23/*
24 * IRQs.
25 */
26#define I8042_KBD_IRQ IRQ_PS2_KBD
27#define I8042_AUX_IRQ IRQ_PS2_AUX
28
29/*
30 * Register numbers.
31 */
32#define I8042_COMMAND_REG PS2_COMMAND
33#define I8042_STATUS_REG PS2_STATUS
34#define I8042_DATA_REG PS2_DATA
35
36#define I8042_REGION_START (resource_size_t)(PS2_DATA)
37#define I8042_REGION_SIZE (resource_size_t)(16)
38
39static inline int i8042_read_data(void)
40{
41 return readb(I8042_DATA_REG);
42}
43
44static inline int i8042_read_status(void)
45{
46 return readb(I8042_STATUS_REG);
47}
48
49static inline void i8042_write_data(int val)
50{
51 writeb(val, I8042_DATA_REG);
52}
53
54static inline void i8042_write_command(int val)
55{
56 writeb(val, I8042_COMMAND_REG);
57}
58
59static inline int i8042_platform_init(void)
60{
61 if (!request_mem_region(I8042_REGION_START, I8042_REGION_SIZE, "i8042"))
62 return -EBUSY;
63
64 i8042_reset = 1;
65 return 0;
66}
67
68static inline void i8042_platform_exit(void)
69{
70 release_mem_region(I8042_REGION_START, I8042_REGION_SIZE);
71}
72
73#endif /* _I8042_UNICORE32_H */
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index ac4c93689ab9..d37a48e099d0 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -869,15 +869,15 @@ static int i8042_controller_selftest(void)
869 do { 869 do {
870 870
871 if (i8042_command(&param, I8042_CMD_CTL_TEST)) { 871 if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
872 pr_err("i8042 controller self test timeout\n"); 872 pr_err("i8042 controller selftest timeout\n");
873 return -ENODEV; 873 return -ENODEV;
874 } 874 }
875 875
876 if (param == I8042_RET_CTL_TEST) 876 if (param == I8042_RET_CTL_TEST)
877 return 0; 877 return 0;
878 878
879 pr_err("i8042 controller selftest failed. (%#x != %#x)\n", 879 dbg("i8042 controller selftest: %#x != %#x\n",
880 param, I8042_RET_CTL_TEST); 880 param, I8042_RET_CTL_TEST);
881 msleep(50); 881 msleep(50);
882 } while (i++ < 5); 882 } while (i++ < 5);
883 883
@@ -891,6 +891,7 @@ static int i8042_controller_selftest(void)
891 pr_info("giving up on controller selftest, continuing anyway...\n"); 891 pr_info("giving up on controller selftest, continuing anyway...\n");
892 return 0; 892 return 0;
893#else 893#else
894 pr_err("i8042 controller selftest failed\n");
894 return -EIO; 895 return -EIO;
895#endif 896#endif
896} 897}
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index ac1d759d0f55..3452708fbe3b 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -26,6 +26,8 @@
26#include "i8042-sparcio.h" 26#include "i8042-sparcio.h"
27#elif defined(CONFIG_X86) || defined(CONFIG_IA64) 27#elif defined(CONFIG_X86) || defined(CONFIG_IA64)
28#include "i8042-x86ia64io.h" 28#include "i8042-x86ia64io.h"
29#elif defined(CONFIG_UNICORE32)
30#include "i8042-unicore32io.h"
29#else 31#else
30#include "i8042-io.h" 32#include "i8042-io.h"
31#endif 33#endif
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 9da6fbcaaa7e..7ec3c97dc1b9 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -90,7 +90,7 @@ static int rpckbd_open(struct serio *port)
90 90
91 if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) { 91 if (request_irq(IRQ_KEYBOARDTX, rpckbd_tx, 0, "rpckbd", port) != 0) {
92 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n"); 92 printk(KERN_ERR "rpckbd.c: Could not allocate keyboard transmit IRQ\n");
93 free_irq(IRQ_KEYBOARDRX, NULL); 93 free_irq(IRQ_KEYBOARDRX, port);
94 return -EBUSY; 94 return -EBUSY;
95 } 95 }
96 96
diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c
index db5b0bca1a1a..ba70058e2be3 100644
--- a/drivers/input/serio/serio.c
+++ b/drivers/input/serio/serio.c
@@ -188,7 +188,8 @@ static void serio_free_event(struct serio_event *event)
188 kfree(event); 188 kfree(event);
189} 189}
190 190
191static void serio_remove_duplicate_events(struct serio_event *event) 191static void serio_remove_duplicate_events(void *object,
192 enum serio_event_type type)
192{ 193{
193 struct serio_event *e, *next; 194 struct serio_event *e, *next;
194 unsigned long flags; 195 unsigned long flags;
@@ -196,13 +197,13 @@ static void serio_remove_duplicate_events(struct serio_event *event)
196 spin_lock_irqsave(&serio_event_lock, flags); 197 spin_lock_irqsave(&serio_event_lock, flags);
197 198
198 list_for_each_entry_safe(e, next, &serio_event_list, node) { 199 list_for_each_entry_safe(e, next, &serio_event_list, node) {
199 if (event->object == e->object) { 200 if (object == e->object) {
200 /* 201 /*
201 * If this event is of different type we should not 202 * If this event is of different type we should not
202 * look further - we only suppress duplicate events 203 * look further - we only suppress duplicate events
203 * that were sent back-to-back. 204 * that were sent back-to-back.
204 */ 205 */
205 if (event->type != e->type) 206 if (type != e->type)
206 break; 207 break;
207 208
208 list_del_init(&e->node); 209 list_del_init(&e->node);
@@ -245,7 +246,7 @@ static void serio_handle_event(struct work_struct *work)
245 break; 246 break;
246 } 247 }
247 248
248 serio_remove_duplicate_events(event); 249 serio_remove_duplicate_events(event->object, event->type);
249 serio_free_event(event); 250 serio_free_event(event);
250 } 251 }
251 252
@@ -298,7 +299,7 @@ static int serio_queue_event(void *object, struct module *owner,
298 event->owner = owner; 299 event->owner = owner;
299 300
300 list_add_tail(&event->node, &serio_event_list); 301 list_add_tail(&event->node, &serio_event_list);
301 schedule_work(&serio_event_work); 302 queue_work(system_long_wq, &serio_event_work);
302 303
303out: 304out:
304 spin_unlock_irqrestore(&serio_event_lock, flags); 305 spin_unlock_irqrestore(&serio_event_lock, flags);
@@ -436,10 +437,12 @@ static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *
436 } else if (!strncmp(buf, "rescan", count)) { 437 } else if (!strncmp(buf, "rescan", count)) {
437 serio_disconnect_port(serio); 438 serio_disconnect_port(serio);
438 serio_find_driver(serio); 439 serio_find_driver(serio);
440 serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT);
439 } else if ((drv = driver_find(buf, &serio_bus)) != NULL) { 441 } else if ((drv = driver_find(buf, &serio_bus)) != NULL) {
440 serio_disconnect_port(serio); 442 serio_disconnect_port(serio);
441 error = serio_bind_driver(serio, to_serio_driver(drv)); 443 error = serio_bind_driver(serio, to_serio_driver(drv));
442 put_driver(drv); 444 put_driver(drv);
445 serio_remove_duplicate_events(serio, SERIO_RESCAN_PORT);
443 } else { 446 } else {
444 error = -EINVAL; 447 error = -EINVAL;
445 } 448 }
diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index bb14449fb022..80baa53da5b1 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -225,15 +225,14 @@ static void sxps2_close(struct serio *pserio)
225/** 225/**
226 * xps2_of_probe - probe method for the PS/2 device. 226 * xps2_of_probe - probe method for the PS/2 device.
227 * @of_dev: pointer to OF device structure 227 * @of_dev: pointer to OF device structure
228 * @match: pointer to the stucture used for matching a device 228 * @match: pointer to the structure used for matching a device
229 * 229 *
230 * This function probes the PS/2 device in the device tree. 230 * This function probes the PS/2 device in the device tree.
231 * It initializes the driver data structure and the hardware. 231 * It initializes the driver data structure and the hardware.
232 * It returns 0, if the driver is bound to the PS/2 device, or a negative 232 * It returns 0, if the driver is bound to the PS/2 device, or a negative
233 * value if there is an error. 233 * value if there is an error.
234 */ 234 */
235static int __devinit xps2_of_probe(struct platform_device *ofdev, 235static int __devinit xps2_of_probe(struct platform_device *ofdev)
236 const struct of_device_id *match)
237{ 236{
238 struct resource r_irq; /* Interrupt resources */ 237 struct resource r_irq; /* Interrupt resources */
239 struct resource r_mem; /* IO mem resources */ 238 struct resource r_mem; /* IO mem resources */
@@ -361,7 +360,7 @@ static const struct of_device_id xps2_of_match[] __devinitconst = {
361}; 360};
362MODULE_DEVICE_TABLE(of, xps2_of_match); 361MODULE_DEVICE_TABLE(of, xps2_of_match);
363 362
364static struct of_platform_driver xps2_of_driver = { 363static struct platform_driver xps2_of_driver = {
365 .driver = { 364 .driver = {
366 .name = DRIVER_NAME, 365 .name = DRIVER_NAME,
367 .owner = THIS_MODULE, 366 .owner = THIS_MODULE,
@@ -373,12 +372,12 @@ static struct of_platform_driver xps2_of_driver = {
373 372
374static int __init xps2_init(void) 373static int __init xps2_init(void)
375{ 374{
376 return of_register_platform_driver(&xps2_of_driver); 375 return platform_driver_register(&xps2_of_driver);
377} 376}
378 377
379static void __exit xps2_cleanup(void) 378static void __exit xps2_cleanup(void)
380{ 379{
381 of_unregister_platform_driver(&xps2_of_driver); 380 platform_driver_unregister(&xps2_of_driver);
382} 381}
383 382
384module_init(xps2_init); 383module_init(xps2_init);
diff --git a/drivers/input/sparse-keymap.c b/drivers/input/sparse-keymap.c
index 337bf51bc984..fdb6a3976f94 100644
--- a/drivers/input/sparse-keymap.c
+++ b/drivers/input/sparse-keymap.c
@@ -208,6 +208,12 @@ int sparse_keymap_setup(struct input_dev *dev,
208 } 208 }
209 } 209 }
210 210
211 if (test_bit(EV_KEY, dev->evbit)) {
212 __set_bit(KEY_UNKNOWN, dev->keybit);
213 __set_bit(EV_MSC, dev->evbit);
214 __set_bit(MSC_SCAN, dev->mscbit);
215 }
216
211 dev->keycode = map; 217 dev->keycode = map;
212 dev->keycodemax = map_size; 218 dev->keycodemax = map_size;
213 dev->getkeycode = sparse_keymap_getkeycode; 219 dev->getkeycode = sparse_keymap_getkeycode;
@@ -268,6 +274,7 @@ void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *k
268{ 274{
269 switch (ke->type) { 275 switch (ke->type) {
270 case KE_KEY: 276 case KE_KEY:
277 input_event(dev, EV_MSC, MSC_SCAN, ke->code);
271 input_report_key(dev, ke->keycode, value); 278 input_report_key(dev, ke->keycode, value);
272 input_sync(dev); 279 input_sync(dev);
273 if (value && autorelease) { 280 if (value && autorelease) {
@@ -305,12 +312,19 @@ bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code,
305{ 312{
306 const struct key_entry *ke = 313 const struct key_entry *ke =
307 sparse_keymap_entry_from_scancode(dev, code); 314 sparse_keymap_entry_from_scancode(dev, code);
315 struct key_entry unknown_ke;
308 316
309 if (ke) { 317 if (ke) {
310 sparse_keymap_report_entry(dev, ke, value, autorelease); 318 sparse_keymap_report_entry(dev, ke, value, autorelease);
311 return true; 319 return true;
312 } 320 }
313 321
322 /* Report an unknown key event as a debugging aid */
323 unknown_ke.type = KE_KEY;
324 unknown_ke.code = code;
325 unknown_ke.keycode = KEY_UNKNOWN;
326 sparse_keymap_report_entry(dev, &unknown_ke, value, true);
327
314 return false; 328 return false;
315} 329}
316EXPORT_SYMBOL(sparse_keymap_report_event); 330EXPORT_SYMBOL(sparse_keymap_report_event);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index b97665f9765e..449c0a46dbac 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -519,7 +519,7 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i
519 /* Retrieve the physical and logical size for OEM devices */ 519 /* Retrieve the physical and logical size for OEM devices */
520 error = wacom_retrieve_hid_descriptor(intf, features); 520 error = wacom_retrieve_hid_descriptor(intf, features);
521 if (error) 521 if (error)
522 goto fail2; 522 goto fail3;
523 523
524 wacom_setup_device_quirks(features); 524 wacom_setup_device_quirks(features);
525 525
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 5597637cfd41..08ba5ad9c9be 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -16,6 +16,14 @@
16#include "wacom.h" 16#include "wacom.h"
17#include <linux/input/mt.h> 17#include <linux/input/mt.h>
18 18
19/* resolution for penabled devices */
20#define WACOM_PL_RES 20
21#define WACOM_PENPRTN_RES 40
22#define WACOM_VOLITO_RES 50
23#define WACOM_GRAPHIRE_RES 80
24#define WACOM_INTUOS_RES 100
25#define WACOM_INTUOS3_RES 200
26
19static int wacom_penpartner_irq(struct wacom_wac *wacom) 27static int wacom_penpartner_irq(struct wacom_wac *wacom)
20{ 28{
21 unsigned char *data = wacom->data; 29 unsigned char *data = wacom->data;
@@ -1055,6 +1063,19 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1055 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 1063 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1056 features->pressure_fuzz, 0); 1064 features->pressure_fuzz, 0);
1057 1065
1066 if (features->device_type == BTN_TOOL_PEN) {
1067 /* penabled devices have fixed resolution for each model */
1068 input_abs_set_res(input_dev, ABS_X, features->x_resolution);
1069 input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
1070 } else {
1071 input_abs_set_res(input_dev, ABS_X,
1072 wacom_calculate_touch_res(features->x_max,
1073 features->x_phy));
1074 input_abs_set_res(input_dev, ABS_Y,
1075 wacom_calculate_touch_res(features->y_max,
1076 features->y_phy));
1077 }
1078
1058 __set_bit(ABS_MISC, input_dev->absbit); 1079 __set_bit(ABS_MISC, input_dev->absbit);
1059 1080
1060 switch (wacom_wac->features.type) { 1081 switch (wacom_wac->features.type) {
@@ -1171,15 +1192,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1171 case TABLETPC: 1192 case TABLETPC:
1172 __clear_bit(ABS_MISC, input_dev->absbit); 1193 __clear_bit(ABS_MISC, input_dev->absbit);
1173 1194
1174 if (features->device_type != BTN_TOOL_PEN) { 1195 if (features->device_type != BTN_TOOL_PEN)
1175 input_abs_set_res(input_dev, ABS_X,
1176 wacom_calculate_touch_res(features->x_max,
1177 features->x_phy));
1178 input_abs_set_res(input_dev, ABS_Y,
1179 wacom_calculate_touch_res(features->y_max,
1180 features->y_phy));
1181 break; /* no need to process stylus stuff */ 1196 break; /* no need to process stylus stuff */
1182 } 1197
1183 /* fall through */ 1198 /* fall through */
1184 1199
1185 case PL: 1200 case PL:
@@ -1216,12 +1231,6 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1216 input_set_abs_params(input_dev, ABS_MT_PRESSURE, 1231 input_set_abs_params(input_dev, ABS_MT_PRESSURE,
1217 0, features->pressure_max, 1232 0, features->pressure_max,
1218 features->pressure_fuzz, 0); 1233 features->pressure_fuzz, 0);
1219 input_abs_set_res(input_dev, ABS_X,
1220 wacom_calculate_touch_res(features->x_max,
1221 features->x_phy));
1222 input_abs_set_res(input_dev, ABS_Y,
1223 wacom_calculate_touch_res(features->y_max,
1224 features->y_phy));
1225 } else if (features->device_type == BTN_TOOL_PEN) { 1234 } else if (features->device_type == BTN_TOOL_PEN) {
1226 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1235 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1227 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1236 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
@@ -1233,161 +1242,242 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1233} 1242}
1234 1243
1235static const struct wacom_features wacom_features_0x00 = 1244static const struct wacom_features wacom_features_0x00 =
1236 { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, PENPARTNER }; 1245 { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255,
1246 0, PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
1237static const struct wacom_features wacom_features_0x10 = 1247static const struct wacom_features wacom_features_0x10 =
1238 { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE }; 1248 { "Wacom Graphire", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
1249 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1239static const struct wacom_features wacom_features_0x11 = 1250static const struct wacom_features wacom_features_0x11 =
1240 { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511, 63, GRAPHIRE }; 1251 { "Wacom Graphire2 4x5", WACOM_PKGLEN_GRAPHIRE, 10206, 7422, 511,
1252 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1241static const struct wacom_features wacom_features_0x12 = 1253static const struct wacom_features wacom_features_0x12 =
1242 { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511, 63, GRAPHIRE }; 1254 { "Wacom Graphire2 5x7", WACOM_PKGLEN_GRAPHIRE, 13918, 10206, 511,
1255 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1243static const struct wacom_features wacom_features_0x13 = 1256static const struct wacom_features wacom_features_0x13 =
1244 { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, GRAPHIRE }; 1257 { "Wacom Graphire3", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
1258 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1245static const struct wacom_features wacom_features_0x14 = 1259static const struct wacom_features wacom_features_0x14 =
1246 { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE }; 1260 { "Wacom Graphire3 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1261 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1247static const struct wacom_features wacom_features_0x15 = 1262static const struct wacom_features wacom_features_0x15 =
1248 { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511, 63, WACOM_G4 }; 1263 { "Wacom Graphire4 4x5", WACOM_PKGLEN_GRAPHIRE, 10208, 7424, 511,
1264 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1249static const struct wacom_features wacom_features_0x16 = 1265static const struct wacom_features wacom_features_0x16 =
1250 { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, WACOM_G4 }; 1266 { "Wacom Graphire4 6x8", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1267 63, WACOM_G4, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1251static const struct wacom_features wacom_features_0x17 = 1268static const struct wacom_features wacom_features_0x17 =
1252 { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO }; 1269 { "Wacom BambooFun 4x5", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
1270 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1253static const struct wacom_features wacom_features_0x18 = 1271static const struct wacom_features wacom_features_0x18 =
1254 { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511, 63, WACOM_MO }; 1272 { "Wacom BambooFun 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 511,
1273 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1255static const struct wacom_features wacom_features_0x19 = 1274static const struct wacom_features wacom_features_0x19 =
1256 { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511, 63, GRAPHIRE }; 1275 { "Wacom Bamboo1 Medium", WACOM_PKGLEN_GRAPHIRE, 16704, 12064, 511,
1276 63, GRAPHIRE, WACOM_GRAPHIRE_RES, WACOM_GRAPHIRE_RES };
1257static const struct wacom_features wacom_features_0x60 = 1277static const struct wacom_features wacom_features_0x60 =
1258 { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1278 { "Wacom Volito", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1279 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1259static const struct wacom_features wacom_features_0x61 = 1280static const struct wacom_features wacom_features_0x61 =
1260 { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255, 63, GRAPHIRE }; 1281 { "Wacom PenStation2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 255,
1282 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1261static const struct wacom_features wacom_features_0x62 = 1283static const struct wacom_features wacom_features_0x62 =
1262 { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1284 { "Wacom Volito2 4x5", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1285 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1263static const struct wacom_features wacom_features_0x63 = 1286static const struct wacom_features wacom_features_0x63 =
1264 { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511, 63, GRAPHIRE }; 1287 { "Wacom Volito2 2x3", WACOM_PKGLEN_GRAPHIRE, 3248, 2320, 511,
1288 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1265static const struct wacom_features wacom_features_0x64 = 1289static const struct wacom_features wacom_features_0x64 =
1266 { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511, 63, GRAPHIRE }; 1290 { "Wacom PenPartner2", WACOM_PKGLEN_GRAPHIRE, 3250, 2320, 511,
1291 63, GRAPHIRE, WACOM_VOLITO_RES, WACOM_VOLITO_RES };
1267static const struct wacom_features wacom_features_0x65 = 1292static const struct wacom_features wacom_features_0x65 =
1268 { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511, 63, WACOM_MO }; 1293 { "Wacom Bamboo", WACOM_PKGLEN_BBFUN, 14760, 9225, 511,
1294 63, WACOM_MO, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1269static const struct wacom_features wacom_features_0x69 = 1295static const struct wacom_features wacom_features_0x69 =
1270 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511, 63, GRAPHIRE }; 1296 { "Wacom Bamboo1", WACOM_PKGLEN_GRAPHIRE, 5104, 3712, 511,
1297 63, GRAPHIRE, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES };
1271static const struct wacom_features wacom_features_0x20 = 1298static const struct wacom_features wacom_features_0x20 =
1272 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS }; 1299 { "Wacom Intuos 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
1300 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1273static const struct wacom_features wacom_features_0x21 = 1301static const struct wacom_features wacom_features_0x21 =
1274 { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1302 { "Wacom Intuos 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1303 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1275static const struct wacom_features wacom_features_0x22 = 1304static const struct wacom_features wacom_features_0x22 =
1276 { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS }; 1305 { "Wacom Intuos 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
1306 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1277static const struct wacom_features wacom_features_0x23 = 1307static const struct wacom_features wacom_features_0x23 =
1278 { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS }; 1308 { "Wacom Intuos 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
1309 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1279static const struct wacom_features wacom_features_0x24 = 1310static const struct wacom_features wacom_features_0x24 =
1280 { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS }; 1311 { "Wacom Intuos 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
1312 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1281static const struct wacom_features wacom_features_0x30 = 1313static const struct wacom_features wacom_features_0x30 =
1282 { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255, 0, PL }; 1314 { "Wacom PL400", WACOM_PKGLEN_GRAPHIRE, 5408, 4056, 255,
1315 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1283static const struct wacom_features wacom_features_0x31 = 1316static const struct wacom_features wacom_features_0x31 =
1284 { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255, 0, PL }; 1317 { "Wacom PL500", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 255,
1318 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1285static const struct wacom_features wacom_features_0x32 = 1319static const struct wacom_features wacom_features_0x32 =
1286 { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255, 0, PL }; 1320 { "Wacom PL600", WACOM_PKGLEN_GRAPHIRE, 6126, 4604, 255,
1321 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1287static const struct wacom_features wacom_features_0x33 = 1322static const struct wacom_features wacom_features_0x33 =
1288 { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255, 0, PL }; 1323 { "Wacom PL600SX", WACOM_PKGLEN_GRAPHIRE, 6260, 5016, 255,
1324 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1289static const struct wacom_features wacom_features_0x34 = 1325static const struct wacom_features wacom_features_0x34 =
1290 { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511, 0, PL }; 1326 { "Wacom PL550", WACOM_PKGLEN_GRAPHIRE, 6144, 4608, 511,
1327 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1291static const struct wacom_features wacom_features_0x35 = 1328static const struct wacom_features wacom_features_0x35 =
1292 { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511, 0, PL }; 1329 { "Wacom PL800", WACOM_PKGLEN_GRAPHIRE, 7220, 5780, 511,
1330 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1293static const struct wacom_features wacom_features_0x37 = 1331static const struct wacom_features wacom_features_0x37 =
1294 { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511, 0, PL }; 1332 { "Wacom PL700", WACOM_PKGLEN_GRAPHIRE, 6758, 5406, 511,
1333 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1295static const struct wacom_features wacom_features_0x38 = 1334static const struct wacom_features wacom_features_0x38 =
1296 { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL }; 1335 { "Wacom PL510", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
1336 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1297static const struct wacom_features wacom_features_0x39 = 1337static const struct wacom_features wacom_features_0x39 =
1298 { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511, 0, PL }; 1338 { "Wacom DTU710", WACOM_PKGLEN_GRAPHIRE, 34080, 27660, 511,
1339 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1299static const struct wacom_features wacom_features_0xC4 = 1340static const struct wacom_features wacom_features_0xC4 =
1300 { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511, 0, PL }; 1341 { "Wacom DTF521", WACOM_PKGLEN_GRAPHIRE, 6282, 4762, 511,
1342 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1301static const struct wacom_features wacom_features_0xC0 = 1343static const struct wacom_features wacom_features_0xC0 =
1302 { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL }; 1344 { "Wacom DTF720", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
1345 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1303static const struct wacom_features wacom_features_0xC2 = 1346static const struct wacom_features wacom_features_0xC2 =
1304 { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511, 0, PL }; 1347 { "Wacom DTF720a", WACOM_PKGLEN_GRAPHIRE, 6858, 5506, 511,
1348 0, PL, WACOM_PL_RES, WACOM_PL_RES };
1305static const struct wacom_features wacom_features_0x03 = 1349static const struct wacom_features wacom_features_0x03 =
1306 { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511, 0, PTU }; 1350 { "Wacom Cintiq Partner", WACOM_PKGLEN_GRAPHIRE, 20480, 15360, 511,
1351 0, PTU, WACOM_PL_RES, WACOM_PL_RES };
1307static const struct wacom_features wacom_features_0x41 = 1352static const struct wacom_features wacom_features_0x41 =
1308 { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023, 31, INTUOS }; 1353 { "Wacom Intuos2 4x5", WACOM_PKGLEN_INTUOS, 12700, 10600, 1023,
1354 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1309static const struct wacom_features wacom_features_0x42 = 1355static const struct wacom_features wacom_features_0x42 =
1310 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1356 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1357 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1311static const struct wacom_features wacom_features_0x43 = 1358static const struct wacom_features wacom_features_0x43 =
1312 { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023, 31, INTUOS }; 1359 { "Wacom Intuos2 9x12", WACOM_PKGLEN_INTUOS, 30480, 24060, 1023,
1360 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1313static const struct wacom_features wacom_features_0x44 = 1361static const struct wacom_features wacom_features_0x44 =
1314 { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023, 31, INTUOS }; 1362 { "Wacom Intuos2 12x12", WACOM_PKGLEN_INTUOS, 30480, 31680, 1023,
1363 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1315static const struct wacom_features wacom_features_0x45 = 1364static const struct wacom_features wacom_features_0x45 =
1316 { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023, 31, INTUOS }; 1365 { "Wacom Intuos2 12x18", WACOM_PKGLEN_INTUOS, 45720, 31680, 1023,
1366 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1317static const struct wacom_features wacom_features_0xB0 = 1367static const struct wacom_features wacom_features_0xB0 =
1318 { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023, 63, INTUOS3S }; 1368 { "Wacom Intuos3 4x5", WACOM_PKGLEN_INTUOS, 25400, 20320, 1023,
1369 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1319static const struct wacom_features wacom_features_0xB1 = 1370static const struct wacom_features wacom_features_0xB1 =
1320 { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023, 63, INTUOS3 }; 1371 { "Wacom Intuos3 6x8", WACOM_PKGLEN_INTUOS, 40640, 30480, 1023,
1372 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1321static const struct wacom_features wacom_features_0xB2 = 1373static const struct wacom_features wacom_features_0xB2 =
1322 { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023, 63, INTUOS3 }; 1374 { "Wacom Intuos3 9x12", WACOM_PKGLEN_INTUOS, 60960, 45720, 1023,
1375 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1323static const struct wacom_features wacom_features_0xB3 = 1376static const struct wacom_features wacom_features_0xB3 =
1324 { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023, 63, INTUOS3L }; 1377 { "Wacom Intuos3 12x12", WACOM_PKGLEN_INTUOS, 60960, 60960, 1023,
1378 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1325static const struct wacom_features wacom_features_0xB4 = 1379static const struct wacom_features wacom_features_0xB4 =
1326 { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023, 63, INTUOS3L }; 1380 { "Wacom Intuos3 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 1023,
1381 63, INTUOS3L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1327static const struct wacom_features wacom_features_0xB5 = 1382static const struct wacom_features wacom_features_0xB5 =
1328 { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023, 63, INTUOS3 }; 1383 { "Wacom Intuos3 6x11", WACOM_PKGLEN_INTUOS, 54204, 31750, 1023,
1384 63, INTUOS3, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1329static const struct wacom_features wacom_features_0xB7 = 1385static const struct wacom_features wacom_features_0xB7 =
1330 { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023, 63, INTUOS3S }; 1386 { "Wacom Intuos3 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 1023,
1387 63, INTUOS3S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1331static const struct wacom_features wacom_features_0xB8 = 1388static const struct wacom_features wacom_features_0xB8 =
1332 { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 63, INTUOS4S }; 1389 { "Wacom Intuos4 4x6", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
1390 63, INTUOS4S, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1333static const struct wacom_features wacom_features_0xB9 = 1391static const struct wacom_features wacom_features_0xB9 =
1334 { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047, 63, INTUOS4 }; 1392 { "Wacom Intuos4 6x9", WACOM_PKGLEN_INTUOS, 44704, 27940, 2047,
1393 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1335static const struct wacom_features wacom_features_0xBA = 1394static const struct wacom_features wacom_features_0xBA =
1336 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047, 63, INTUOS4L }; 1395 { "Wacom Intuos4 8x13", WACOM_PKGLEN_INTUOS, 65024, 40640, 2047,
1396 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1337static const struct wacom_features wacom_features_0xBB = 1397static const struct wacom_features wacom_features_0xBB =
1338 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 63, INTUOS4L }; 1398 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
1399 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1339static const struct wacom_features wacom_features_0xBC = 1400static const struct wacom_features wacom_features_0xBC =
1340 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 63, INTUOS4 }; 1401 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047,
1402 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1341static const struct wacom_features wacom_features_0x3F = 1403static const struct wacom_features wacom_features_0x3F =
1342 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, 63, CINTIQ }; 1404 { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023,
1405 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1343static const struct wacom_features wacom_features_0xC5 = 1406static const struct wacom_features wacom_features_0xC5 =
1344 { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023, 63, WACOM_BEE }; 1407 { "Wacom Cintiq 20WSX", WACOM_PKGLEN_INTUOS, 86680, 54180, 1023,
1408 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1345static const struct wacom_features wacom_features_0xC6 = 1409static const struct wacom_features wacom_features_0xC6 =
1346 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 63, WACOM_BEE }; 1410 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,
1411 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1347static const struct wacom_features wacom_features_0xC7 = 1412static const struct wacom_features wacom_features_0xC7 =
1348 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 0, PL }; 1413 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,
1414 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1349static const struct wacom_features wacom_features_0xCE = 1415static const struct wacom_features wacom_features_0xCE =
1350 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511, 0, DTU }; 1416 { "Wacom DTU2231", WACOM_PKGLEN_GRAPHIRE, 47864, 27011, 511,
1417 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1351static const struct wacom_features wacom_features_0xF0 = 1418static const struct wacom_features wacom_features_0xF0 =
1352 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 0, DTU }; 1419 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
1420 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1353static const struct wacom_features wacom_features_0xCC = 1421static const struct wacom_features wacom_features_0xCC =
1354 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047, 63, WACOM_21UX2 }; 1422 { "Wacom Cintiq 21UX2", WACOM_PKGLEN_INTUOS, 87200, 65600, 2047,
1423 63, WACOM_21UX2, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1355static const struct wacom_features wacom_features_0x90 = 1424static const struct wacom_features wacom_features_0x90 =
1356 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1425 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1426 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1357static const struct wacom_features wacom_features_0x93 = 1427static const struct wacom_features wacom_features_0x93 =
1358 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1428 { "Wacom ISDv4 93", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1429 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1359static const struct wacom_features wacom_features_0x9A = 1430static const struct wacom_features wacom_features_0x9A =
1360 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1431 { "Wacom ISDv4 9A", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1432 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1361static const struct wacom_features wacom_features_0x9F = 1433static const struct wacom_features wacom_features_0x9F =
1362 { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 0, TABLETPC }; 1434 { "Wacom ISDv4 9F", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1435 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1363static const struct wacom_features wacom_features_0xE2 = 1436static const struct wacom_features wacom_features_0xE2 =
1364 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; 1437 { "Wacom ISDv4 E2", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1438 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1365static const struct wacom_features wacom_features_0xE3 = 1439static const struct wacom_features wacom_features_0xE3 =
1366 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255, 0, TABLETPC2FG }; 1440 { "Wacom ISDv4 E3", WACOM_PKGLEN_TPC2FG, 26202, 16325, 255,
1441 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1442static const struct wacom_features wacom_features_0xE6 =
1443 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
1444 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1367static const struct wacom_features wacom_features_0x47 = 1445static const struct wacom_features wacom_features_0x47 =
1368 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023, 31, INTUOS }; 1446 { "Wacom Intuos2 6x8", WACOM_PKGLEN_INTUOS, 20320, 16240, 1023,
1369static struct wacom_features wacom_features_0xD0 = 1447 31, INTUOS, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1370 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1448static const struct wacom_features wacom_features_0xD0 =
1371static struct wacom_features wacom_features_0xD1 = 1449 { "Wacom Bamboo 2FG", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1372 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1450 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1373static struct wacom_features wacom_features_0xD2 = 1451static const struct wacom_features wacom_features_0xD1 =
1374 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1452 { "Wacom Bamboo 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1375static struct wacom_features wacom_features_0xD3 = 1453 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1376 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; 1454static const struct wacom_features wacom_features_0xD2 =
1455 { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1456 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1457static const struct wacom_features wacom_features_0xD3 =
1458 { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1459 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1377static const struct wacom_features wacom_features_0xD4 = 1460static const struct wacom_features wacom_features_0xD4 =
1378 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 63, BAMBOO_PT }; 1461 { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255,
1379static struct wacom_features wacom_features_0xD6 = 1462 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1380 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1463static const struct wacom_features wacom_features_0xD6 =
1381static struct wacom_features wacom_features_0xD7 = 1464 { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1382 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1465 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1383static struct wacom_features wacom_features_0xD8 = 1466static const struct wacom_features wacom_features_0xD7 =
1384 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; 1467 { "Wacom BambooPT 2FG Small", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1385static struct wacom_features wacom_features_0xDA = 1468 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1386 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; 1469static const struct wacom_features wacom_features_0xD8 =
1470 { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1471 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1472static const struct wacom_features wacom_features_0xDA =
1473 { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
1474 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1387static struct wacom_features wacom_features_0xDB = 1475static struct wacom_features wacom_features_0xDB =
1388 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; 1476 { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023,
1477 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1389static const struct wacom_features wacom_features_0x6004 = 1478static const struct wacom_features wacom_features_0x6004 =
1390 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 0, TABLETPC }; 1479 { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255,
1480 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1391 1481
1392#define USB_DEVICE_WACOM(prod) \ 1482#define USB_DEVICE_WACOM(prod) \
1393 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ 1483 USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \
@@ -1474,6 +1564,7 @@ const struct usb_device_id wacom_ids[] = {
1474 { USB_DEVICE_WACOM(0x9F) }, 1564 { USB_DEVICE_WACOM(0x9F) },
1475 { USB_DEVICE_WACOM(0xE2) }, 1565 { USB_DEVICE_WACOM(0xE2) },
1476 { USB_DEVICE_WACOM(0xE3) }, 1566 { USB_DEVICE_WACOM(0xE3) },
1567 { USB_DEVICE_WACOM(0xE6) },
1477 { USB_DEVICE_WACOM(0x47) }, 1568 { USB_DEVICE_WACOM(0x47) },
1478 { USB_DEVICE_LENOVO(0x6004) }, 1569 { USB_DEVICE_LENOVO(0x6004) },
1479 { } 1570 { }
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 835f756b150c..53eb71b68330 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -74,6 +74,8 @@ struct wacom_features {
74 int pressure_max; 74 int pressure_max;
75 int distance_max; 75 int distance_max;
76 int type; 76 int type;
77 int x_resolution;
78 int y_resolution;
77 int device_type; 79 int device_type;
78 int x_phy; 80 int x_phy;
79 int y_phy; 81 int y_phy;
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 6b2d441a7dde..cabd9e54863f 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -653,7 +653,7 @@ config TOUCHSCREEN_TOUCHIT213
653 653
654config TOUCHSCREEN_TSC2005 654config TOUCHSCREEN_TSC2005
655 tristate "TSC2005 based touchscreens" 655 tristate "TSC2005 based touchscreens"
656 depends on SPI_MASTER 656 depends on SPI_MASTER && GENERIC_HARDIRQS
657 help 657 help
658 Say Y here if you have a TSC2005 based touchscreen. 658 Say Y here if you have a TSC2005 based touchscreen.
659 659
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index b31e90f0d44b..c24946f51256 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -946,28 +946,29 @@ static int __devinit ads7846_setup_pendown(struct spi_device *spi, struct ads784
946 struct ads7846_platform_data *pdata = spi->dev.platform_data; 946 struct ads7846_platform_data *pdata = spi->dev.platform_data;
947 int err; 947 int err;
948 948
949 /* REVISIT when the irq can be triggered active-low, or if for some 949 /*
950 * REVISIT when the irq can be triggered active-low, or if for some
950 * reason the touchscreen isn't hooked up, we don't need to access 951 * reason the touchscreen isn't hooked up, we don't need to access
951 * the pendown state. 952 * the pendown state.
952 */ 953 */
953 if (!pdata->get_pendown_state && !gpio_is_valid(pdata->gpio_pendown)) {
954 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
955 return -EINVAL;
956 }
957 954
958 if (pdata->get_pendown_state) { 955 if (pdata->get_pendown_state) {
959 ts->get_pendown_state = pdata->get_pendown_state; 956 ts->get_pendown_state = pdata->get_pendown_state;
960 return 0; 957 } else if (gpio_is_valid(pdata->gpio_pendown)) {
961 }
962 958
963 err = gpio_request(pdata->gpio_pendown, "ads7846_pendown"); 959 err = gpio_request(pdata->gpio_pendown, "ads7846_pendown");
964 if (err) { 960 if (err) {
965 dev_err(&spi->dev, "failed to request pendown GPIO%d\n", 961 dev_err(&spi->dev, "failed to request pendown GPIO%d\n",
966 pdata->gpio_pendown); 962 pdata->gpio_pendown);
967 return err; 963 return err;
968 } 964 }
969 965
970 ts->gpio_pendown = pdata->gpio_pendown; 966 ts->gpio_pendown = pdata->gpio_pendown;
967
968 } else {
969 dev_err(&spi->dev, "no get_pendown_state nor gpio_pendown?\n");
970 return -EINVAL;
971 }
971 972
972 return 0; 973 return 0;
973} 974}
@@ -1358,7 +1359,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
1358 err_put_regulator: 1359 err_put_regulator:
1359 regulator_put(ts->reg); 1360 regulator_put(ts->reg);
1360 err_free_gpio: 1361 err_free_gpio:
1361 if (ts->gpio_pendown != -1) 1362 if (!ts->get_pendown_state)
1362 gpio_free(ts->gpio_pendown); 1363 gpio_free(ts->gpio_pendown);
1363 err_cleanup_filter: 1364 err_cleanup_filter:
1364 if (ts->filter_cleanup) 1365 if (ts->filter_cleanup)
@@ -1388,8 +1389,13 @@ static int __devexit ads7846_remove(struct spi_device *spi)
1388 regulator_disable(ts->reg); 1389 regulator_disable(ts->reg);
1389 regulator_put(ts->reg); 1390 regulator_put(ts->reg);
1390 1391
1391 if (ts->gpio_pendown != -1) 1392 if (!ts->get_pendown_state) {
1393 /*
1394 * If we are not using specialized pendown method we must
1395 * have been relying on gpio we set up ourselves.
1396 */
1392 gpio_free(ts->gpio_pendown); 1397 gpio_free(ts->gpio_pendown);
1398 }
1393 1399
1394 if (ts->filter_cleanup) 1400 if (ts->filter_cleanup)
1395 ts->filter_cleanup(ts->filter_data); 1401 ts->filter_cleanup(ts->filter_data);
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c
index b4d7f63deff1..45f93d0f5592 100644
--- a/drivers/input/touchscreen/h3600_ts_input.c
+++ b/drivers/input/touchscreen/h3600_ts_input.c
@@ -62,7 +62,7 @@ MODULE_LICENSE("GPL");
62 Programmer has no control over these numbers. 62 Programmer has no control over these numbers.
63 TODO there are holes - specifically 1,7,0x0a 63 TODO there are holes - specifically 1,7,0x0a
64*/ 64*/
65#define VERSION_ID 0 /* Get Version (request/respose) */ 65#define VERSION_ID 0 /* Get Version (request/response) */
66#define KEYBD_ID 2 /* Keyboard (event) */ 66#define KEYBD_ID 2 /* Keyboard (event) */
67#define TOUCHS_ID 3 /* Touch Screen (event)*/ 67#define TOUCHS_ID 3 /* Touch Screen (event)*/
68#define EEPROM_READ_ID 4 /* (request/response) */ 68#define EEPROM_READ_ID 4 /* (request/response) */
@@ -399,31 +399,34 @@ static int h3600ts_connect(struct serio *serio, struct serio_driver *drv)
399 IRQF_SHARED | IRQF_DISABLED, "h3600_action", &ts->dev)) { 399 IRQF_SHARED | IRQF_DISABLED, "h3600_action", &ts->dev)) {
400 printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n"); 400 printk(KERN_ERR "h3600ts.c: Could not allocate Action Button IRQ!\n");
401 err = -EBUSY; 401 err = -EBUSY;
402 goto fail2; 402 goto fail1;
403 } 403 }
404 404
405 if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler, 405 if (request_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, npower_button_handler,
406 IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", &ts->dev)) { 406 IRQF_SHARED | IRQF_DISABLED, "h3600_suspend", &ts->dev)) {
407 printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n"); 407 printk(KERN_ERR "h3600ts.c: Could not allocate Power Button IRQ!\n");
408 err = -EBUSY; 408 err = -EBUSY;
409 goto fail3; 409 goto fail2;
410 } 410 }
411 411
412 serio_set_drvdata(serio, ts); 412 serio_set_drvdata(serio, ts);
413 413
414 err = serio_open(serio, drv); 414 err = serio_open(serio, drv);
415 if (err) 415 if (err)
416 return err; 416 goto fail3;
417 417
418 //h3600_flite_control(1, 25); /* default brightness */ 418 //h3600_flite_control(1, 25); /* default brightness */
419 input_register_device(ts->dev); 419 err = input_register_device(ts->dev);
420 if (err)
421 goto fail4;
420 422
421 return 0; 423 return 0;
422 424
423fail3: free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev); 425fail4: serio_close(serio);
426fail3: serio_set_drvdata(serio, NULL);
427 free_irq(IRQ_GPIO_BITSY_NPOWER_BUTTON, ts->dev);
424fail2: free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev); 428fail2: free_irq(IRQ_GPIO_BITSY_ACTION_BUTTON, ts->dev);
425fail1: serio_set_drvdata(serio, NULL); 429fail1: input_free_device(input_dev);
426 input_free_device(input_dev);
427 kfree(ts); 430 kfree(ts);
428 return err; 431 return err;
429} 432}
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c
index c0307b22d86f..66c96bfc5522 100644
--- a/drivers/input/touchscreen/intel-mid-touch.c
+++ b/drivers/input/touchscreen/intel-mid-touch.c
@@ -542,7 +542,7 @@ static int __devinit mrstouch_adc_init(struct mrstouch_dev *tsdev)
542 * ADC power on, start, enable PENDET and set loop delay 542 * ADC power on, start, enable PENDET and set loop delay
543 * ADC loop delay is set to 4.5 ms approximately 543 * ADC loop delay is set to 4.5 ms approximately
544 * Loop delay more than this results in jitter in adc readings 544 * Loop delay more than this results in jitter in adc readings
545 * Setting loop delay to 0 (continous loop) in MAXIM stops PENDET 545 * Setting loop delay to 0 (continuous loop) in MAXIM stops PENDET
546 * interrupt generation sometimes. 546 * interrupt generation sometimes.
547 */ 547 */
548 548
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c
index b6b8b1c7ecea..3242e7076258 100644
--- a/drivers/input/touchscreen/mainstone-wm97xx.c
+++ b/drivers/input/touchscreen/mainstone-wm97xx.c
@@ -219,7 +219,7 @@ static int wm97xx_acc_startup(struct wm97xx *wm)
219 } 219 }
220 220
221 wm->pen_irq = gpio_to_irq(irq); 221 wm->pen_irq = gpio_to_irq(irq);
222 set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH); 222 irq_set_irq_type(wm->pen_irq, IRQ_TYPE_EDGE_BOTH);
223 } else /* pen irq not supported */ 223 } else /* pen irq not supported */
224 pen_int = 0; 224 pen_int = 0;
225 225
diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c
index c8c136cf7bbc..43031492d733 100644
--- a/drivers/input/touchscreen/tps6507x-ts.c
+++ b/drivers/input/touchscreen/tps6507x-ts.c
@@ -43,7 +43,6 @@ struct tps6507x_ts {
43 struct input_dev *input_dev; 43 struct input_dev *input_dev;
44 struct device *dev; 44 struct device *dev;
45 char phys[32]; 45 char phys[32];
46 struct workqueue_struct *wq;
47 struct delayed_work work; 46 struct delayed_work work;
48 unsigned polling; /* polling is active */ 47 unsigned polling; /* polling is active */
49 struct ts_event tc; 48 struct ts_event tc;
@@ -220,8 +219,8 @@ done:
220 poll = 1; 219 poll = 1;
221 220
222 if (poll) { 221 if (poll) {
223 schd = queue_delayed_work(tsc->wq, &tsc->work, 222 schd = schedule_delayed_work(&tsc->work,
224 msecs_to_jiffies(tsc->poll_period)); 223 msecs_to_jiffies(tsc->poll_period));
225 if (schd) 224 if (schd)
226 tsc->polling = 1; 225 tsc->polling = 1;
227 else { 226 else {
@@ -303,7 +302,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
303 tsc->input_dev = input_dev; 302 tsc->input_dev = input_dev;
304 303
305 INIT_DELAYED_WORK(&tsc->work, tps6507x_ts_handler); 304 INIT_DELAYED_WORK(&tsc->work, tps6507x_ts_handler);
306 tsc->wq = create_workqueue("TPS6507x Touchscreen");
307 305
308 if (init_data) { 306 if (init_data) {
309 tsc->poll_period = init_data->poll_period; 307 tsc->poll_period = init_data->poll_period;
@@ -325,8 +323,8 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
325 if (error) 323 if (error)
326 goto err2; 324 goto err2;
327 325
328 schd = queue_delayed_work(tsc->wq, &tsc->work, 326 schd = schedule_delayed_work(&tsc->work,
329 msecs_to_jiffies(tsc->poll_period)); 327 msecs_to_jiffies(tsc->poll_period));
330 328
331 if (schd) 329 if (schd)
332 tsc->polling = 1; 330 tsc->polling = 1;
@@ -341,7 +339,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev)
341 339
342err2: 340err2:
343 cancel_delayed_work_sync(&tsc->work); 341 cancel_delayed_work_sync(&tsc->work);
344 destroy_workqueue(tsc->wq);
345 input_free_device(input_dev); 342 input_free_device(input_dev);
346err1: 343err1:
347 kfree(tsc); 344 kfree(tsc);
@@ -357,7 +354,6 @@ static int __devexit tps6507x_ts_remove(struct platform_device *pdev)
357 struct input_dev *input_dev = tsc->input_dev; 354 struct input_dev *input_dev = tsc->input_dev;
358 355
359 cancel_delayed_work_sync(&tsc->work); 356 cancel_delayed_work_sync(&tsc->work);
360 destroy_workqueue(tsc->wq);
361 357
362 input_unregister_device(input_dev); 358 input_unregister_device(input_dev);
363 359
diff --git a/drivers/input/touchscreen/tsc2005.c b/drivers/input/touchscreen/tsc2005.c
index 87420616efa4..cbf0ff322676 100644
--- a/drivers/input/touchscreen/tsc2005.c
+++ b/drivers/input/touchscreen/tsc2005.c
@@ -358,7 +358,7 @@ static void __tsc2005_enable(struct tsc2005 *ts)
358 if (ts->esd_timeout && ts->set_reset) { 358 if (ts->esd_timeout && ts->set_reset) {
359 ts->last_valid_interrupt = jiffies; 359 ts->last_valid_interrupt = jiffies;
360 schedule_delayed_work(&ts->esd_work, 360 schedule_delayed_work(&ts->esd_work,
361 round_jiffies(jiffies + 361 round_jiffies_relative(
362 msecs_to_jiffies(ts->esd_timeout))); 362 msecs_to_jiffies(ts->esd_timeout)));
363 } 363 }
364 364
@@ -477,7 +477,14 @@ static void tsc2005_esd_work(struct work_struct *work)
477 int error; 477 int error;
478 u16 r; 478 u16 r;
479 479
480 mutex_lock(&ts->mutex); 480 if (!mutex_trylock(&ts->mutex)) {
481 /*
482 * If the mutex is taken, it means that disable or enable is in
483 * progress. In that case just reschedule the work. If the work
484 * is not needed, it will be canceled by disable.
485 */
486 goto reschedule;
487 }
481 488
482 if (time_is_after_jiffies(ts->last_valid_interrupt + 489 if (time_is_after_jiffies(ts->last_valid_interrupt +
483 msecs_to_jiffies(ts->esd_timeout))) 490 msecs_to_jiffies(ts->esd_timeout)))
@@ -510,11 +517,12 @@ static void tsc2005_esd_work(struct work_struct *work)
510 tsc2005_start_scan(ts); 517 tsc2005_start_scan(ts);
511 518
512out: 519out:
520 mutex_unlock(&ts->mutex);
521reschedule:
513 /* re-arm the watchdog */ 522 /* re-arm the watchdog */
514 schedule_delayed_work(&ts->esd_work, 523 schedule_delayed_work(&ts->esd_work,
515 round_jiffies(jiffies + 524 round_jiffies_relative(
516 msecs_to_jiffies(ts->esd_timeout))); 525 msecs_to_jiffies(ts->esd_timeout)));
517 mutex_unlock(&ts->mutex);
518} 526}
519 527
520static int tsc2005_open(struct input_dev *input) 528static int tsc2005_open(struct input_dev *input)
@@ -663,7 +671,7 @@ static int __devinit tsc2005_probe(struct spi_device *spi)
663 goto err_remove_sysfs; 671 goto err_remove_sysfs;
664 } 672 }
665 673
666 set_irq_wake(spi->irq, 1); 674 irq_set_irq_wake(spi->irq, 1);
667 return 0; 675 return 0;
668 676
669err_remove_sysfs: 677err_remove_sysfs:
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c
index 028a5363eea1..3b5b5df04dd6 100644
--- a/drivers/input/touchscreen/ucb1400_ts.c
+++ b/drivers/input/touchscreen/ucb1400_ts.c
@@ -6,7 +6,7 @@
6 * Copyright: MontaVista Software, Inc. 6 * Copyright: MontaVista Software, Inc.
7 * 7 *
8 * Spliting done by: Marek Vasut <marek.vasut@gmail.com> 8 * Spliting done by: Marek Vasut <marek.vasut@gmail.com>
9 * If something doesnt work and it worked before spliting, e-mail me, 9 * If something doesn't work and it worked before spliting, e-mail me,
10 * dont bother Nicolas please ;-) 10 * dont bother Nicolas please ;-)
11 * 11 *
12 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index 5cb8449c909d..c14412ef4648 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -51,6 +51,10 @@ MODULE_LICENSE("GPL");
51#define W8001_PKTLEN_TPCCTL 11 /* control packet */ 51#define W8001_PKTLEN_TPCCTL 11 /* control packet */
52#define W8001_PKTLEN_TOUCH2FG 13 52#define W8001_PKTLEN_TOUCH2FG 13
53 53
54/* resolution in points/mm */
55#define W8001_PEN_RESOLUTION 100
56#define W8001_TOUCH_RESOLUTION 10
57
54struct w8001_coord { 58struct w8001_coord {
55 u8 rdy; 59 u8 rdy;
56 u8 tsw; 60 u8 tsw;
@@ -198,7 +202,7 @@ static void parse_touchquery(u8 *data, struct w8001_touch_query *query)
198 query->y = 1024; 202 query->y = 1024;
199 if (query->panel_res) 203 if (query->panel_res)
200 query->x = query->y = (1 << query->panel_res); 204 query->x = query->y = (1 << query->panel_res);
201 query->panel_res = 10; 205 query->panel_res = W8001_TOUCH_RESOLUTION;
202 } 206 }
203} 207}
204 208
@@ -394,6 +398,8 @@ static int w8001_setup(struct w8001 *w8001)
394 398
395 input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0); 399 input_set_abs_params(dev, ABS_X, 0, coord.x, 0, 0);
396 input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0); 400 input_set_abs_params(dev, ABS_Y, 0, coord.y, 0, 0);
401 input_abs_set_res(dev, ABS_X, W8001_PEN_RESOLUTION);
402 input_abs_set_res(dev, ABS_Y, W8001_PEN_RESOLUTION);
397 input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0); 403 input_set_abs_params(dev, ABS_PRESSURE, 0, coord.pen_pressure, 0, 0);
398 if (coord.tilt_x && coord.tilt_y) { 404 if (coord.tilt_x && coord.tilt_y) {
399 input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0); 405 input_set_abs_params(dev, ABS_TILT_X, 0, coord.tilt_x, 0, 0);
@@ -418,14 +424,17 @@ static int w8001_setup(struct w8001 *w8001)
418 w8001->max_touch_x = touch.x; 424 w8001->max_touch_x = touch.x;
419 w8001->max_touch_y = touch.y; 425 w8001->max_touch_y = touch.y;
420 426
421 /* scale to pen maximum */
422 if (w8001->max_pen_x && w8001->max_pen_y) { 427 if (w8001->max_pen_x && w8001->max_pen_y) {
428 /* if pen is supported scale to pen maximum */
423 touch.x = w8001->max_pen_x; 429 touch.x = w8001->max_pen_x;
424 touch.y = w8001->max_pen_y; 430 touch.y = w8001->max_pen_y;
431 touch.panel_res = W8001_PEN_RESOLUTION;
425 } 432 }
426 433
427 input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0); 434 input_set_abs_params(dev, ABS_X, 0, touch.x, 0, 0);
428 input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0); 435 input_set_abs_params(dev, ABS_Y, 0, touch.y, 0, 0);
436 input_abs_set_res(dev, ABS_X, touch.panel_res);
437 input_abs_set_res(dev, ABS_Y, touch.panel_res);
429 438
430 switch (touch.sensor_id) { 439 switch (touch.sensor_id) {
431 case 0: 440 case 0:
diff --git a/drivers/input/touchscreen/wm9705.c b/drivers/input/touchscreen/wm9705.c
index 6b5be742c27d..98e61175d3f5 100644
--- a/drivers/input/touchscreen/wm9705.c
+++ b/drivers/input/touchscreen/wm9705.c
@@ -306,7 +306,7 @@ static int wm9705_acc_enable(struct wm97xx *wm, int enable)
306 dig2 = wm->dig[2]; 306 dig2 = wm->dig[2];
307 307
308 if (enable) { 308 if (enable) {
309 /* continous mode */ 309 /* continuous mode */
310 if (wm->mach_ops->acc_startup && 310 if (wm->mach_ops->acc_startup &&
311 (ret = wm->mach_ops->acc_startup(wm)) < 0) 311 (ret = wm->mach_ops->acc_startup(wm)) < 0)
312 return ret; 312 return ret;
diff --git a/drivers/input/touchscreen/wm9712.c b/drivers/input/touchscreen/wm9712.c
index 7490b05c3566..2bc2fb801009 100644
--- a/drivers/input/touchscreen/wm9712.c
+++ b/drivers/input/touchscreen/wm9712.c
@@ -419,7 +419,7 @@ static int wm9712_acc_enable(struct wm97xx *wm, int enable)
419 dig2 = wm->dig[2]; 419 dig2 = wm->dig[2];
420 420
421 if (enable) { 421 if (enable) {
422 /* continous mode */ 422 /* continuous mode */
423 if (wm->mach_ops->acc_startup) { 423 if (wm->mach_ops->acc_startup) {
424 ret = wm->mach_ops->acc_startup(wm); 424 ret = wm->mach_ops->acc_startup(wm);
425 if (ret < 0) 425 if (ret < 0)
diff --git a/drivers/input/touchscreen/wm9713.c b/drivers/input/touchscreen/wm9713.c
index 238b5132712e..73ec99568f12 100644
--- a/drivers/input/touchscreen/wm9713.c
+++ b/drivers/input/touchscreen/wm9713.c
@@ -431,7 +431,7 @@ static int wm9713_acc_enable(struct wm97xx *wm, int enable)
431 dig3 = wm->dig[2]; 431 dig3 = wm->dig[2];
432 432
433 if (enable) { 433 if (enable) {
434 /* continous mode */ 434 /* continuous mode */
435 if (wm->mach_ops->acc_startup && 435 if (wm->mach_ops->acc_startup &&
436 (ret = wm->mach_ops->acc_startup(wm)) < 0) 436 (ret = wm->mach_ops->acc_startup(wm)) < 0)
437 return ret; 437 return ret;
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c
index 6b75c9f660ae..5dbe73af2f8f 100644
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -335,7 +335,7 @@ static void wm97xx_pen_irq_worker(struct work_struct *work)
335 */ 335 */
336 if (!wm->mach_ops->acc_enabled || wm->mach_ops->acc_pen_down) { 336 if (!wm->mach_ops->acc_enabled || wm->mach_ops->acc_pen_down) {
337 if (wm->pen_is_down && !pen_was_down) { 337 if (wm->pen_is_down && !pen_was_down) {
338 /* Data is not availiable immediately on pen down */ 338 /* Data is not available immediately on pen down */
339 queue_delayed_work(wm->ts_workq, &wm->ts_reader, 1); 339 queue_delayed_work(wm->ts_workq, &wm->ts_reader, 1);
340 } 340 }
341 341
@@ -354,7 +354,7 @@ static void wm97xx_pen_irq_worker(struct work_struct *work)
354 * Codec PENDOWN irq handler 354 * Codec PENDOWN irq handler
355 * 355 *
356 * We have to disable the codec interrupt in the handler because it 356 * We have to disable the codec interrupt in the handler because it
357 * can take upto 1ms to clear the interrupt source. We schedule a task 357 * can take up to 1ms to clear the interrupt source. We schedule a task
358 * in a work queue to do the actual interaction with the chip. The 358 * in a work queue to do the actual interaction with the chip. The
359 * interrupt is then enabled again in the slow handler when the source 359 * interrupt is then enabled again in the slow handler when the source
360 * has been cleared. 360 * has been cleared.
diff --git a/drivers/input/touchscreen/zylonite-wm97xx.c b/drivers/input/touchscreen/zylonite-wm97xx.c
index 048849867643..5b0f15ec874a 100644
--- a/drivers/input/touchscreen/zylonite-wm97xx.c
+++ b/drivers/input/touchscreen/zylonite-wm97xx.c
@@ -193,7 +193,7 @@ static int zylonite_wm97xx_probe(struct platform_device *pdev)
193 gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO26); 193 gpio_touch_irq = mfp_to_gpio(MFP_PIN_GPIO26);
194 194
195 wm->pen_irq = IRQ_GPIO(gpio_touch_irq); 195 wm->pen_irq = IRQ_GPIO(gpio_touch_irq);
196 set_irq_type(IRQ_GPIO(gpio_touch_irq), IRQ_TYPE_EDGE_BOTH); 196 irq_set_irq_type(IRQ_GPIO(gpio_touch_irq), IRQ_TYPE_EDGE_BOTH);
197 197
198 wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN, 198 wm97xx_config_gpio(wm, WM97XX_GPIO_13, WM97XX_GPIO_IN,
199 WM97XX_GPIO_POL_HIGH, 199 WM97XX_GPIO_POL_HIGH,