diff options
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/evdev.c | 113 | ||||
-rw-r--r-- | drivers/input/input.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/turbografx.c | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/Kconfig | 16 | ||||
-rw-r--r-- | drivers/input/keyboard/Makefile | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/gpio_keys_polled.c | 261 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.h | 3 | ||||
-rw-r--r-- | drivers/input/tablet/aiptek.c | 28 | ||||
-rw-r--r-- | drivers/input/tablet/wacom.h | 1 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 19 | ||||
-rw-r--r-- | drivers/input/touchscreen/usbtouchscreen.c | 1 |
11 files changed, 375 insertions, 71 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index f8635b7b4295..c8471a2552e7 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
@@ -535,76 +535,73 @@ static int handle_eviocgbit(struct input_dev *dev, | |||
535 | } | 535 | } |
536 | #undef OLD_KEY_MAX | 536 | #undef OLD_KEY_MAX |
537 | 537 | ||
538 | static int evdev_handle_get_keycode(struct input_dev *dev, | 538 | static int evdev_handle_get_keycode(struct input_dev *dev, void __user *p) |
539 | void __user *p, size_t size) | ||
540 | { | 539 | { |
541 | struct input_keymap_entry ke; | 540 | struct input_keymap_entry ke = { |
541 | .len = sizeof(unsigned int), | ||
542 | .flags = 0, | ||
543 | }; | ||
544 | int __user *ip = (int __user *)p; | ||
542 | int error; | 545 | int error; |
543 | 546 | ||
544 | memset(&ke, 0, sizeof(ke)); | 547 | /* legacy case */ |
545 | 548 | if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) | |
546 | if (size == sizeof(unsigned int[2])) { | 549 | return -EFAULT; |
547 | /* legacy case */ | ||
548 | int __user *ip = (int __user *)p; | ||
549 | 550 | ||
550 | if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) | 551 | error = input_get_keycode(dev, &ke); |
551 | return -EFAULT; | 552 | if (error) |
553 | return error; | ||
552 | 554 | ||
553 | ke.len = sizeof(unsigned int); | 555 | if (put_user(ke.keycode, ip + 1)) |
554 | ke.flags = 0; | 556 | return -EFAULT; |
555 | 557 | ||
556 | error = input_get_keycode(dev, &ke); | 558 | return 0; |
557 | if (error) | 559 | } |
558 | return error; | ||
559 | 560 | ||
560 | if (put_user(ke.keycode, ip + 1)) | 561 | static int evdev_handle_get_keycode_v2(struct input_dev *dev, void __user *p) |
561 | return -EFAULT; | 562 | { |
563 | struct input_keymap_entry ke; | ||
564 | int error; | ||
562 | 565 | ||
563 | } else { | 566 | if (copy_from_user(&ke, p, sizeof(ke))) |
564 | size = min(size, sizeof(ke)); | 567 | return -EFAULT; |
565 | 568 | ||
566 | if (copy_from_user(&ke, p, size)) | 569 | error = input_get_keycode(dev, &ke); |
567 | return -EFAULT; | 570 | if (error) |
571 | return error; | ||
568 | 572 | ||
569 | error = input_get_keycode(dev, &ke); | 573 | if (copy_to_user(p, &ke, sizeof(ke))) |
570 | if (error) | 574 | return -EFAULT; |
571 | return error; | ||
572 | 575 | ||
573 | if (copy_to_user(p, &ke, size)) | ||
574 | return -EFAULT; | ||
575 | } | ||
576 | return 0; | 576 | return 0; |
577 | } | 577 | } |
578 | 578 | ||
579 | static int evdev_handle_set_keycode(struct input_dev *dev, | 579 | static int evdev_handle_set_keycode(struct input_dev *dev, void __user *p) |
580 | void __user *p, size_t size) | ||
581 | { | 580 | { |
582 | struct input_keymap_entry ke; | 581 | struct input_keymap_entry ke = { |
583 | 582 | .len = sizeof(unsigned int), | |
584 | memset(&ke, 0, sizeof(ke)); | 583 | .flags = 0, |
584 | }; | ||
585 | int __user *ip = (int __user *)p; | ||
585 | 586 | ||
586 | if (size == sizeof(unsigned int[2])) { | 587 | if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) |
587 | /* legacy case */ | 588 | return -EFAULT; |
588 | int __user *ip = (int __user *)p; | ||
589 | 589 | ||
590 | if (copy_from_user(ke.scancode, p, sizeof(unsigned int))) | 590 | if (get_user(ke.keycode, ip + 1)) |
591 | return -EFAULT; | 591 | return -EFAULT; |
592 | 592 | ||
593 | if (get_user(ke.keycode, ip + 1)) | 593 | return input_set_keycode(dev, &ke); |
594 | return -EFAULT; | 594 | } |
595 | 595 | ||
596 | ke.len = sizeof(unsigned int); | 596 | static int evdev_handle_set_keycode_v2(struct input_dev *dev, void __user *p) |
597 | ke.flags = 0; | 597 | { |
598 | struct input_keymap_entry ke; | ||
598 | 599 | ||
599 | } else { | 600 | if (copy_from_user(&ke, p, sizeof(ke))) |
600 | size = min(size, sizeof(ke)); | 601 | return -EFAULT; |
601 | 602 | ||
602 | if (copy_from_user(&ke, p, size)) | 603 | if (ke.len > sizeof(ke.scancode)) |
603 | return -EFAULT; | 604 | return -EINVAL; |
604 | |||
605 | if (ke.len > sizeof(ke.scancode)) | ||
606 | return -EINVAL; | ||
607 | } | ||
608 | 605 | ||
609 | return input_set_keycode(dev, &ke); | 606 | return input_set_keycode(dev, &ke); |
610 | } | 607 | } |
@@ -670,6 +667,18 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
670 | return evdev_grab(evdev, client); | 667 | return evdev_grab(evdev, client); |
671 | else | 668 | else |
672 | return evdev_ungrab(evdev, client); | 669 | return evdev_ungrab(evdev, client); |
670 | |||
671 | case EVIOCGKEYCODE: | ||
672 | return evdev_handle_get_keycode(dev, p); | ||
673 | |||
674 | case EVIOCSKEYCODE: | ||
675 | return evdev_handle_set_keycode(dev, p); | ||
676 | |||
677 | case EVIOCGKEYCODE_V2: | ||
678 | return evdev_handle_get_keycode_v2(dev, p); | ||
679 | |||
680 | case EVIOCSKEYCODE_V2: | ||
681 | return evdev_handle_set_keycode_v2(dev, p); | ||
673 | } | 682 | } |
674 | 683 | ||
675 | size = _IOC_SIZE(cmd); | 684 | size = _IOC_SIZE(cmd); |
@@ -713,12 +722,6 @@ static long evdev_do_ioctl(struct file *file, unsigned int cmd, | |||
713 | return -EFAULT; | 722 | return -EFAULT; |
714 | 723 | ||
715 | return error; | 724 | return error; |
716 | |||
717 | case EVIOC_MASK_SIZE(EVIOCGKEYCODE): | ||
718 | return evdev_handle_get_keycode(dev, p, size); | ||
719 | |||
720 | case EVIOC_MASK_SIZE(EVIOCSKEYCODE): | ||
721 | return evdev_handle_set_keycode(dev, p, size); | ||
722 | } | 725 | } |
723 | 726 | ||
724 | /* Multi-number variable-length handlers */ | 727 | /* Multi-number variable-length handlers */ |
diff --git a/drivers/input/input.c b/drivers/input/input.c index 9408dba2cd31..f37da09a5e4c 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -755,7 +755,7 @@ static int input_default_setkeycode(struct input_dev *dev, | |||
755 | if (index >= dev->keycodemax) | 755 | if (index >= dev->keycodemax) |
756 | return -EINVAL; | 756 | return -EINVAL; |
757 | 757 | ||
758 | if (dev->keycodesize < sizeof(dev->keycode) && | 758 | if (dev->keycodesize < sizeof(ke->keycode) && |
759 | (ke->keycode >> (dev->keycodesize * 8))) | 759 | (ke->keycode >> (dev->keycodesize * 8))) |
760 | return -EINVAL; | 760 | return -EINVAL; |
761 | 761 | ||
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index d53b9e900234..27b6a3ce18ca 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c | |||
@@ -245,6 +245,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) | |||
245 | goto err_free_tgfx; | 245 | goto err_free_tgfx; |
246 | } | 246 | } |
247 | 247 | ||
248 | parport_put_port(pp); | ||
248 | return tgfx; | 249 | return tgfx; |
249 | 250 | ||
250 | err_free_dev: | 251 | err_free_dev: |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index a378e959368e..e98beae23cfd 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
@@ -179,6 +179,22 @@ config KEYBOARD_GPIO | |||
179 | To compile this driver as a module, choose M here: the | 179 | To compile this driver as a module, choose M here: the |
180 | module will be called gpio_keys. | 180 | module will be called gpio_keys. |
181 | 181 | ||
182 | config KEYBOARD_GPIO_POLLED | ||
183 | tristate "Polled GPIO buttons" | ||
184 | depends on GENERIC_GPIO | ||
185 | select INPUT_POLLDEV | ||
186 | help | ||
187 | This driver implements support for buttons connected | ||
188 | to GPIO pins that are not capable of generating interrupts. | ||
189 | |||
190 | Say Y here if your device has buttons connected | ||
191 | directly to such GPIO pins. Your board-specific | ||
192 | setup logic must also provide a platform device, | ||
193 | with configuration data saying which GPIOs are used. | ||
194 | |||
195 | To compile this driver as a module, choose M here: the | ||
196 | module will be called gpio_keys_polled. | ||
197 | |||
182 | config KEYBOARD_TCA6416 | 198 | config KEYBOARD_TCA6416 |
183 | tristate "TCA6416/TCA6408A Keypad Support" | 199 | tristate "TCA6416/TCA6408A Keypad Support" |
184 | depends on I2C | 200 | depends on I2C |
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index 8449c730892c..fde89e0dd465 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile | |||
@@ -14,6 +14,7 @@ obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o | |||
14 | obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o | 14 | obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o |
15 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o | 15 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o |
16 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o | 16 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o |
17 | obj-$(CONFIG_KEYBOARD_GPIO_POLLED) += gpio_keys_polled.o | ||
17 | obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o | 18 | obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o |
18 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o | 19 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o |
19 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o | 20 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o |
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c new file mode 100644 index 000000000000..4c17aff20657 --- /dev/null +++ b/drivers/input/keyboard/gpio_keys_polled.c | |||
@@ -0,0 +1,261 @@ | |||
1 | /* | ||
2 | * Driver for buttons on GPIO lines not capable of generating interrupts | ||
3 | * | ||
4 | * Copyright (C) 2007-2010 Gabor Juhos <juhosg@openwrt.org> | ||
5 | * Copyright (C) 2010 Nuno Goncalves <nunojpg@gmail.com> | ||
6 | * | ||
7 | * This file was based on: /drivers/input/misc/cobalt_btns.c | ||
8 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
9 | * | ||
10 | * also was based on: /drivers/input/keyboard/gpio_keys.c | ||
11 | * Copyright 2005 Phil Blundell | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify | ||
14 | * it under the terms of the GNU General Public License version 2 as | ||
15 | * published by the Free Software Foundation. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/module.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/slab.h> | ||
22 | #include <linux/input.h> | ||
23 | #include <linux/input-polldev.h> | ||
24 | #include <linux/ioport.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/gpio.h> | ||
27 | #include <linux/gpio_keys.h> | ||
28 | |||
29 | #define DRV_NAME "gpio-keys-polled" | ||
30 | |||
31 | struct gpio_keys_button_data { | ||
32 | int last_state; | ||
33 | int count; | ||
34 | int threshold; | ||
35 | int can_sleep; | ||
36 | }; | ||
37 | |||
38 | struct gpio_keys_polled_dev { | ||
39 | struct input_polled_dev *poll_dev; | ||
40 | struct device *dev; | ||
41 | struct gpio_keys_platform_data *pdata; | ||
42 | struct gpio_keys_button_data data[0]; | ||
43 | }; | ||
44 | |||
45 | static void gpio_keys_polled_check_state(struct input_dev *input, | ||
46 | struct gpio_keys_button *button, | ||
47 | struct gpio_keys_button_data *bdata) | ||
48 | { | ||
49 | int state; | ||
50 | |||
51 | if (bdata->can_sleep) | ||
52 | state = !!gpio_get_value_cansleep(button->gpio); | ||
53 | else | ||
54 | state = !!gpio_get_value(button->gpio); | ||
55 | |||
56 | if (state != bdata->last_state) { | ||
57 | unsigned int type = button->type ?: EV_KEY; | ||
58 | |||
59 | input_event(input, type, button->code, | ||
60 | !!(state ^ button->active_low)); | ||
61 | input_sync(input); | ||
62 | bdata->count = 0; | ||
63 | bdata->last_state = state; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | static void gpio_keys_polled_poll(struct input_polled_dev *dev) | ||
68 | { | ||
69 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
70 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
71 | struct input_dev *input = dev->input; | ||
72 | int i; | ||
73 | |||
74 | for (i = 0; i < bdev->pdata->nbuttons; i++) { | ||
75 | struct gpio_keys_button_data *bdata = &bdev->data[i]; | ||
76 | |||
77 | if (bdata->count < bdata->threshold) | ||
78 | bdata->count++; | ||
79 | else | ||
80 | gpio_keys_polled_check_state(input, &pdata->buttons[i], | ||
81 | bdata); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | static void gpio_keys_polled_open(struct input_polled_dev *dev) | ||
86 | { | ||
87 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
88 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
89 | |||
90 | if (pdata->enable) | ||
91 | pdata->enable(bdev->dev); | ||
92 | } | ||
93 | |||
94 | static void gpio_keys_polled_close(struct input_polled_dev *dev) | ||
95 | { | ||
96 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
97 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
98 | |||
99 | if (pdata->disable) | ||
100 | pdata->disable(bdev->dev); | ||
101 | } | ||
102 | |||
103 | static int __devinit gpio_keys_polled_probe(struct platform_device *pdev) | ||
104 | { | ||
105 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | ||
106 | struct device *dev = &pdev->dev; | ||
107 | struct gpio_keys_polled_dev *bdev; | ||
108 | struct input_polled_dev *poll_dev; | ||
109 | struct input_dev *input; | ||
110 | int error; | ||
111 | int i; | ||
112 | |||
113 | if (!pdata || !pdata->poll_interval) | ||
114 | return -EINVAL; | ||
115 | |||
116 | bdev = kzalloc(sizeof(struct gpio_keys_polled_dev) + | ||
117 | pdata->nbuttons * sizeof(struct gpio_keys_button_data), | ||
118 | GFP_KERNEL); | ||
119 | if (!bdev) { | ||
120 | dev_err(dev, "no memory for private data\n"); | ||
121 | return -ENOMEM; | ||
122 | } | ||
123 | |||
124 | poll_dev = input_allocate_polled_device(); | ||
125 | if (!poll_dev) { | ||
126 | dev_err(dev, "no memory for polled device\n"); | ||
127 | error = -ENOMEM; | ||
128 | goto err_free_bdev; | ||
129 | } | ||
130 | |||
131 | poll_dev->private = bdev; | ||
132 | poll_dev->poll = gpio_keys_polled_poll; | ||
133 | poll_dev->poll_interval = pdata->poll_interval; | ||
134 | poll_dev->open = gpio_keys_polled_open; | ||
135 | poll_dev->close = gpio_keys_polled_close; | ||
136 | |||
137 | input = poll_dev->input; | ||
138 | |||
139 | input->evbit[0] = BIT(EV_KEY); | ||
140 | input->name = pdev->name; | ||
141 | input->phys = DRV_NAME"/input0"; | ||
142 | input->dev.parent = &pdev->dev; | ||
143 | |||
144 | input->id.bustype = BUS_HOST; | ||
145 | input->id.vendor = 0x0001; | ||
146 | input->id.product = 0x0001; | ||
147 | input->id.version = 0x0100; | ||
148 | |||
149 | for (i = 0; i < pdata->nbuttons; i++) { | ||
150 | struct gpio_keys_button *button = &pdata->buttons[i]; | ||
151 | struct gpio_keys_button_data *bdata = &bdev->data[i]; | ||
152 | unsigned int gpio = button->gpio; | ||
153 | unsigned int type = button->type ?: EV_KEY; | ||
154 | |||
155 | if (button->wakeup) { | ||
156 | dev_err(dev, DRV_NAME " does not support wakeup\n"); | ||
157 | error = -EINVAL; | ||
158 | goto err_free_gpio; | ||
159 | } | ||
160 | |||
161 | error = gpio_request(gpio, | ||
162 | button->desc ? button->desc : DRV_NAME); | ||
163 | if (error) { | ||
164 | dev_err(dev, "unable to claim gpio %u, err=%d\n", | ||
165 | gpio, error); | ||
166 | goto err_free_gpio; | ||
167 | } | ||
168 | |||
169 | error = gpio_direction_input(gpio); | ||
170 | if (error) { | ||
171 | dev_err(dev, | ||
172 | "unable to set direction on gpio %u, err=%d\n", | ||
173 | gpio, error); | ||
174 | goto err_free_gpio; | ||
175 | } | ||
176 | |||
177 | bdata->can_sleep = gpio_cansleep(gpio); | ||
178 | bdata->last_state = -1; | ||
179 | bdata->threshold = DIV_ROUND_UP(button->debounce_interval, | ||
180 | pdata->poll_interval); | ||
181 | |||
182 | input_set_capability(input, type, button->code); | ||
183 | } | ||
184 | |||
185 | bdev->poll_dev = poll_dev; | ||
186 | bdev->dev = dev; | ||
187 | bdev->pdata = pdata; | ||
188 | platform_set_drvdata(pdev, bdev); | ||
189 | |||
190 | error = input_register_polled_device(poll_dev); | ||
191 | if (error) { | ||
192 | dev_err(dev, "unable to register polled device, err=%d\n", | ||
193 | error); | ||
194 | goto err_free_gpio; | ||
195 | } | ||
196 | |||
197 | /* report initial state of the buttons */ | ||
198 | for (i = 0; i < pdata->nbuttons; i++) | ||
199 | gpio_keys_polled_check_state(input, &pdata->buttons[i], | ||
200 | &bdev->data[i]); | ||
201 | |||
202 | return 0; | ||
203 | |||
204 | err_free_gpio: | ||
205 | while (--i >= 0) | ||
206 | gpio_free(pdata->buttons[i].gpio); | ||
207 | |||
208 | input_free_polled_device(poll_dev); | ||
209 | |||
210 | err_free_bdev: | ||
211 | kfree(bdev); | ||
212 | |||
213 | platform_set_drvdata(pdev, NULL); | ||
214 | return error; | ||
215 | } | ||
216 | |||
217 | static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) | ||
218 | { | ||
219 | struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev); | ||
220 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
221 | int i; | ||
222 | |||
223 | input_unregister_polled_device(bdev->poll_dev); | ||
224 | |||
225 | for (i = 0; i < pdata->nbuttons; i++) | ||
226 | gpio_free(pdata->buttons[i].gpio); | ||
227 | |||
228 | input_free_polled_device(bdev->poll_dev); | ||
229 | |||
230 | kfree(bdev); | ||
231 | platform_set_drvdata(pdev, NULL); | ||
232 | |||
233 | return 0; | ||
234 | } | ||
235 | |||
236 | static struct platform_driver gpio_keys_polled_driver = { | ||
237 | .probe = gpio_keys_polled_probe, | ||
238 | .remove = __devexit_p(gpio_keys_polled_remove), | ||
239 | .driver = { | ||
240 | .name = DRV_NAME, | ||
241 | .owner = THIS_MODULE, | ||
242 | }, | ||
243 | }; | ||
244 | |||
245 | static int __init gpio_keys_polled_init(void) | ||
246 | { | ||
247 | return platform_driver_register(&gpio_keys_polled_driver); | ||
248 | } | ||
249 | |||
250 | static void __exit gpio_keys_polled_exit(void) | ||
251 | { | ||
252 | platform_driver_unregister(&gpio_keys_polled_driver); | ||
253 | } | ||
254 | |||
255 | module_init(gpio_keys_polled_init); | ||
256 | module_exit(gpio_keys_polled_exit); | ||
257 | |||
258 | MODULE_LICENSE("GPL v2"); | ||
259 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>"); | ||
260 | MODULE_DESCRIPTION("Polled GPIO Buttons driver"); | ||
261 | MODULE_ALIAS("platform:" DRV_NAME); | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 50e20e9da442..25e5d042a72c 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
@@ -51,7 +51,8 @@ | |||
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 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100) | 54 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ |
55 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | ||
55 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) | 56 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) |
56 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) | 57 | #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) |
57 | 58 | ||
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index 57b25b84d1fc..0a619c558bfb 100644 --- a/drivers/input/tablet/aiptek.c +++ b/drivers/input/tablet/aiptek.c | |||
@@ -1097,7 +1097,7 @@ store_tabletPointerMode(struct device *dev, struct device_attribute *attr, const | |||
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | static DEVICE_ATTR(pointer_mode, | 1099 | static DEVICE_ATTR(pointer_mode, |
1100 | S_IRUGO | S_IWUGO, | 1100 | S_IRUGO | S_IWUSR, |
1101 | show_tabletPointerMode, store_tabletPointerMode); | 1101 | show_tabletPointerMode, store_tabletPointerMode); |
1102 | 1102 | ||
1103 | /*********************************************************************** | 1103 | /*********************************************************************** |
@@ -1134,7 +1134,7 @@ store_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, co | |||
1134 | } | 1134 | } |
1135 | 1135 | ||
1136 | static DEVICE_ATTR(coordinate_mode, | 1136 | static DEVICE_ATTR(coordinate_mode, |
1137 | S_IRUGO | S_IWUGO, | 1137 | S_IRUGO | S_IWUSR, |
1138 | show_tabletCoordinateMode, store_tabletCoordinateMode); | 1138 | show_tabletCoordinateMode, store_tabletCoordinateMode); |
1139 | 1139 | ||
1140 | /*********************************************************************** | 1140 | /*********************************************************************** |
@@ -1176,7 +1176,7 @@ store_tabletToolMode(struct device *dev, struct device_attribute *attr, const ch | |||
1176 | } | 1176 | } |
1177 | 1177 | ||
1178 | static DEVICE_ATTR(tool_mode, | 1178 | static DEVICE_ATTR(tool_mode, |
1179 | S_IRUGO | S_IWUGO, | 1179 | S_IRUGO | S_IWUSR, |
1180 | show_tabletToolMode, store_tabletToolMode); | 1180 | show_tabletToolMode, store_tabletToolMode); |
1181 | 1181 | ||
1182 | /*********************************************************************** | 1182 | /*********************************************************************** |
@@ -1219,7 +1219,7 @@ store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char | |||
1219 | } | 1219 | } |
1220 | 1220 | ||
1221 | static DEVICE_ATTR(xtilt, | 1221 | static DEVICE_ATTR(xtilt, |
1222 | S_IRUGO | S_IWUGO, show_tabletXtilt, store_tabletXtilt); | 1222 | S_IRUGO | S_IWUSR, show_tabletXtilt, store_tabletXtilt); |
1223 | 1223 | ||
1224 | /*********************************************************************** | 1224 | /*********************************************************************** |
1225 | * support routines for the 'ytilt' file. Note that this file | 1225 | * support routines for the 'ytilt' file. Note that this file |
@@ -1261,7 +1261,7 @@ store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char | |||
1261 | } | 1261 | } |
1262 | 1262 | ||
1263 | static DEVICE_ATTR(ytilt, | 1263 | static DEVICE_ATTR(ytilt, |
1264 | S_IRUGO | S_IWUGO, show_tabletYtilt, store_tabletYtilt); | 1264 | S_IRUGO | S_IWUSR, show_tabletYtilt, store_tabletYtilt); |
1265 | 1265 | ||
1266 | /*********************************************************************** | 1266 | /*********************************************************************** |
1267 | * support routines for the 'jitter' file. Note that this file | 1267 | * support routines for the 'jitter' file. Note that this file |
@@ -1288,7 +1288,7 @@ store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const | |||
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | static DEVICE_ATTR(jitter, | 1290 | static DEVICE_ATTR(jitter, |
1291 | S_IRUGO | S_IWUGO, | 1291 | S_IRUGO | S_IWUSR, |
1292 | show_tabletJitterDelay, store_tabletJitterDelay); | 1292 | show_tabletJitterDelay, store_tabletJitterDelay); |
1293 | 1293 | ||
1294 | /*********************************************************************** | 1294 | /*********************************************************************** |
@@ -1317,7 +1317,7 @@ store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, | |||
1317 | } | 1317 | } |
1318 | 1318 | ||
1319 | static DEVICE_ATTR(delay, | 1319 | static DEVICE_ATTR(delay, |
1320 | S_IRUGO | S_IWUGO, | 1320 | S_IRUGO | S_IWUSR, |
1321 | show_tabletProgrammableDelay, store_tabletProgrammableDelay); | 1321 | show_tabletProgrammableDelay, store_tabletProgrammableDelay); |
1322 | 1322 | ||
1323 | /*********************************************************************** | 1323 | /*********************************************************************** |
@@ -1406,7 +1406,7 @@ store_tabletStylusUpper(struct device *dev, struct device_attribute *attr, const | |||
1406 | } | 1406 | } |
1407 | 1407 | ||
1408 | static DEVICE_ATTR(stylus_upper, | 1408 | static DEVICE_ATTR(stylus_upper, |
1409 | S_IRUGO | S_IWUGO, | 1409 | S_IRUGO | S_IWUSR, |
1410 | show_tabletStylusUpper, store_tabletStylusUpper); | 1410 | show_tabletStylusUpper, store_tabletStylusUpper); |
1411 | 1411 | ||
1412 | /*********************************************************************** | 1412 | /*********************************************************************** |
@@ -1437,7 +1437,7 @@ store_tabletStylusLower(struct device *dev, struct device_attribute *attr, const | |||
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | static DEVICE_ATTR(stylus_lower, | 1439 | static DEVICE_ATTR(stylus_lower, |
1440 | S_IRUGO | S_IWUGO, | 1440 | S_IRUGO | S_IWUSR, |
1441 | show_tabletStylusLower, store_tabletStylusLower); | 1441 | show_tabletStylusLower, store_tabletStylusLower); |
1442 | 1442 | ||
1443 | /*********************************************************************** | 1443 | /*********************************************************************** |
@@ -1475,7 +1475,7 @@ store_tabletMouseLeft(struct device *dev, struct device_attribute *attr, const c | |||
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | static DEVICE_ATTR(mouse_left, | 1477 | static DEVICE_ATTR(mouse_left, |
1478 | S_IRUGO | S_IWUGO, | 1478 | S_IRUGO | S_IWUSR, |
1479 | show_tabletMouseLeft, store_tabletMouseLeft); | 1479 | show_tabletMouseLeft, store_tabletMouseLeft); |
1480 | 1480 | ||
1481 | /*********************************************************************** | 1481 | /*********************************************************************** |
@@ -1505,7 +1505,7 @@ store_tabletMouseMiddle(struct device *dev, struct device_attribute *attr, const | |||
1505 | } | 1505 | } |
1506 | 1506 | ||
1507 | static DEVICE_ATTR(mouse_middle, | 1507 | static DEVICE_ATTR(mouse_middle, |
1508 | S_IRUGO | S_IWUGO, | 1508 | S_IRUGO | S_IWUSR, |
1509 | show_tabletMouseMiddle, store_tabletMouseMiddle); | 1509 | show_tabletMouseMiddle, store_tabletMouseMiddle); |
1510 | 1510 | ||
1511 | /*********************************************************************** | 1511 | /*********************************************************************** |
@@ -1535,7 +1535,7 @@ store_tabletMouseRight(struct device *dev, struct device_attribute *attr, const | |||
1535 | } | 1535 | } |
1536 | 1536 | ||
1537 | static DEVICE_ATTR(mouse_right, | 1537 | static DEVICE_ATTR(mouse_right, |
1538 | S_IRUGO | S_IWUGO, | 1538 | S_IRUGO | S_IWUSR, |
1539 | show_tabletMouseRight, store_tabletMouseRight); | 1539 | show_tabletMouseRight, store_tabletMouseRight); |
1540 | 1540 | ||
1541 | /*********************************************************************** | 1541 | /*********************************************************************** |
@@ -1567,7 +1567,7 @@ store_tabletWheel(struct device *dev, struct device_attribute *attr, const char | |||
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | static DEVICE_ATTR(wheel, | 1569 | static DEVICE_ATTR(wheel, |
1570 | S_IRUGO | S_IWUGO, show_tabletWheel, store_tabletWheel); | 1570 | S_IRUGO | S_IWUSR, show_tabletWheel, store_tabletWheel); |
1571 | 1571 | ||
1572 | /*********************************************************************** | 1572 | /*********************************************************************** |
1573 | * support routines for the 'execute' file. Note that this file | 1573 | * support routines for the 'execute' file. Note that this file |
@@ -1600,7 +1600,7 @@ store_tabletExecute(struct device *dev, struct device_attribute *attr, const cha | |||
1600 | } | 1600 | } |
1601 | 1601 | ||
1602 | static DEVICE_ATTR(execute, | 1602 | static DEVICE_ATTR(execute, |
1603 | S_IRUGO | S_IWUGO, show_tabletExecute, store_tabletExecute); | 1603 | S_IRUGO | S_IWUSR, show_tabletExecute, store_tabletExecute); |
1604 | 1604 | ||
1605 | /*********************************************************************** | 1605 | /*********************************************************************** |
1606 | * support routines for the 'odm_code' file. Note that this file | 1606 | * support routines for the 'odm_code' file. Note that this file |
diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h index de5adb109030..23317bd09c82 100644 --- a/drivers/input/tablet/wacom.h +++ b/drivers/input/tablet/wacom.h | |||
@@ -103,6 +103,7 @@ MODULE_DESCRIPTION(DRIVER_DESC); | |||
103 | MODULE_LICENSE(DRIVER_LICENSE); | 103 | MODULE_LICENSE(DRIVER_LICENSE); |
104 | 104 | ||
105 | #define USB_VENDOR_ID_WACOM 0x056a | 105 | #define USB_VENDOR_ID_WACOM 0x056a |
106 | #define USB_VENDOR_ID_LENOVO 0x17ef | ||
106 | 107 | ||
107 | struct wacom { | 108 | struct wacom { |
108 | dma_addr_t data_dma; | 109 | dma_addr_t data_dma; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 0b0525486711..518782999fea 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1424,11 +1424,25 @@ static struct wacom_features wacom_features_0xD2 = | |||
1424 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | 1424 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; |
1425 | static struct wacom_features wacom_features_0xD3 = | 1425 | static struct wacom_features wacom_features_0xD3 = |
1426 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | 1426 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; |
1427 | static const struct wacom_features wacom_features_0xD4 = | ||
1428 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 255, 63, BAMBOO_PT }; | ||
1429 | static struct wacom_features wacom_features_0xD8 = | ||
1430 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | ||
1431 | static struct wacom_features wacom_features_0xDA = | ||
1432 | { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | ||
1433 | static struct wacom_features wacom_features_0xDB = | ||
1434 | { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | ||
1435 | static const struct wacom_features wacom_features_0x6004 = | ||
1436 | { "ISD-V4", WACOM_PKGLEN_GRAPHIRE, 12800, 8000, 255, 0, TABLETPC }; | ||
1427 | 1437 | ||
1428 | #define USB_DEVICE_WACOM(prod) \ | 1438 | #define USB_DEVICE_WACOM(prod) \ |
1429 | USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ | 1439 | USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ |
1430 | .driver_info = (kernel_ulong_t)&wacom_features_##prod | 1440 | .driver_info = (kernel_ulong_t)&wacom_features_##prod |
1431 | 1441 | ||
1442 | #define USB_DEVICE_LENOVO(prod) \ | ||
1443 | USB_DEVICE(USB_VENDOR_ID_LENOVO, prod), \ | ||
1444 | .driver_info = (kernel_ulong_t)&wacom_features_##prod | ||
1445 | |||
1432 | const struct usb_device_id wacom_ids[] = { | 1446 | const struct usb_device_id wacom_ids[] = { |
1433 | { USB_DEVICE_WACOM(0x00) }, | 1447 | { USB_DEVICE_WACOM(0x00) }, |
1434 | { USB_DEVICE_WACOM(0x10) }, | 1448 | { USB_DEVICE_WACOM(0x10) }, |
@@ -1492,6 +1506,10 @@ const struct usb_device_id wacom_ids[] = { | |||
1492 | { USB_DEVICE_WACOM(0xD1) }, | 1506 | { USB_DEVICE_WACOM(0xD1) }, |
1493 | { USB_DEVICE_WACOM(0xD2) }, | 1507 | { USB_DEVICE_WACOM(0xD2) }, |
1494 | { USB_DEVICE_WACOM(0xD3) }, | 1508 | { USB_DEVICE_WACOM(0xD3) }, |
1509 | { USB_DEVICE_WACOM(0xD4) }, | ||
1510 | { USB_DEVICE_WACOM(0xD8) }, | ||
1511 | { USB_DEVICE_WACOM(0xDA) }, | ||
1512 | { USB_DEVICE_WACOM(0xDB) }, | ||
1495 | { USB_DEVICE_WACOM(0xF0) }, | 1513 | { USB_DEVICE_WACOM(0xF0) }, |
1496 | { USB_DEVICE_WACOM(0xCC) }, | 1514 | { USB_DEVICE_WACOM(0xCC) }, |
1497 | { USB_DEVICE_WACOM(0x90) }, | 1515 | { USB_DEVICE_WACOM(0x90) }, |
@@ -1501,6 +1519,7 @@ const struct usb_device_id wacom_ids[] = { | |||
1501 | { USB_DEVICE_WACOM(0xE2) }, | 1519 | { USB_DEVICE_WACOM(0xE2) }, |
1502 | { USB_DEVICE_WACOM(0xE3) }, | 1520 | { USB_DEVICE_WACOM(0xE3) }, |
1503 | { USB_DEVICE_WACOM(0x47) }, | 1521 | { USB_DEVICE_WACOM(0x47) }, |
1522 | { USB_DEVICE_LENOVO(0x6004) }, | ||
1504 | { } | 1523 | { } |
1505 | }; | 1524 | }; |
1506 | MODULE_DEVICE_TABLE(usb, wacom_ids); | 1525 | MODULE_DEVICE_TABLE(usb, wacom_ids); |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index f45f80f6d336..73fd6642b681 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -178,6 +178,7 @@ static const struct usb_device_id usbtouch_devices[] = { | |||
178 | 178 | ||
179 | #ifdef CONFIG_TOUCHSCREEN_USB_ITM | 179 | #ifdef CONFIG_TOUCHSCREEN_USB_ITM |
180 | {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, | 180 | {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, |
181 | {USB_DEVICE(0x16e3, 0xf9e9), .driver_info = DEVTYPE_ITM}, | ||
181 | #endif | 182 | #endif |
182 | 183 | ||
183 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO | 184 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO |