aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-06-28 02:00:25 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-06-28 02:00:25 -0400
commit31881d74b6dd1a6c530cff61248def4f2da38bee (patch)
treebe62420cf39192074e13b25553d172b9d5e58a33 /drivers/input
parent8855f30cd2b68012571932c7b01290c20be4508c (diff)
parent257867dc8d893690c175c1f717f91c3b6d44a63d (diff)
Merge branch 'for-next' of git://github.com/rydberg/linux into next
Pull in changes from Henrik: "a trivial MT documentation fix".
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/joystick/analog.c8
-rw-r--r--drivers/input/keyboard/Kconfig18
-rw-r--r--drivers/input/keyboard/Makefile1
-rw-r--r--drivers/input/keyboard/cros_ec_keyb.c334
-rw-r--r--drivers/input/keyboard/lpc32xx-keys.c11
-rw-r--r--drivers/input/keyboard/omap4-keypad.c16
-rw-r--r--drivers/input/keyboard/tca8418_keypad.c7
-rw-r--r--drivers/input/matrix-keymap.c20
-rw-r--r--drivers/input/misc/Kconfig8
-rw-r--r--drivers/input/misc/hp_sdc_rtc.c58
-rw-r--r--drivers/input/mouse/Kconfig2
-rw-r--r--drivers/input/mouse/synaptics.c2
-rw-r--r--drivers/input/tablet/wacom_wac.c101
-rw-r--r--drivers/input/tablet/wacom_wac.h1
-rw-r--r--drivers/input/touchscreen/egalax_ts.c2
15 files changed, 497 insertions, 92 deletions
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 7cd74e29cbc8..9135606c8649 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -158,14 +158,10 @@ static unsigned int get_time_pit(void)
158#define GET_TIME(x) rdtscl(x) 158#define GET_TIME(x) rdtscl(x)
159#define DELTA(x,y) ((y)-(x)) 159#define DELTA(x,y) ((y)-(x))
160#define TIME_NAME "TSC" 160#define TIME_NAME "TSC"
161#elif defined(__alpha__) 161#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_TILE)
162#define GET_TIME(x) do { x = get_cycles(); } while (0) 162#define GET_TIME(x) do { x = get_cycles(); } while (0)
163#define DELTA(x,y) ((y)-(x)) 163#define DELTA(x,y) ((y)-(x))
164#define TIME_NAME "PCC" 164#define TIME_NAME "get_cycles"
165#elif defined(CONFIG_MN10300) || defined(CONFIG_TILE)
166#define GET_TIME(x) do { x = get_cycles(); } while (0)
167#define DELTA(x, y) ((x) - (y))
168#define TIME_NAME "TSC"
169#else 165#else
170#define FAKE_TIME 166#define FAKE_TIME
171static unsigned long analog_faketime = 0; 167static unsigned long analog_faketime = 0;
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 706e11bb6a32..77412d824963 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -175,7 +175,7 @@ config KEYBOARD_EP93XX
175 175
176config KEYBOARD_GPIO 176config KEYBOARD_GPIO
177 tristate "GPIO Buttons" 177 tristate "GPIO Buttons"
178 depends on GENERIC_GPIO 178 depends on GPIOLIB
179 help 179 help
180 This driver implements support for buttons connected 180 This driver implements support for buttons connected
181 to GPIO pins of various CPUs (and some other chips). 181 to GPIO pins of various CPUs (and some other chips).
@@ -190,7 +190,7 @@ config KEYBOARD_GPIO
190 190
191config KEYBOARD_GPIO_POLLED 191config KEYBOARD_GPIO_POLLED
192 tristate "Polled GPIO buttons" 192 tristate "Polled GPIO buttons"
193 depends on GENERIC_GPIO 193 depends on GPIOLIB
194 select INPUT_POLLDEV 194 select INPUT_POLLDEV
195 help 195 help
196 This driver implements support for buttons connected 196 This driver implements support for buttons connected
@@ -241,7 +241,7 @@ config KEYBOARD_TCA8418
241 241
242config KEYBOARD_MATRIX 242config KEYBOARD_MATRIX
243 tristate "GPIO driven matrix keypad support" 243 tristate "GPIO driven matrix keypad support"
244 depends on GENERIC_GPIO 244 depends on GPIOLIB
245 select INPUT_MATRIXKMAP 245 select INPUT_MATRIXKMAP
246 help 246 help
247 Enable support for GPIO driven matrix keypad. 247 Enable support for GPIO driven matrix keypad.
@@ -639,4 +639,16 @@ config KEYBOARD_W90P910
639 To compile this driver as a module, choose M here: the 639 To compile this driver as a module, choose M here: the
640 module will be called w90p910_keypad. 640 module will be called w90p910_keypad.
641 641
642config KEYBOARD_CROS_EC
643 tristate "ChromeOS EC keyboard"
644 select INPUT_MATRIXKMAP
645 depends on MFD_CROS_EC
646 help
647 Say Y here to enable the matrix keyboard used by ChromeOS devices
648 and implemented on the ChromeOS EC. You must enable one bus option
649 (MFD_CROS_EC_I2C or MFD_CROS_EC_SPI) to use this.
650
651 To compile this driver as a module, choose M here: the
652 module will be called cros_ec_keyb.
653
642endif 654endif
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 89d997b05452..a699b6172303 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_KEYBOARD_AMIGA) += amikbd.o
11obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o 11obj-$(CONFIG_KEYBOARD_ATARI) += atakbd.o
12obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o 12obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
13obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o 13obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
14obj-$(CONFIG_KEYBOARD_CROS_EC) += cros_ec_keyb.o
14obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o 15obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
15obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o 16obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
16obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o 17obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o
diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
new file mode 100644
index 000000000000..49557f27bfa6
--- /dev/null
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -0,0 +1,334 @@
1/*
2 * ChromeOS EC keyboard driver
3 *
4 * Copyright (C) 2012 Google, Inc
5 *
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * This driver uses the Chrome OS EC byte-level message-based protocol for
16 * communicating the keyboard state (which keys are pressed) from a keyboard EC
17 * to the AP over some bus (such as i2c, lpc, spi). The EC does debouncing,
18 * but everything else (including deghosting) is done here. The main
19 * motivation for this is to keep the EC firmware as simple as possible, since
20 * it cannot be easily upgraded and EC flash/IRAM space is relatively
21 * expensive.
22 */
23
24#include <linux/module.h>
25#include <linux/i2c.h>
26#include <linux/input.h>
27#include <linux/kernel.h>
28#include <linux/notifier.h>
29#include <linux/platform_device.h>
30#include <linux/slab.h>
31#include <linux/input/matrix_keypad.h>
32#include <linux/mfd/cros_ec.h>
33#include <linux/mfd/cros_ec_commands.h>
34
35/*
36 * @rows: Number of rows in the keypad
37 * @cols: Number of columns in the keypad
38 * @row_shift: log2 or number of rows, rounded up
39 * @keymap_data: Matrix keymap data used to convert to keyscan values
40 * @ghost_filter: true to enable the matrix key-ghosting filter
41 * @dev: Device pointer
42 * @idev: Input device
43 * @ec: Top level ChromeOS device to use to talk to EC
44 * @event_notifier: interrupt event notifier for transport devices
45 */
46struct cros_ec_keyb {
47 unsigned int rows;
48 unsigned int cols;
49 int row_shift;
50 const struct matrix_keymap_data *keymap_data;
51 bool ghost_filter;
52
53 struct device *dev;
54 struct input_dev *idev;
55 struct cros_ec_device *ec;
56 struct notifier_block notifier;
57};
58
59
60static bool cros_ec_keyb_row_has_ghosting(struct cros_ec_keyb *ckdev,
61 uint8_t *buf, int row)
62{
63 int pressed_in_row = 0;
64 int row_has_teeth = 0;
65 int col, mask;
66
67 mask = 1 << row;
68 for (col = 0; col < ckdev->cols; col++) {
69 if (buf[col] & mask) {
70 pressed_in_row++;
71 row_has_teeth |= buf[col] & ~mask;
72 if (pressed_in_row > 1 && row_has_teeth) {
73 /* ghosting */
74 dev_dbg(ckdev->dev,
75 "ghost found at: r%d c%d, pressed %d, teeth 0x%x\n",
76 row, col, pressed_in_row,
77 row_has_teeth);
78 return true;
79 }
80 }
81 }
82
83 return false;
84}
85
86/*
87 * Returns true when there is at least one combination of pressed keys that
88 * results in ghosting.
89 */
90static bool cros_ec_keyb_has_ghosting(struct cros_ec_keyb *ckdev, uint8_t *buf)
91{
92 int row;
93
94 /*
95 * Ghosting happens if for any pressed key X there are other keys
96 * pressed both in the same row and column of X as, for instance,
97 * in the following diagram:
98 *
99 * . . Y . g .
100 * . . . . . .
101 * . . . . . .
102 * . . X . Z .
103 *
104 * In this case only X, Y, and Z are pressed, but g appears to be
105 * pressed too (see Wikipedia).
106 *
107 * We can detect ghosting in a single pass (*) over the keyboard state
108 * by maintaining two arrays. pressed_in_row counts how many pressed
109 * keys we have found in a row. row_has_teeth is true if any of the
110 * pressed keys for this row has other pressed keys in its column. If
111 * at any point of the scan we find that a row has multiple pressed
112 * keys, and at least one of them is at the intersection with a column
113 * with multiple pressed keys, we're sure there is ghosting.
114 * Conversely, if there is ghosting, we will detect such situation for
115 * at least one key during the pass.
116 *
117 * (*) This looks linear in the number of keys, but it's not. We can
118 * cheat because the number of rows is small.
119 */
120 for (row = 0; row < ckdev->rows; row++)
121 if (cros_ec_keyb_row_has_ghosting(ckdev, buf, row))
122 return true;
123
124 return false;
125}
126
127/*
128 * Compares the new keyboard state to the old one and produces key
129 * press/release events accordingly. The keyboard state is 13 bytes (one byte
130 * per column)
131 */
132static void cros_ec_keyb_process(struct cros_ec_keyb *ckdev,
133 uint8_t *kb_state, int len)
134{
135 struct input_dev *idev = ckdev->idev;
136 int col, row;
137 int new_state;
138 int num_cols;
139
140 num_cols = len;
141
142 if (ckdev->ghost_filter && cros_ec_keyb_has_ghosting(ckdev, kb_state)) {
143 /*
144 * Simple-minded solution: ignore this state. The obvious
145 * improvement is to only ignore changes to keys involved in
146 * the ghosting, but process the other changes.
147 */
148 dev_dbg(ckdev->dev, "ghosting found\n");
149 return;
150 }
151
152 for (col = 0; col < ckdev->cols; col++) {
153 for (row = 0; row < ckdev->rows; row++) {
154 int pos = MATRIX_SCAN_CODE(row, col, ckdev->row_shift);
155 const unsigned short *keycodes = idev->keycode;
156 int code;
157
158 code = keycodes[pos];
159 new_state = kb_state[col] & (1 << row);
160 if (!!new_state != test_bit(code, idev->key)) {
161 dev_dbg(ckdev->dev,
162 "changed: [r%d c%d]: byte %02x\n",
163 row, col, new_state);
164
165 input_report_key(idev, code, new_state);
166 }
167 }
168 }
169 input_sync(ckdev->idev);
170}
171
172static int cros_ec_keyb_open(struct input_dev *dev)
173{
174 struct cros_ec_keyb *ckdev = input_get_drvdata(dev);
175
176 return blocking_notifier_chain_register(&ckdev->ec->event_notifier,
177 &ckdev->notifier);
178}
179
180static void cros_ec_keyb_close(struct input_dev *dev)
181{
182 struct cros_ec_keyb *ckdev = input_get_drvdata(dev);
183
184 blocking_notifier_chain_unregister(&ckdev->ec->event_notifier,
185 &ckdev->notifier);
186}
187
188static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state)
189{
190 return ckdev->ec->command_recv(ckdev->ec, EC_CMD_MKBP_STATE,
191 kb_state, ckdev->cols);
192}
193
194static int cros_ec_keyb_work(struct notifier_block *nb,
195 unsigned long state, void *_notify)
196{
197 int ret;
198 struct cros_ec_keyb *ckdev = container_of(nb, struct cros_ec_keyb,
199 notifier);
200 uint8_t kb_state[ckdev->cols];
201
202 ret = cros_ec_keyb_get_state(ckdev, kb_state);
203 if (ret >= 0)
204 cros_ec_keyb_process(ckdev, kb_state, ret);
205
206 return NOTIFY_DONE;
207}
208
209/* Clear any keys in the buffer */
210static void cros_ec_keyb_clear_keyboard(struct cros_ec_keyb *ckdev)
211{
212 uint8_t old_state[ckdev->cols];
213 uint8_t new_state[ckdev->cols];
214 unsigned long duration;
215 int i, ret;
216
217 /*
218 * Keep reading until we see that the scan state does not change.
219 * That indicates that we are done.
220 *
221 * Assume that the EC keyscan buffer is at most 32 deep.
222 */
223 duration = jiffies;
224 ret = cros_ec_keyb_get_state(ckdev, new_state);
225 for (i = 1; !ret && i < 32; i++) {
226 memcpy(old_state, new_state, sizeof(old_state));
227 ret = cros_ec_keyb_get_state(ckdev, new_state);
228 if (0 == memcmp(old_state, new_state, sizeof(old_state)))
229 break;
230 }
231 duration = jiffies - duration;
232 dev_info(ckdev->dev, "Discarded %d keyscan(s) in %dus\n", i,
233 jiffies_to_usecs(duration));
234}
235
236static int cros_ec_keyb_probe(struct platform_device *pdev)
237{
238 struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent);
239 struct device *dev = ec->dev;
240 struct cros_ec_keyb *ckdev;
241 struct input_dev *idev;
242 struct device_node *np;
243 int err;
244
245 np = pdev->dev.of_node;
246 if (!np)
247 return -ENODEV;
248
249 ckdev = devm_kzalloc(&pdev->dev, sizeof(*ckdev), GFP_KERNEL);
250 if (!ckdev)
251 return -ENOMEM;
252 err = matrix_keypad_parse_of_params(&pdev->dev, &ckdev->rows,
253 &ckdev->cols);
254 if (err)
255 return err;
256
257 idev = devm_input_allocate_device(&pdev->dev);
258 if (!idev)
259 return -ENOMEM;
260
261 ckdev->ec = ec;
262 ckdev->notifier.notifier_call = cros_ec_keyb_work;
263 ckdev->dev = dev;
264 dev_set_drvdata(&pdev->dev, ckdev);
265
266 idev->name = ec->ec_name;
267 idev->phys = ec->phys_name;
268 __set_bit(EV_REP, idev->evbit);
269
270 idev->id.bustype = BUS_VIRTUAL;
271 idev->id.version = 1;
272 idev->id.product = 0;
273 idev->dev.parent = &pdev->dev;
274 idev->open = cros_ec_keyb_open;
275 idev->close = cros_ec_keyb_close;
276
277 ckdev->ghost_filter = of_property_read_bool(np,
278 "google,needs-ghost-filter");
279
280 err = matrix_keypad_build_keymap(NULL, NULL, ckdev->rows, ckdev->cols,
281 NULL, idev);
282 if (err) {
283 dev_err(dev, "cannot build key matrix\n");
284 return err;
285 }
286
287 ckdev->row_shift = get_count_order(ckdev->cols);
288
289 input_set_capability(idev, EV_MSC, MSC_SCAN);
290 input_set_drvdata(idev, ckdev);
291 ckdev->idev = idev;
292 err = input_register_device(ckdev->idev);
293 if (err) {
294 dev_err(dev, "cannot register input device\n");
295 return err;
296 }
297
298 return 0;
299}
300
301#ifdef CONFIG_PM_SLEEP
302static int cros_ec_keyb_resume(struct device *dev)
303{
304 struct cros_ec_keyb *ckdev = dev_get_drvdata(dev);
305
306 /*
307 * When the EC is not a wake source, then it could not have caused the
308 * resume, so we clear the EC's key scan buffer. If the EC was a
309 * wake source (e.g. the lid is open and the user might press a key to
310 * wake) then the key scan buffer should be preserved.
311 */
312 if (ckdev->ec->was_wake_device)
313 cros_ec_keyb_clear_keyboard(ckdev);
314
315 return 0;
316}
317
318#endif
319
320static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume);
321
322static struct platform_driver cros_ec_keyb_driver = {
323 .probe = cros_ec_keyb_probe,
324 .driver = {
325 .name = "cros-ec-keyb",
326 .pm = &cros_ec_keyb_pm_ops,
327 },
328};
329
330module_platform_driver(cros_ec_keyb_driver);
331
332MODULE_LICENSE("GPL");
333MODULE_DESCRIPTION("ChromeOS EC keyboard driver");
334MODULE_ALIAS("platform:cros-ec-keyb");
diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c
index 1b8add6cfb9d..42181435fe67 100644
--- a/drivers/input/keyboard/lpc32xx-keys.c
+++ b/drivers/input/keyboard/lpc32xx-keys.c
@@ -144,12 +144,13 @@ static int lpc32xx_parse_dt(struct device *dev,
144{ 144{
145 struct device_node *np = dev->of_node; 145 struct device_node *np = dev->of_node;
146 u32 rows = 0, columns = 0; 146 u32 rows = 0, columns = 0;
147 int err;
147 148
148 of_property_read_u32(np, "keypad,num-rows", &rows); 149 err = matrix_keypad_parse_of_params(dev, &rows, &columns);
149 of_property_read_u32(np, "keypad,num-columns", &columns); 150 if (err)
150 if (!rows || rows != columns) { 151 return err;
151 dev_err(dev, 152 if (rows != columns) {
152 "rows and columns must be specified and be equal!\n"); 153 dev_err(dev, "rows and columns must be equal!\n");
153 return -EINVAL; 154 return -EINVAL;
154 } 155 }
155 156
diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index d715c0d10bf2..f4aa53a1fd69 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -215,18 +215,12 @@ static int omap4_keypad_parse_dt(struct device *dev,
215 struct omap4_keypad *keypad_data) 215 struct omap4_keypad *keypad_data)
216{ 216{
217 struct device_node *np = dev->of_node; 217 struct device_node *np = dev->of_node;
218 int err;
218 219
219 if (!np) { 220 err = matrix_keypad_parse_of_params(dev, &keypad_data->rows,
220 dev_err(dev, "missing DT data"); 221 &keypad_data->cols);
221 return -EINVAL; 222 if (err)
222 } 223 return err;
223
224 of_property_read_u32(np, "keypad,num-rows", &keypad_data->rows);
225 of_property_read_u32(np, "keypad,num-columns", &keypad_data->cols);
226 if (!keypad_data->rows || !keypad_data->cols) {
227 dev_err(dev, "number of keypad rows/columns not specified\n");
228 return -EINVAL;
229 }
230 224
231 if (of_get_property(np, "linux,input-no-autorepeat", NULL)) 225 if (of_get_property(np, "linux,input-no-autorepeat", NULL))
232 keypad_data->no_autorepeat = true; 226 keypad_data->no_autorepeat = true;
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index a34cc6714e5b..55c15304ddbc 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -288,8 +288,11 @@ static int tca8418_keypad_probe(struct i2c_client *client,
288 irq_is_gpio = pdata->irq_is_gpio; 288 irq_is_gpio = pdata->irq_is_gpio;
289 } else { 289 } else {
290 struct device_node *np = dev->of_node; 290 struct device_node *np = dev->of_node;
291 of_property_read_u32(np, "keypad,num-rows", &rows); 291 int err;
292 of_property_read_u32(np, "keypad,num-columns", &cols); 292
293 err = matrix_keypad_parse_of_params(dev, &rows, &cols);
294 if (err)
295 return err;
293 rep = of_property_read_bool(np, "keypad,autorepeat"); 296 rep = of_property_read_bool(np, "keypad,autorepeat");
294 } 297 }
295 298
diff --git a/drivers/input/matrix-keymap.c b/drivers/input/matrix-keymap.c
index 3ae496ea5fe6..08b61f506db6 100644
--- a/drivers/input/matrix-keymap.c
+++ b/drivers/input/matrix-keymap.c
@@ -50,6 +50,26 @@ static bool matrix_keypad_map_key(struct input_dev *input_dev,
50} 50}
51 51
52#ifdef CONFIG_OF 52#ifdef CONFIG_OF
53int matrix_keypad_parse_of_params(struct device *dev,
54 unsigned int *rows, unsigned int *cols)
55{
56 struct device_node *np = dev->of_node;
57
58 if (!np) {
59 dev_err(dev, "missing DT data");
60 return -EINVAL;
61 }
62 of_property_read_u32(np, "keypad,num-rows", rows);
63 of_property_read_u32(np, "keypad,num-columns", cols);
64 if (!*rows || !*cols) {
65 dev_err(dev, "number of keypad rows/columns not specified\n");
66 return -EINVAL;
67 }
68
69 return 0;
70}
71EXPORT_SYMBOL_GPL(matrix_keypad_parse_of_params);
72
53static int matrix_keypad_parse_of_keymap(const char *propname, 73static int matrix_keypad_parse_of_keymap(const char *propname,
54 unsigned int rows, unsigned int cols, 74 unsigned int rows, unsigned int cols,
55 struct input_dev *input_dev) 75 struct input_dev *input_dev)
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index f6002a76c29f..0b541cdf9b8e 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -214,7 +214,7 @@ config INPUT_APANEL
214config INPUT_GP2A 214config INPUT_GP2A
215 tristate "Sharp GP2AP002A00F I2C Proximity/Opto sensor driver" 215 tristate "Sharp GP2AP002A00F I2C Proximity/Opto sensor driver"
216 depends on I2C 216 depends on I2C
217 depends on GENERIC_GPIO 217 depends on GPIOLIB
218 help 218 help
219 Say Y here if you have a Sharp GP2AP002A00F proximity/als combo-chip 219 Say Y here if you have a Sharp GP2AP002A00F proximity/als combo-chip
220 hooked to an I2C bus. 220 hooked to an I2C bus.
@@ -224,7 +224,7 @@ config INPUT_GP2A
224 224
225config INPUT_GPIO_TILT_POLLED 225config INPUT_GPIO_TILT_POLLED
226 tristate "Polled GPIO tilt switch" 226 tristate "Polled GPIO tilt switch"
227 depends on GENERIC_GPIO 227 depends on GPIOLIB
228 select INPUT_POLLDEV 228 select INPUT_POLLDEV
229 help 229 help
230 This driver implements support for tilt switches connected 230 This driver implements support for tilt switches connected
@@ -472,7 +472,7 @@ config INPUT_PWM_BEEPER
472 472
473config INPUT_GPIO_ROTARY_ENCODER 473config INPUT_GPIO_ROTARY_ENCODER
474 tristate "Rotary encoders connected to GPIO pins" 474 tristate "Rotary encoders connected to GPIO pins"
475 depends on GPIOLIB && GENERIC_GPIO 475 depends on GPIOLIB
476 help 476 help
477 Say Y here to add support for rotary encoders connected to GPIO lines. 477 Say Y here to add support for rotary encoders connected to GPIO lines.
478 Check file:Documentation/input/rotary-encoder.txt for more 478 Check file:Documentation/input/rotary-encoder.txt for more
@@ -484,7 +484,7 @@ config INPUT_GPIO_ROTARY_ENCODER
484config INPUT_RB532_BUTTON 484config INPUT_RB532_BUTTON
485 tristate "Mikrotik Routerboard 532 button interface" 485 tristate "Mikrotik Routerboard 532 button interface"
486 depends on MIKROTIK_RB532 486 depends on MIKROTIK_RB532
487 depends on GPIOLIB && GENERIC_GPIO 487 depends on GPIOLIB
488 select INPUT_POLLDEV 488 select INPUT_POLLDEV
489 help 489 help
490 Say Y here if you want support for the S1 button built into 490 Say Y here if you want support for the S1 button built into
diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c
index 2e3334b8f82d..86b822806e95 100644
--- a/drivers/input/misc/hp_sdc_rtc.c
+++ b/drivers/input/misc/hp_sdc_rtc.c
@@ -41,6 +41,7 @@
41#include <linux/time.h> 41#include <linux/time.h>
42#include <linux/miscdevice.h> 42#include <linux/miscdevice.h>
43#include <linux/proc_fs.h> 43#include <linux/proc_fs.h>
44#include <linux/seq_file.h>
44#include <linux/poll.h> 45#include <linux/poll.h>
45#include <linux/rtc.h> 46#include <linux/rtc.h>
46#include <linux/mutex.h> 47#include <linux/mutex.h>
@@ -74,9 +75,6 @@ static unsigned int hp_sdc_rtc_poll(struct file *file, poll_table *wait);
74static int hp_sdc_rtc_open(struct inode *inode, struct file *file); 75static int hp_sdc_rtc_open(struct inode *inode, struct file *file);
75static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on); 76static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on);
76 77
77static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off,
78 int count, int *eof, void *data);
79
80static void hp_sdc_rtc_isr (int irq, void *dev_id, 78static void hp_sdc_rtc_isr (int irq, void *dev_id,
81 uint8_t status, uint8_t data) 79 uint8_t status, uint8_t data)
82{ 80{
@@ -427,22 +425,19 @@ static int hp_sdc_rtc_fasync (int fd, struct file *filp, int on)
427 return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue); 425 return fasync_helper (fd, filp, on, &hp_sdc_rtc_async_queue);
428} 426}
429 427
430static int hp_sdc_rtc_proc_output (char *buf) 428static int hp_sdc_rtc_proc_show(struct seq_file *m, void *v)
431{ 429{
432#define YN(bit) ("no") 430#define YN(bit) ("no")
433#define NY(bit) ("yes") 431#define NY(bit) ("yes")
434 char *p;
435 struct rtc_time tm; 432 struct rtc_time tm;
436 struct timeval tv; 433 struct timeval tv;
437 434
438 memset(&tm, 0, sizeof(struct rtc_time)); 435 memset(&tm, 0, sizeof(struct rtc_time));
439 436
440 p = buf;
441
442 if (hp_sdc_rtc_read_bbrtc(&tm)) { 437 if (hp_sdc_rtc_read_bbrtc(&tm)) {
443 p += sprintf(p, "BBRTC\t\t: READ FAILED!\n"); 438 seq_puts(m, "BBRTC\t\t: READ FAILED!\n");
444 } else { 439 } else {
445 p += sprintf(p, 440 seq_printf(m,
446 "rtc_time\t: %02d:%02d:%02d\n" 441 "rtc_time\t: %02d:%02d:%02d\n"
447 "rtc_date\t: %04d-%02d-%02d\n" 442 "rtc_date\t: %04d-%02d-%02d\n"
448 "rtc_epoch\t: %04lu\n", 443 "rtc_epoch\t: %04lu\n",
@@ -452,41 +447,41 @@ static int hp_sdc_rtc_proc_output (char *buf)
452 } 447 }
453 448
454 if (hp_sdc_rtc_read_rt(&tv)) { 449 if (hp_sdc_rtc_read_rt(&tv)) {
455 p += sprintf(p, "i8042 rtc\t: READ FAILED!\n"); 450 seq_puts(m, "i8042 rtc\t: READ FAILED!\n");
456 } else { 451 } else {
457 p += sprintf(p, "i8042 rtc\t: %ld.%02d seconds\n", 452 seq_printf(m, "i8042 rtc\t: %ld.%02d seconds\n",
458 tv.tv_sec, (int)tv.tv_usec/1000); 453 tv.tv_sec, (int)tv.tv_usec/1000);
459 } 454 }
460 455
461 if (hp_sdc_rtc_read_fhs(&tv)) { 456 if (hp_sdc_rtc_read_fhs(&tv)) {
462 p += sprintf(p, "handshake\t: READ FAILED!\n"); 457 seq_puts(m, "handshake\t: READ FAILED!\n");
463 } else { 458 } else {
464 p += sprintf(p, "handshake\t: %ld.%02d seconds\n", 459 seq_printf(m, "handshake\t: %ld.%02d seconds\n",
465 tv.tv_sec, (int)tv.tv_usec/1000); 460 tv.tv_sec, (int)tv.tv_usec/1000);
466 } 461 }
467 462
468 if (hp_sdc_rtc_read_mt(&tv)) { 463 if (hp_sdc_rtc_read_mt(&tv)) {
469 p += sprintf(p, "alarm\t\t: READ FAILED!\n"); 464 seq_puts(m, "alarm\t\t: READ FAILED!\n");
470 } else { 465 } else {
471 p += sprintf(p, "alarm\t\t: %ld.%02d seconds\n", 466 seq_printf(m, "alarm\t\t: %ld.%02d seconds\n",
472 tv.tv_sec, (int)tv.tv_usec/1000); 467 tv.tv_sec, (int)tv.tv_usec/1000);
473 } 468 }
474 469
475 if (hp_sdc_rtc_read_dt(&tv)) { 470 if (hp_sdc_rtc_read_dt(&tv)) {
476 p += sprintf(p, "delay\t\t: READ FAILED!\n"); 471 seq_puts(m, "delay\t\t: READ FAILED!\n");
477 } else { 472 } else {
478 p += sprintf(p, "delay\t\t: %ld.%02d seconds\n", 473 seq_printf(m, "delay\t\t: %ld.%02d seconds\n",
479 tv.tv_sec, (int)tv.tv_usec/1000); 474 tv.tv_sec, (int)tv.tv_usec/1000);
480 } 475 }
481 476
482 if (hp_sdc_rtc_read_ct(&tv)) { 477 if (hp_sdc_rtc_read_ct(&tv)) {
483 p += sprintf(p, "periodic\t: READ FAILED!\n"); 478 seq_puts(m, "periodic\t: READ FAILED!\n");
484 } else { 479 } else {
485 p += sprintf(p, "periodic\t: %ld.%02d seconds\n", 480 seq_printf(m, "periodic\t: %ld.%02d seconds\n",
486 tv.tv_sec, (int)tv.tv_usec/1000); 481 tv.tv_sec, (int)tv.tv_usec/1000);
487 } 482 }
488 483
489 p += sprintf(p, 484 seq_printf(m,
490 "DST_enable\t: %s\n" 485 "DST_enable\t: %s\n"
491 "BCD\t\t: %s\n" 486 "BCD\t\t: %s\n"
492 "24hr\t\t: %s\n" 487 "24hr\t\t: %s\n"
@@ -506,23 +501,23 @@ static int hp_sdc_rtc_proc_output (char *buf)
506 1UL, 501 1UL,
507 1 ? "okay" : "dead"); 502 1 ? "okay" : "dead");
508 503
509 return p - buf; 504 return 0;
510#undef YN 505#undef YN
511#undef NY 506#undef NY
512} 507}
513 508
514static int hp_sdc_rtc_read_proc(char *page, char **start, off_t off, 509static int hp_sdc_rtc_proc_open(struct inode *inode, struct file *file)
515 int count, int *eof, void *data)
516{ 510{
517 int len = hp_sdc_rtc_proc_output (page); 511 return single_open(file, hp_sdc_rtc_proc_show, NULL);
518 if (len <= off+count) *eof = 1;
519 *start = page + off;
520 len -= off;
521 if (len>count) len = count;
522 if (len<0) len = 0;
523 return len;
524} 512}
525 513
514static const struct file_operations hp_sdc_rtc_proc_fops = {
515 .open = hp_sdc_rtc_proc_open,
516 .read = seq_read,
517 .llseek = seq_lseek,
518 .release = single_release,
519};
520
526static int hp_sdc_rtc_ioctl(struct file *file, 521static int hp_sdc_rtc_ioctl(struct file *file,
527 unsigned int cmd, unsigned long arg) 522 unsigned int cmd, unsigned long arg)
528{ 523{
@@ -715,8 +710,7 @@ static int __init hp_sdc_rtc_init(void)
715 if (misc_register(&hp_sdc_rtc_dev) != 0) 710 if (misc_register(&hp_sdc_rtc_dev) != 0)
716 printk(KERN_INFO "Could not register misc. dev for i8042 rtc\n"); 711 printk(KERN_INFO "Could not register misc. dev for i8042 rtc\n");
717 712
718 create_proc_read_entry ("driver/rtc", 0, NULL, 713 proc_create("driver/rtc", 0, NULL, &hp_sdc_rtc_proc_fops);
719 hp_sdc_rtc_read_proc, NULL);
720 714
721 printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded " 715 printk(KERN_INFO "HP i8042 SDC + MSM-58321 RTC support loaded "
722 "(RTC v " RTC_VERSION ")\n"); 716 "(RTC v " RTC_VERSION ")\n");
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig
index 802bd6a72d73..effa9c5f2c5c 100644
--- a/drivers/input/mouse/Kconfig
+++ b/drivers/input/mouse/Kconfig
@@ -295,7 +295,7 @@ config MOUSE_VSXXXAA
295 295
296config MOUSE_GPIO 296config MOUSE_GPIO
297 tristate "GPIO mouse" 297 tristate "GPIO mouse"
298 depends on GENERIC_GPIO 298 depends on GPIOLIB
299 select INPUT_POLLDEV 299 select INPUT_POLLDEV
300 help 300 help
301 This driver simulates a mouse on GPIO lines of various CPUs (and some 301 This driver simulates a mouse on GPIO lines of various CPUs (and some
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 2f78538e09d0..b2420ae19e14 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -1379,6 +1379,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)
1379{ 1379{
1380 struct synaptics_data *priv = psmouse->private; 1380 struct synaptics_data *priv = psmouse->private;
1381 struct synaptics_data old_priv = *priv; 1381 struct synaptics_data old_priv = *priv;
1382 unsigned char param[2];
1382 int retry = 0; 1383 int retry = 0;
1383 int error; 1384 int error;
1384 1385
@@ -1394,6 +1395,7 @@ static int synaptics_reconnect(struct psmouse *psmouse)
1394 */ 1395 */
1395 ssleep(1); 1396 ssleep(1);
1396 } 1397 }
1398 ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID);
1397 error = synaptics_detect(psmouse, 0); 1399 error = synaptics_detect(psmouse, 0);
1398 } while (error && ++retry < 3); 1400 } while (error && ++retry < 3);
1399 1401
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 1daa97913b7d..518282da6d85 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -342,10 +342,10 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
342 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) | 342 wacom->id[idx] = (data[2] << 4) | (data[3] >> 4) |
343 ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12); 343 ((data[7] & 0x0f) << 20) | ((data[8] & 0xf0) << 12);
344 344
345 switch (wacom->id[idx] & 0xfffff) { 345 switch (wacom->id[idx]) {
346 case 0x812: /* Inking pen */ 346 case 0x812: /* Inking pen */
347 case 0x801: /* Intuos3 Inking pen */ 347 case 0x801: /* Intuos3 Inking pen */
348 case 0x20802: /* Intuos4 Inking Pen */ 348 case 0x120802: /* Intuos4/5 Inking Pen */
349 case 0x012: 349 case 0x012:
350 wacom->tool[idx] = BTN_TOOL_PENCIL; 350 wacom->tool[idx] = BTN_TOOL_PENCIL;
351 break; 351 break;
@@ -356,11 +356,13 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
356 case 0x823: /* Intuos3 Grip Pen */ 356 case 0x823: /* Intuos3 Grip Pen */
357 case 0x813: /* Intuos3 Classic Pen */ 357 case 0x813: /* Intuos3 Classic Pen */
358 case 0x885: /* Intuos3 Marker Pen */ 358 case 0x885: /* Intuos3 Marker Pen */
359 case 0x802: /* Intuos4 General Pen */ 359 case 0x802: /* Intuos4/5 13HD/24HD General Pen */
360 case 0x804: /* Intuos4 Marker Pen */ 360 case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
361 case 0x40802: /* Intuos4 Classic Pen */
362 case 0x18803: /* DTH2242 Grip Pen */
363 case 0x022: 361 case 0x022:
362 case 0x100804: /* Intuos4/5 13HD/24HD Art Pen */
363 case 0x140802: /* Intuos4/5 13HD/24HD Classic Pen */
364 case 0x160802: /* Cintiq 13HD Pro Pen */
365 case 0x180802: /* DTH2242 Pen */
364 wacom->tool[idx] = BTN_TOOL_PEN; 366 wacom->tool[idx] = BTN_TOOL_PEN;
365 break; 367 break;
366 368
@@ -391,10 +393,14 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
391 case 0x82b: /* Intuos3 Grip Pen Eraser */ 393 case 0x82b: /* Intuos3 Grip Pen Eraser */
392 case 0x81b: /* Intuos3 Classic Pen Eraser */ 394 case 0x81b: /* Intuos3 Classic Pen Eraser */
393 case 0x91b: /* Intuos3 Airbrush Eraser */ 395 case 0x91b: /* Intuos3 Airbrush Eraser */
394 case 0x80c: /* Intuos4 Marker Pen Eraser */ 396 case 0x80c: /* Intuos4/5 13HD/24HD Marker Pen Eraser */
395 case 0x80a: /* Intuos4 General Pen Eraser */ 397 case 0x80a: /* Intuos4/5 13HD/24HD General Pen Eraser */
396 case 0x4080a: /* Intuos4 Classic Pen Eraser */ 398 case 0x90a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
397 case 0x90a: /* Intuos4 Airbrush Eraser */ 399 case 0x14080a: /* Intuos4/5 13HD/24HD Classic Pen Eraser */
400 case 0x10090a: /* Intuos4/5 13HD/24HD Airbrush Eraser */
401 case 0x10080c: /* Intuos4/5 13HD/24HD Art Pen Eraser */
402 case 0x16080a: /* Cintiq 13HD Pro Pen Eraser */
403 case 0x18080a: /* DTH2242 Eraser */
398 wacom->tool[idx] = BTN_TOOL_RUBBER; 404 wacom->tool[idx] = BTN_TOOL_RUBBER;
399 break; 405 break;
400 406
@@ -402,7 +408,8 @@ static int wacom_intuos_inout(struct wacom_wac *wacom)
402 case 0x912: 408 case 0x912:
403 case 0x112: 409 case 0x112:
404 case 0x913: /* Intuos3 Airbrush */ 410 case 0x913: /* Intuos3 Airbrush */
405 case 0x902: /* Intuos4 Airbrush */ 411 case 0x902: /* Intuos4/5 13HD/24HD Airbrush */
412 case 0x100902: /* Intuos4/5 13HD/24HD Airbrush */
406 wacom->tool[idx] = BTN_TOOL_AIRBRUSH; 413 wacom->tool[idx] = BTN_TOOL_AIRBRUSH;
407 break; 414 break;
408 415
@@ -533,10 +540,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
533 input_report_key(input, BTN_8, (data[3] & 0x80)); 540 input_report_key(input, BTN_8, (data[3] & 0x80));
534 } 541 }
535 if (data[1] | (data[2] & 0x01) | data[3]) { 542 if (data[1] | (data[2] & 0x01) | data[3]) {
536 input_report_key(input, wacom->tool[1], 1);
537 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 543 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
538 } else { 544 } else {
539 input_report_key(input, wacom->tool[1], 0);
540 input_report_abs(input, ABS_MISC, 0); 545 input_report_abs(input, ABS_MISC, 0);
541 } 546 }
542 } else if (features->type == DTK) { 547 } else if (features->type == DTK) {
@@ -546,6 +551,26 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
546 input_report_key(input, BTN_3, (data[6] & 0x08)); 551 input_report_key(input, BTN_3, (data[6] & 0x08));
547 input_report_key(input, BTN_4, (data[6] & 0x10)); 552 input_report_key(input, BTN_4, (data[6] & 0x10));
548 input_report_key(input, BTN_5, (data[6] & 0x20)); 553 input_report_key(input, BTN_5, (data[6] & 0x20));
554 if (data[6] & 0x3f) {
555 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
556 } else {
557 input_report_abs(input, ABS_MISC, 0);
558 }
559 } else if (features->type == WACOM_13HD) {
560 input_report_key(input, BTN_0, (data[3] & 0x01));
561 input_report_key(input, BTN_1, (data[4] & 0x01));
562 input_report_key(input, BTN_2, (data[4] & 0x02));
563 input_report_key(input, BTN_3, (data[4] & 0x04));
564 input_report_key(input, BTN_4, (data[4] & 0x08));
565 input_report_key(input, BTN_5, (data[4] & 0x10));
566 input_report_key(input, BTN_6, (data[4] & 0x20));
567 input_report_key(input, BTN_7, (data[4] & 0x40));
568 input_report_key(input, BTN_8, (data[4] & 0x80));
569 if ((data[3] & 0x01) | data[4]) {
570 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
571 } else {
572 input_report_abs(input, ABS_MISC, 0);
573 }
549 } else if (features->type == WACOM_24HD) { 574 } else if (features->type == WACOM_24HD) {
550 input_report_key(input, BTN_0, (data[6] & 0x01)); 575 input_report_key(input, BTN_0, (data[6] & 0x01));
551 input_report_key(input, BTN_1, (data[6] & 0x02)); 576 input_report_key(input, BTN_1, (data[6] & 0x02));
@@ -590,10 +615,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
590 } 615 }
591 616
592 if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) { 617 if (data[1] | data[2] | (data[3] & 0x1f) | data[4] | data[6] | data[8]) {
593 input_report_key(input, wacom->tool[1], 1);
594 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 618 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
595 } else { 619 } else {
596 input_report_key(input, wacom->tool[1], 0);
597 input_report_abs(input, ABS_MISC, 0); 620 input_report_abs(input, ABS_MISC, 0);
598 } 621 }
599 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) { 622 } else if (features->type >= INTUOS5S && features->type <= INTUOS5L) {
@@ -618,10 +641,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
618 } 641 }
619 642
620 if (data[2] | (data[3] & 0x01) | data[4] | data[5]) { 643 if (data[2] | (data[3] & 0x01) | data[4] | data[5]) {
621 input_report_key(input, wacom->tool[1], 1);
622 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 644 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
623 } else { 645 } else {
624 input_report_key(input, wacom->tool[1], 0);
625 input_report_abs(input, ABS_MISC, 0); 646 input_report_abs(input, ABS_MISC, 0);
626 } 647 }
627 } else { 648 } else {
@@ -668,10 +689,8 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
668 if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) | 689 if ((data[5] & 0x1f) | data[6] | (data[1] & 0x1f) |
669 data[2] | (data[3] & 0x1f) | data[4] | data[8] | 690 data[2] | (data[3] & 0x1f) | data[4] | data[8] |
670 (data[7] & 0x01)) { 691 (data[7] & 0x01)) {
671 input_report_key(input, wacom->tool[1], 1);
672 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID); 692 input_report_abs(input, ABS_MISC, PAD_DEVICE_ID);
673 } else { 693 } else {
674 input_report_key(input, wacom->tool[1], 0);
675 input_report_abs(input, ABS_MISC, 0); 694 input_report_abs(input, ABS_MISC, 0);
676 } 695 }
677 } 696 }
@@ -1301,6 +1320,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
1301 case INTUOS4L: 1320 case INTUOS4L:
1302 case CINTIQ: 1321 case CINTIQ:
1303 case WACOM_BEE: 1322 case WACOM_BEE:
1323 case WACOM_13HD:
1304 case WACOM_21UX2: 1324 case WACOM_21UX2:
1305 case WACOM_22HD: 1325 case WACOM_22HD:
1306 case WACOM_24HD: 1326 case WACOM_24HD:
@@ -1530,15 +1550,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1530 __set_bit(KEY_PROG1, input_dev->keybit); 1550 __set_bit(KEY_PROG1, input_dev->keybit);
1531 __set_bit(KEY_PROG2, input_dev->keybit); 1551 __set_bit(KEY_PROG2, input_dev->keybit);
1532 __set_bit(KEY_PROG3, input_dev->keybit); 1552 __set_bit(KEY_PROG3, input_dev->keybit);
1553
1554 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1555 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1533 /* fall through */ 1556 /* fall through */
1534 1557
1535 case DTK: 1558 case DTK:
1536 for (i = 0; i < 6; i++) 1559 for (i = 0; i < 6; i++)
1537 __set_bit(BTN_0 + i, input_dev->keybit); 1560 __set_bit(BTN_0 + i, input_dev->keybit);
1538 1561
1539 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1540 input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
1541
1542 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1562 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1543 1563
1544 wacom_setup_cintiq(wacom_wac); 1564 wacom_setup_cintiq(wacom_wac);
@@ -1579,6 +1599,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev,
1579 wacom_setup_cintiq(wacom_wac); 1599 wacom_setup_cintiq(wacom_wac);
1580 break; 1600 break;
1581 1601
1602 case WACOM_13HD:
1603 for (i = 0; i < 9; i++)
1604 __set_bit(BTN_0 + i, input_dev->keybit);
1605
1606 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1607 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1608 wacom_setup_cintiq(wacom_wac);
1609 break;
1610
1582 case INTUOS3: 1611 case INTUOS3:
1583 case INTUOS3L: 1612 case INTUOS3L:
1584 __set_bit(BTN_4, input_dev->keybit); 1613 __set_bit(BTN_4, input_dev->keybit);
@@ -1912,7 +1941,7 @@ static const struct wacom_features wacom_features_0xBB =
1912 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047, 1941 { "Wacom Intuos4 12x19", WACOM_PKGLEN_INTUOS, 97536, 60960, 2047,
1913 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1942 63, INTUOS4L, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1914static const struct wacom_features wacom_features_0xBC = 1943static const struct wacom_features wacom_features_0xBC =
1915 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40840, 25400, 2047, 1944 { "Wacom Intuos4 WL", WACOM_PKGLEN_INTUOS, 40640, 25400, 2047,
1916 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1945 63, INTUOS4, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1917static const struct wacom_features wacom_features_0x26 = 1946static const struct wacom_features wacom_features_0x26 =
1918 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047, 1947 { "Wacom Intuos5 touch S", WACOM_PKGLEN_INTUOS, 31496, 19685, 2047,
@@ -1937,7 +1966,8 @@ static const struct wacom_features wacom_features_0xF4 =
1937 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1966 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1938static const struct wacom_features wacom_features_0xF8 = 1967static const struct wacom_features wacom_features_0xF8 =
1939 { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ 1968 { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */
1940 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; 1969 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
1970 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 };
1941static const struct wacom_features wacom_features_0xF6 = 1971static const struct wacom_features wacom_features_0xF6 =
1942 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ 1972 { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */
1943 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; 1973 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 };
@@ -1950,6 +1980,9 @@ static const struct wacom_features wacom_features_0xC5 =
1950static const struct wacom_features wacom_features_0xC6 = 1980static const struct wacom_features wacom_features_0xC6 =
1951 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023, 1981 { "Wacom Cintiq 12WX", WACOM_PKGLEN_INTUOS, 53020, 33440, 1023,
1952 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 1982 63, WACOM_BEE, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1983static const struct wacom_features wacom_features_0x304 =
1984 { "Wacom Cintiq 13HD", WACOM_PKGLEN_INTUOS, 59552, 33848, 1023,
1985 63, WACOM_13HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
1953static const struct wacom_features wacom_features_0xC7 = 1986static const struct wacom_features wacom_features_0xC7 =
1954 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511, 1987 { "Wacom DTU1931", WACOM_PKGLEN_GRAPHIRE, 37832, 30305, 511,
1955 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1988 0, PL, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -1959,6 +1992,9 @@ static const struct wacom_features wacom_features_0xCE =
1959static const struct wacom_features wacom_features_0xF0 = 1992static const struct wacom_features wacom_features_0xF0 =
1960 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511, 1993 { "Wacom DTU1631", WACOM_PKGLEN_GRAPHIRE, 34623, 19553, 511,
1961 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 1994 0, DTU, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
1995static const struct wacom_features wacom_features_0x57 =
1996 { "Wacom DTK2241", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1997 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES};
1962static const struct wacom_features wacom_features_0x59 = /* Pen */ 1998static const struct wacom_features wacom_features_0x59 = /* Pen */
1963 { "Wacom DTH2242", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 1999 { "Wacom DTH2242", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1964 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 2000 63, DTK, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
@@ -1972,6 +2008,13 @@ static const struct wacom_features wacom_features_0xCC =
1972static const struct wacom_features wacom_features_0xFA = 2008static const struct wacom_features wacom_features_0xFA =
1973 { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, 2009 { "Wacom Cintiq 22HD", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
1974 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; 2010 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES };
2011static const struct wacom_features wacom_features_0x5B =
2012 { "Wacom Cintiq 22HDT", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047,
2013 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES,
2014 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e };
2015static const struct wacom_features wacom_features_0x5E =
2016 { "Wacom Cintiq 22HDT", .type = WACOM_24HDT,
2017 .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 };
1975static const struct wacom_features wacom_features_0x90 = 2018static const struct wacom_features wacom_features_0x90 =
1976 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255, 2019 { "Wacom ISDv4 90", WACOM_PKGLEN_GRAPHIRE, 26202, 16325, 255,
1977 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2020 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2001,7 +2044,7 @@ static const struct wacom_features wacom_features_0xE5 =
2001static const struct wacom_features wacom_features_0xE6 = 2044static const struct wacom_features wacom_features_0xE6 =
2002 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, 2045 { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255,
2003 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 2046 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
2004 .touch_max = 2 }; 2047 .touch_max = 2 };
2005static const struct wacom_features wacom_features_0xEC = 2048static const struct wacom_features wacom_features_0xEC =
2006 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, 2049 { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255,
2007 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; 2050 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
@@ -2143,8 +2186,11 @@ const struct usb_device_id wacom_ids[] = {
2143 { USB_DEVICE_WACOM(0x43) }, 2186 { USB_DEVICE_WACOM(0x43) },
2144 { USB_DEVICE_WACOM(0x44) }, 2187 { USB_DEVICE_WACOM(0x44) },
2145 { USB_DEVICE_WACOM(0x45) }, 2188 { USB_DEVICE_WACOM(0x45) },
2189 { USB_DEVICE_WACOM(0x57) },
2146 { USB_DEVICE_WACOM(0x59) }, 2190 { USB_DEVICE_WACOM(0x59) },
2147 { USB_DEVICE_WACOM(0x5D) }, 2191 { USB_DEVICE_DETAILED(0x5D, USB_CLASS_HID, 0, 0) },
2192 { USB_DEVICE_WACOM(0x5B) },
2193 { USB_DEVICE_DETAILED(0x5E, USB_CLASS_HID, 0, 0) },
2148 { USB_DEVICE_WACOM(0xB0) }, 2194 { USB_DEVICE_WACOM(0xB0) },
2149 { USB_DEVICE_WACOM(0xB1) }, 2195 { USB_DEVICE_WACOM(0xB1) },
2150 { USB_DEVICE_WACOM(0xB2) }, 2196 { USB_DEVICE_WACOM(0xB2) },
@@ -2205,11 +2251,12 @@ const struct usb_device_id wacom_ids[] = {
2205 { USB_DEVICE_WACOM(0x100) }, 2251 { USB_DEVICE_WACOM(0x100) },
2206 { USB_DEVICE_WACOM(0x101) }, 2252 { USB_DEVICE_WACOM(0x101) },
2207 { USB_DEVICE_WACOM(0x10D) }, 2253 { USB_DEVICE_WACOM(0x10D) },
2254 { USB_DEVICE_WACOM(0x304) },
2208 { USB_DEVICE_WACOM(0x4001) }, 2255 { USB_DEVICE_WACOM(0x4001) },
2209 { USB_DEVICE_WACOM(0x47) }, 2256 { USB_DEVICE_WACOM(0x47) },
2210 { USB_DEVICE_WACOM(0xF4) }, 2257 { USB_DEVICE_WACOM(0xF4) },
2211 { USB_DEVICE_WACOM(0xF8) }, 2258 { USB_DEVICE_WACOM(0xF8) },
2212 { USB_DEVICE_WACOM(0xF6) }, 2259 { USB_DEVICE_DETAILED(0xF6, USB_CLASS_HID, 0, 0) },
2213 { USB_DEVICE_WACOM(0xFA) }, 2260 { USB_DEVICE_WACOM(0xFA) },
2214 { USB_DEVICE_LENOVO(0x6004) }, 2261 { USB_DEVICE_LENOVO(0x6004) },
2215 { } 2262 { }
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h
index 5f9a7721e16c..dfc9e08e7f70 100644
--- a/drivers/input/tablet/wacom_wac.h
+++ b/drivers/input/tablet/wacom_wac.h
@@ -82,6 +82,7 @@ enum {
82 WACOM_24HD, 82 WACOM_24HD,
83 CINTIQ, 83 CINTIQ,
84 WACOM_BEE, 84 WACOM_BEE,
85 WACOM_13HD,
85 WACOM_MO, 86 WACOM_MO,
86 WIRELESS, 87 WIRELESS,
87 BAMBOO_PT, 88 BAMBOO_PT,
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 1602c5b6c094..ef5fcb0945e9 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -212,7 +212,7 @@ static int egalax_ts_probe(struct i2c_client *client,
212 input_set_abs_params(input_dev, 212 input_set_abs_params(input_dev,
213 ABS_MT_POSITION_X, 0, EGALAX_MAX_X, 0, 0); 213 ABS_MT_POSITION_X, 0, EGALAX_MAX_X, 0, 0);
214 input_set_abs_params(input_dev, 214 input_set_abs_params(input_dev,
215 ABS_MT_POSITION_X, 0, EGALAX_MAX_Y, 0, 0); 215 ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0);
216 input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0); 216 input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0);
217 217
218 input_set_drvdata(input_dev, ts); 218 input_set_drvdata(input_dev, ts);