aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/apm-power.c7
-rw-r--r--drivers/input/evdev.c3
-rw-r--r--drivers/input/joydev.c3
-rw-r--r--drivers/input/keyboard/pxa27x_keypad.c6
-rw-r--r--drivers/input/misc/cobalt_btns.c16
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c1
-rw-r--r--drivers/input/mouse/alps.c5
-rw-r--r--drivers/input/mousedev.c3
-rw-r--r--drivers/input/serio/i8042-snirm.h75
-rw-r--r--drivers/input/serio/i8042-x86ia64io.h7
-rw-r--r--drivers/input/serio/i8042.c3
-rw-r--r--drivers/input/serio/i8042.h2
-rw-r--r--drivers/input/tablet/wacom.h6
-rw-r--r--drivers/input/tablet/wacom_sys.c6
-rw-r--r--drivers/input/tablet/wacom_wac.c31
-rw-r--r--drivers/input/tablet/wacom_wac.h1
-rw-r--r--drivers/input/touchscreen/ads7846.c2
17 files changed, 141 insertions, 36 deletions
diff --git a/drivers/input/apm-power.c b/drivers/input/apm-power.c
index c36d110b349a..7d61a9660806 100644
--- a/drivers/input/apm-power.c
+++ b/drivers/input/apm-power.c
@@ -63,8 +63,6 @@ static int apmpower_connect(struct input_handler *handler,
63 handle->handler = handler; 63 handle->handler = handler;
64 handle->name = "apm-power"; 64 handle->name = "apm-power";
65 65
66 handler->private = handle;
67
68 error = input_register_handle(handle); 66 error = input_register_handle(handle);
69 if (error) { 67 if (error) {
70 printk(KERN_ERR 68 printk(KERN_ERR
@@ -87,11 +85,10 @@ static int apmpower_connect(struct input_handler *handler,
87 return 0; 85 return 0;
88} 86}
89 87
90static void apmpower_disconnect(struct input_handle *handler) 88static void apmpower_disconnect(struct input_handle *handle)
91{ 89{
92 struct input_handle *handle = handler->private;
93
94 input_close_device(handle); 90 input_close_device(handle);
91 input_unregister_handle(handle);
95 kfree(handle); 92 kfree(handle);
96} 93}
97 94
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 0727b0a12557..b32984bc516f 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -124,6 +124,7 @@ static void evdev_free(struct device *dev)
124{ 124{
125 struct evdev *evdev = container_of(dev, struct evdev, dev); 125 struct evdev *evdev = container_of(dev, struct evdev, dev);
126 126
127 input_put_device(evdev->handle.dev);
127 kfree(evdev); 128 kfree(evdev);
128} 129}
129 130
@@ -893,7 +894,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev,
893 evdev->exist = 1; 894 evdev->exist = 1;
894 evdev->minor = minor; 895 evdev->minor = minor;
895 896
896 evdev->handle.dev = dev; 897 evdev->handle.dev = input_get_device(dev);
897 evdev->handle.name = evdev->name; 898 evdev->handle.name = evdev->name;
898 evdev->handle.handler = handler; 899 evdev->handle.handler = handler;
899 evdev->handle.private = evdev; 900 evdev->handle.private = evdev;
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 22b2789ef58a..65d7077a75a1 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -171,6 +171,7 @@ static void joydev_free(struct device *dev)
171{ 171{
172 struct joydev *joydev = container_of(dev, struct joydev, dev); 172 struct joydev *joydev = container_of(dev, struct joydev, dev);
173 173
174 input_put_device(joydev->handle.dev);
174 kfree(joydev); 175 kfree(joydev);
175} 176}
176 177
@@ -750,7 +751,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev,
750 joydev->minor = minor; 751 joydev->minor = minor;
751 752
752 joydev->exist = 1; 753 joydev->exist = 1;
753 joydev->handle.dev = dev; 754 joydev->handle.dev = input_get_device(dev);
754 joydev->handle.name = joydev->name; 755 joydev->handle.name = joydev->name;
755 joydev->handle.handler = handler; 756 joydev->handle.handler = handler;
756 joydev->handle.private = joydev; 757 joydev->handle.private = joydev;
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c
index 6224c2fb3b65..4e651c11c1da 100644
--- a/drivers/input/keyboard/pxa27x_keypad.c
+++ b/drivers/input/keyboard/pxa27x_keypad.c
@@ -50,9 +50,9 @@
50#define KPKDI 0x0048 50#define KPKDI 0x0048
51 51
52/* bit definitions */ 52/* bit definitions */
53#define KPC_MKRN(n) ((((n) & 0x7) - 1) << 26) /* matrix key row number */ 53#define KPC_MKRN(n) ((((n) - 1) & 0x7) << 26) /* matrix key row number */
54#define KPC_MKCN(n) ((((n) & 0x7) - 1) << 23) /* matrix key column number */ 54#define KPC_MKCN(n) ((((n) - 1) & 0x7) << 23) /* matrix key column number */
55#define KPC_DKN(n) ((((n) & 0x7) - 1) << 6) /* direct key number */ 55#define KPC_DKN(n) ((((n) - 1) & 0x7) << 6) /* direct key number */
56 56
57#define KPC_AS (0x1 << 30) /* Automatic Scan bit */ 57#define KPC_AS (0x1 << 30) /* Automatic Scan bit */
58#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */ 58#define KPC_ASACT (0x1 << 29) /* Automatic Scan on Activity */
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 4833b1a82623..5511ef006a66 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Cobalt button interface driver. 2 * Cobalt button interface driver.
3 * 3 *
4 * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 4 * Copyright (C) 2007-2008 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by 7 * it under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/input-polldev.h> 21#include <linux/input-polldev.h>
@@ -55,7 +55,7 @@ static void handle_buttons(struct input_polled_dev *dev)
55 status = ~readl(bdev->reg) >> 24; 55 status = ~readl(bdev->reg) >> 24;
56 56
57 for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) { 57 for (i = 0; i < ARRAY_SIZE(bdev->keymap); i++) {
58 if (status & (1UL << i)) { 58 if (status & (1U << i)) {
59 if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) { 59 if (++bdev->count[i] == BUTTONS_COUNT_THRESHOLD) {
60 input_event(input, EV_MSC, MSC_SCAN, i); 60 input_event(input, EV_MSC, MSC_SCAN, i);
61 input_report_key(input, bdev->keymap[i], 1); 61 input_report_key(input, bdev->keymap[i], 1);
@@ -97,16 +97,16 @@ static int __devinit cobalt_buttons_probe(struct platform_device *pdev)
97 input->name = "Cobalt buttons"; 97 input->name = "Cobalt buttons";
98 input->phys = "cobalt/input0"; 98 input->phys = "cobalt/input0";
99 input->id.bustype = BUS_HOST; 99 input->id.bustype = BUS_HOST;
100 input->cdev.dev = &pdev->dev; 100 input->dev.parent = &pdev->dev;
101 101
102 input->keycode = pdev->keymap; 102 input->keycode = bdev->keymap;
103 input->keycodemax = ARRAY_SIZE(pdev->keymap); 103 input->keycodemax = ARRAY_SIZE(bdev->keymap);
104 input->keycodesize = sizeof(unsigned short); 104 input->keycodesize = sizeof(unsigned short);
105 105
106 input_set_capability(input, EV_MSC, MSC_SCAN); 106 input_set_capability(input, EV_MSC, MSC_SCAN);
107 __set_bit(EV_KEY, input->evbit); 107 __set_bit(EV_KEY, input->evbit);
108 for (i = 0; i < ARRAY_SIZE(buttons_map); i++) 108 for (i = 0; i < ARRAY_SIZE(cobalt_map); i++)
109 __set_bit(input->keycode[i], input->keybit); 109 __set_bit(bdev->keymap[i], input->keybit);
110 __clear_bit(KEY_RESERVED, input->keybit); 110 __clear_bit(KEY_RESERVED, input->keybit);
111 111
112 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 112 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index d2ade7443b7d..798d84c44d03 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -25,6 +25,7 @@
25MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); 25MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
26MODULE_DESCRIPTION("ixp4xx beeper driver"); 26MODULE_DESCRIPTION("ixp4xx beeper driver");
27MODULE_LICENSE("GPL"); 27MODULE_LICENSE("GPL");
28MODULE_ALIAS("platform:ixp4xx-beeper");
28 29
29static DEFINE_SPINLOCK(beep_lock); 30static DEFINE_SPINLOCK(beep_lock);
30 31
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c
index b346a3b418ea..385e32bcf6a6 100644
--- a/drivers/input/mouse/alps.c
+++ b/drivers/input/mouse/alps.c
@@ -116,8 +116,8 @@ static void alps_process_packet(struct psmouse *psmouse)
116 } 116 }
117 117
118 if (priv->i->flags & ALPS_FW_BK_1) { 118 if (priv->i->flags & ALPS_FW_BK_1) {
119 back = packet[2] & 4; 119 back = packet[0] & 0x10;
120 forward = packet[0] & 0x10; 120 forward = packet[2] & 4;
121 } 121 }
122 122
123 if (priv->i->flags & ALPS_FW_BK_2) { 123 if (priv->i->flags & ALPS_FW_BK_2) {
@@ -483,6 +483,7 @@ int alps_init(struct psmouse *psmouse)
483 dev2->id.vendor = 0x0002; 483 dev2->id.vendor = 0x0002;
484 dev2->id.product = PSMOUSE_ALPS; 484 dev2->id.product = PSMOUSE_ALPS;
485 dev2->id.version = 0x0000; 485 dev2->id.version = 0x0000;
486 dev2->dev.parent = &psmouse->ps2dev.serio->dev;
486 487
487 dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL); 488 dev2->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
488 dev2->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y); 489 dev2->relbit[BIT_WORD(REL_X)] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index bbbe5e81adc1..b989748598ae 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -414,6 +414,7 @@ static void mousedev_free(struct device *dev)
414{ 414{
415 struct mousedev *mousedev = container_of(dev, struct mousedev, dev); 415 struct mousedev *mousedev = container_of(dev, struct mousedev, dev);
416 416
417 input_put_device(mousedev->handle.dev);
417 kfree(mousedev); 418 kfree(mousedev);
418} 419}
419 420
@@ -865,7 +866,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev,
865 866
866 mousedev->minor = minor; 867 mousedev->minor = minor;
867 mousedev->exist = 1; 868 mousedev->exist = 1;
868 mousedev->handle.dev = dev; 869 mousedev->handle.dev = input_get_device(dev);
869 mousedev->handle.name = mousedev->name; 870 mousedev->handle.name = mousedev->name;
870 mousedev->handle.handler = handler; 871 mousedev->handle.handler = handler;
871 mousedev->handle.private = mousedev; 872 mousedev->handle.private = mousedev;
diff --git a/drivers/input/serio/i8042-snirm.h b/drivers/input/serio/i8042-snirm.h
new file mode 100644
index 000000000000..409a9341143d
--- /dev/null
+++ b/drivers/input/serio/i8042-snirm.h
@@ -0,0 +1,75 @@
1#ifndef _I8042_SNIRM_H
2#define _I8042_SNIRM_H
3
4#include <asm/sni.h>
5
6/*
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12/*
13 * Names.
14 */
15
16#define I8042_KBD_PHYS_DESC "onboard/serio0"
17#define I8042_AUX_PHYS_DESC "onboard/serio1"
18#define I8042_MUX_PHYS_DESC "onboard/serio%d"
19
20/*
21 * IRQs.
22 */
23static int i8042_kbd_irq;
24static int i8042_aux_irq;
25#define I8042_KBD_IRQ i8042_kbd_irq
26#define I8042_AUX_IRQ i8042_aux_irq
27
28static void __iomem *kbd_iobase;
29
30#define I8042_COMMAND_REG (kbd_iobase + 0x64UL)
31#define I8042_DATA_REG (kbd_iobase + 0x60UL)
32
33static inline int i8042_read_data(void)
34{
35 return readb(kbd_iobase + 0x60UL);
36}
37
38static inline int i8042_read_status(void)
39{
40 return readb(kbd_iobase + 0x64UL);
41}
42
43static inline void i8042_write_data(int val)
44{
45 writeb(val, kbd_iobase + 0x60UL);
46}
47
48static inline void i8042_write_command(int val)
49{
50 writeb(val, kbd_iobase + 0x64UL);
51}
52static inline int i8042_platform_init(void)
53{
54 /* RM200 is strange ... */
55 if (sni_brd_type == SNI_BRD_RM200) {
56 kbd_iobase = ioremap(0x16000000, 4);
57 i8042_kbd_irq = 33;
58 i8042_aux_irq = 44;
59 } else {
60 kbd_iobase = ioremap(0x14000000, 4);
61 i8042_kbd_irq = 1;
62 i8042_aux_irq = 12;
63 }
64 if (!kbd_iobase)
65 return -ENOMEM;
66
67 return 0;
68}
69
70static inline void i8042_platform_exit(void)
71{
72
73}
74
75#endif /* _I8042_SNIRM_H */
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
index 662e84482c26..60931aceb828 100644
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -277,6 +277,13 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
277 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"), 277 DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"),
278 }, 278 },
279 }, 279 },
280 {
281 .ident = "Lenovo 3000 n100",
282 .matches = {
283 DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
284 DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
285 },
286 },
280 { } 287 { }
281}; 288};
282 289
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 2763394869d2..65a74cfc187b 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -1151,7 +1151,6 @@ static int __devinit i8042_setup_kbd(void)
1151static int __devinit i8042_probe(struct platform_device *dev) 1151static int __devinit i8042_probe(struct platform_device *dev)
1152{ 1152{
1153 int error; 1153 int error;
1154 char param;
1155 1154
1156 error = i8042_controller_selftest(); 1155 error = i8042_controller_selftest();
1157 if (error) 1156 if (error)
@@ -1174,7 +1173,7 @@ static int __devinit i8042_probe(struct platform_device *dev)
1174 } 1173 }
1175#ifdef CONFIG_X86 1174#ifdef CONFIG_X86
1176 if (i8042_dritek) { 1175 if (i8042_dritek) {
1177 param = 0x90; 1176 char param = 0x90;
1178 error = i8042_command(&param, 0x1059); 1177 error = i8042_command(&param, 0x1059);
1179 if (error) 1178 if (error)
1180 goto out_fail; 1179 goto out_fail;
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index c972e5d03a3f..cbc1beb66574 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -18,6 +18,8 @@
18#include "i8042-jazzio.h" 18#include "i8042-jazzio.h"
19#elif defined(CONFIG_SGI_HAS_I8042) 19#elif defined(CONFIG_SGI_HAS_I8042)
20#include "i8042-ip22io.h" 20#include "i8042-ip22io.h"
21#elif defined(CONFIG_SNI_RM)
22#include "i8042-snirm.h"
21#elif defined(CONFIG_PPC) 23#elif defined(CONFIG_PPC)
22#include "i8042-ppcio.h" 24#include "i8042-ppcio.h"
23#elif defined(CONFIG_SPARC) 25#elif defined(CONFIG_SPARC)
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h
index 6542edb6f76e..acf9830698cb 100644
--- a/drivers/input/tablet/wacom.h
+++ b/drivers/input/tablet/wacom.h
@@ -11,7 +11,7 @@
11 * Copyright (c) 2000 Daniel Egger <egger@suse.de> 11 * Copyright (c) 2000 Daniel Egger <egger@suse.de>
12 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com> 12 * Copyright (c) 2001 Frederic Lepied <flepied@mandrakesoft.com>
13 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be> 13 * Copyright (c) 2004 Panagiotis Issaris <panagiotis.issaris@mech.kuleuven.ac.be>
14 * Copyright (c) 2002-2007 Ping Cheng <pingc@wacom.com> 14 * Copyright (c) 2002-2008 Ping Cheng <pingc@wacom.com>
15 * 15 *
16 * ChangeLog: 16 * ChangeLog:
17 * v0.1 (vp) - Initial release 17 * v0.1 (vp) - Initial release
@@ -65,6 +65,7 @@
65 * - and wacom_wac.c deals with Wacom specific code 65 * - and wacom_wac.c deals with Wacom specific code
66 * - Support Intuos3 4x6 66 * - Support Intuos3 4x6
67 * v1.47 (pc) - Added support for Bamboo 67 * v1.47 (pc) - Added support for Bamboo
68 * v1.48 (pc) - Added support for Bamboo1, BambooFun, and Cintiq 12WX
68 */ 69 */
69 70
70/* 71/*
@@ -85,7 +86,7 @@
85/* 86/*
86 * Version Information 87 * Version Information
87 */ 88 */
88#define DRIVER_VERSION "v1.47" 89#define DRIVER_VERSION "v1.48"
89#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>" 90#define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@ucw.cz>"
90#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver" 91#define DRIVER_DESC "USB Wacom Graphire and Wacom Intuos tablet driver"
91#define DRIVER_LICENSE "GPL" 92#define DRIVER_LICENSE "GPL"
@@ -125,6 +126,7 @@ extern void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac
125extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 126extern void input_dev_pl(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
126extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 127extern void input_dev_pt(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
127extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac); 128extern void input_dev_mo(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
129extern void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac);
128extern __u16 wacom_le16_to_cpu(unsigned char *data); 130extern __u16 wacom_le16_to_cpu(unsigned char *data);
129extern __u16 wacom_be16_to_cpu(unsigned char *data); 131extern __u16 wacom_be16_to_cpu(unsigned char *data);
130extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id); 132extern struct wacom_features * get_wacom_feature(const struct usb_device_id *id);
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index d64b1ea136b3..41caaef8e2d7 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -171,6 +171,7 @@ void input_dev_i3s(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
171 input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) | 171 input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_0) |
172 BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3); 172 BIT_MASK(BTN_1) | BIT_MASK(BTN_2) | BIT_MASK(BTN_3);
173 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 173 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
174 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
174} 175}
175 176
176void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 177void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
@@ -180,6 +181,11 @@ void input_dev_i3(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
180 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0); 181 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
181} 182}
182 183
184void input_dev_bee(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
185{
186 input_dev->keybit[BIT_WORD(BTN_LEFT)] |= BIT_MASK(BTN_8) | BIT_MASK(BTN_9);
187}
188
183void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac) 189void input_dev_i(struct input_dev *input_dev, struct wacom_wac *wacom_wac)
184{ 190{
185 input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL); 191 input_dev->evbit[0] |= BIT_MASK(EV_MSC) | BIT_MASK(EV_REL);
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index fc03ba256f4c..ffe33842143f 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -163,7 +163,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
163 } 163 }
164 164
165 id = STYLUS_DEVICE_ID; 165 id = STYLUS_DEVICE_ID;
166 if (data[1] & 0x80) { /* in prox */ 166 if ((data[1] & 0x80) && ((data[1] & 0x07) || data[2] || data[3] || data[4]
167 || data[5] || data[6] || (data[7] & 0x07))) {
168 /* in prox and not a pad data */
167 169
168 switch ((data[1] >> 5) & 3) { 170 switch ((data[1] >> 5) & 3) {
169 171
@@ -233,7 +235,6 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
233 if (data[7] & 0xf8) { 235 if (data[7] & 0xf8) {
234 wacom_input_sync(wcombo); /* sync last event */ 236 wacom_input_sync(wcombo); /* sync last event */
235 wacom->id[1] = 1; 237 wacom->id[1] = 1;
236 wacom->serial[1] = (data[7] & 0xf8);
237 wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); 238 wacom_report_key(wcombo, BTN_0, (data[7] & 0x40));
238 wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); 239 wacom_report_key(wcombo, BTN_4, (data[7] & 0x80));
239 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3); 240 rw = ((data[7] & 0x18) >> 3) - ((data[7] & 0x20) >> 3);
@@ -252,10 +253,9 @@ static int wacom_graphire_irq(struct wacom_wac *wacom, void *wcombo)
252 } 253 }
253 break; 254 break;
254 case WACOM_MO: 255 case WACOM_MO:
255 if ((data[7] & 0xf8) || (data[8] & 0x80)) { 256 if ((data[7] & 0xf8) || (data[8] & 0xff)) {
256 wacom_input_sync(wcombo); /* sync last event */ 257 wacom_input_sync(wcombo); /* sync last event */
257 wacom->id[1] = 1; 258 wacom->id[1] = 1;
258 wacom->serial[1] = (data[7] & 0xf8);
259 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); 259 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08));
260 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); 260 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20));
261 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); 261 wacom_report_key(wcombo, BTN_4, (data[7] & 0x10));
@@ -434,10 +434,12 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
434 wacom_report_key(wcombo, BTN_5, (data[6] & 0x02)); 434 wacom_report_key(wcombo, BTN_5, (data[6] & 0x02));
435 wacom_report_key(wcombo, BTN_6, (data[6] & 0x04)); 435 wacom_report_key(wcombo, BTN_6, (data[6] & 0x04));
436 wacom_report_key(wcombo, BTN_7, (data[6] & 0x08)); 436 wacom_report_key(wcombo, BTN_7, (data[6] & 0x08));
437 wacom_report_key(wcombo, BTN_8, (data[5] & 0x10));
438 wacom_report_key(wcombo, BTN_9, (data[6] & 0x10));
437 wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]); 439 wacom_report_abs(wcombo, ABS_RX, ((data[1] & 0x1f) << 8) | data[2]);
438 wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]); 440 wacom_report_abs(wcombo, ABS_RY, ((data[3] & 0x1f) << 8) | data[4]);
439 441
440 if((data[5] & 0x0f) | (data[6] & 0x0f) | (data[1] & 0x1f) | 442 if ((data[5] & 0x1f) | (data[6] & 0x1f) | (data[1] & 0x1f) |
441 data[2] | (data[3] & 0x1f) | data[4]) 443 data[2] | (data[3] & 0x1f) | data[4])
442 wacom_report_key(wcombo, wacom->tool[1], 1); 444 wacom_report_key(wcombo, wacom->tool[1], 1);
443 else 445 else
@@ -481,13 +483,11 @@ static int wacom_intuos_irq(struct wacom_wac *wacom, void *wcombo)
481 if (data[1] & 0x02) { 483 if (data[1] & 0x02) {
482 /* Rotation packet */ 484 /* Rotation packet */
483 if (wacom->features->type >= INTUOS3S) { 485 if (wacom->features->type >= INTUOS3S) {
484 /* I3 marker pen rotation reported as wheel 486 /* I3 marker pen rotation */
485 * due to valuator limitation
486 */
487 t = (data[6] << 3) | ((data[7] >> 5) & 7); 487 t = (data[6] << 3) | ((data[7] >> 5) & 7);
488 t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) : 488 t = (data[7] & 0x20) ? ((t > 900) ? ((t-1) / 2 - 1350) :
489 ((t-1) / 2 + 450)) : (450 - t / 2) ; 489 ((t-1) / 2 + 450)) : (450 - t / 2) ;
490 wacom_report_abs(wcombo, ABS_WHEEL, t); 490 wacom_report_abs(wcombo, ABS_Z, t);
491 } else { 491 } else {
492 /* 4D mouse rotation packet */ 492 /* 4D mouse rotation packet */
493 t = (data[6] << 3) | ((data[7] >> 5) & 7); 493 t = (data[6] << 3) | ((data[7] >> 5) & 7);
@@ -558,6 +558,7 @@ int wacom_wac_irq(struct wacom_wac *wacom_wac, void *wcombo)
558 case INTUOS3: 558 case INTUOS3:
559 case INTUOS3L: 559 case INTUOS3L:
560 case CINTIQ: 560 case CINTIQ:
561 case WACOM_BEE:
561 return (wacom_intuos_irq(wacom_wac, wcombo)); 562 return (wacom_intuos_irq(wacom_wac, wcombo));
562 break; 563 break;
563 default: 564 default:
@@ -577,6 +578,8 @@ void wacom_init_input_dev(struct input_dev *input_dev, struct wacom_wac *wacom_w
577 case GRAPHIRE: 578 case GRAPHIRE:
578 input_dev_g(input_dev, wacom_wac); 579 input_dev_g(input_dev, wacom_wac);
579 break; 580 break;
581 case WACOM_BEE:
582 input_dev_bee(input_dev, wacom_wac);
580 case INTUOS3: 583 case INTUOS3:
581 case INTUOS3L: 584 case INTUOS3L:
582 case CINTIQ: 585 case CINTIQ:
@@ -607,12 +610,15 @@ static struct wacom_features wacom_features[] = {
607 { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE }, 610 { "Wacom Graphire3 6x8", 8, 16704, 12064, 511, 63, GRAPHIRE },
608 { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4 }, 611 { "Wacom Graphire4 4x5", 8, 10208, 7424, 511, 63, WACOM_G4 },
609 { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 }, 612 { "Wacom Graphire4 6x8", 8, 16704, 12064, 511, 63, WACOM_G4 },
613 { "Wacom BambooFun 4x5", 9, 14760, 9225, 511, 63, WACOM_MO },
614 { "Wacom BambooFun 6x8", 9, 21648, 13530, 511, 63, WACOM_MO },
610 { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE }, 615 { "Wacom Volito", 8, 5104, 3712, 511, 63, GRAPHIRE },
611 { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE }, 616 { "Wacom PenStation2", 8, 3250, 2320, 255, 63, GRAPHIRE },
612 { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE }, 617 { "Wacom Volito2 4x5", 8, 5104, 3712, 511, 63, GRAPHIRE },
613 { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE }, 618 { "Wacom Volito2 2x3", 8, 3248, 2320, 511, 63, GRAPHIRE },
614 { "Wacom PenPartner2", 8, 3250, 2320, 255, 63, GRAPHIRE }, 619 { "Wacom PenPartner2", 8, 3250, 2320, 511, 63, GRAPHIRE },
615 { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO }, 620 { "Wacom Bamboo", 9, 14760, 9225, 511, 63, WACOM_MO },
621 { "Wacom Bamboo1", 8, 5104, 3712, 511, 63, GRAPHIRE },
616 { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS }, 622 { "Wacom Intuos 4x5", 10, 12700, 10600, 1023, 31, INTUOS },
617 { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, 623 { "Wacom Intuos 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
618 { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS }, 624 { "Wacom Intuos 9x12", 10, 30480, 24060, 1023, 31, INTUOS },
@@ -643,6 +649,7 @@ static struct wacom_features wacom_features[] = {
643 { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3 }, 649 { "Wacom Intuos3 6x11", 10, 54204, 31750, 1023, 63, INTUOS3 },
644 { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S }, 650 { "Wacom Intuos3 4x6", 10, 31496, 19685, 1023, 63, INTUOS3S },
645 { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ }, 651 { "Wacom Cintiq 21UX", 10, 87200, 65600, 1023, 63, CINTIQ },
652 { "Wacom Cintiq 12WX", 10, 53020, 33440, 1023, 63, WACOM_BEE },
646 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS }, 653 { "Wacom Intuos2 6x8", 10, 20320, 16240, 1023, 31, INTUOS },
647 { } 654 { }
648}; 655};
@@ -656,12 +663,15 @@ static struct usb_device_id wacom_ids[] = {
656 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) }, 663 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x14) },
657 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) }, 664 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x15) },
658 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) }, 665 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x16) },
666 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x17) },
667 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x18) },
659 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) }, 668 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x60) },
660 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) }, 669 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x61) },
661 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) }, 670 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x62) },
662 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) }, 671 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x63) },
663 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) }, 672 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x64) },
664 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) }, 673 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x65) },
674 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x69) },
665 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) }, 675 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x20) },
666 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) }, 676 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x21) },
667 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) }, 677 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x22) },
@@ -692,6 +702,7 @@ static struct usb_device_id wacom_ids[] = {
692 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) }, 702 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB5) },
693 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) }, 703 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xB7) },
694 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) }, 704 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x3F) },
705 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0xC6) },
695 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) }, 706 { USB_DEVICE(USB_VENDOR_ID_WACOM, 0x47) },
696 { } 707 { }
697}; 708};
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index a302e229bb8a..3342bc05847d 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -25,6 +25,7 @@ enum {
25 INTUOS3, 25 INTUOS3,
26 INTUOS3L, 26 INTUOS3L,
27 CINTIQ, 27 CINTIQ,
28 WACOM_BEE,
28 WACOM_MO, 29 WACOM_MO,
29 MAX_TYPE 30 MAX_TYPE
30}; 31};
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 58934a40f5ce..57a1c28bf122 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -213,7 +213,7 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
213 struct ads7846 *ts = dev_get_drvdata(dev); 213 struct ads7846 *ts = dev_get_drvdata(dev);
214 struct ser_req *req = kzalloc(sizeof *req, GFP_KERNEL); 214 struct ser_req *req = kzalloc(sizeof *req, GFP_KERNEL);
215 int status; 215 int status;
216 int sample; 216 int uninitialized_var(sample);
217 int use_internal; 217 int use_internal;
218 218
219 if (!req) 219 if (!req)