Skip to content

Commit c6699b5

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov: "Two new touchpad drivers - Cypress APA I2C Trackpad and Cypress PS/2 touchpad and a big update to ALPS driver from Kevin Cernekee that adds support for "Rushmore" touchpads and paves way for adding support for "Dolphin" touchpads. There is also a new input driver for Goldfish emulator and also Android keyreset driver was folded into SysRq code. A few more drivers were updated with device tree bindings and others got some small cleanups and fixes." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (55 commits) Input: cyttsp-spi - remove duplicate MODULE_ALIAS() Input: tsc2005 - add MODULE_ALIAS Input: tegra-kbc - require CONFIG_OF, remove platform data Input: synaptics - initialize pointer emulation usage Input: MT - do not apply filtering on emulated events Input: bma150 - make some defines public and fix some comments Input: bma150 - fix checking pm_runtime_get_sync() return value Input: ALPS - enable trackstick on Rushmore touchpads Input: ALPS - add support for "Rushmore" touchpads Input: ALPS - make the V3 packet field decoder "pluggable" Input: ALPS - move pixel and bitmap info into alps_data struct Input: ALPS - fix command mode check Input: ALPS - rework detection of Pinnacle AGx touchpads Input: ALPS - move {addr,nibble}_command settings into alps_set_defaults() Input: ALPS - use function pointers for different protocol handlers Input: ALPS - rework detection sequence Input: ALPS - introduce helper function for repeated commands Input: ALPS - move alps_get_model() down below hw_init code Input: ALPS - copy "model" info into alps_data struct Input: ALPS - document the alps.h data structures ...
2 parents 5a12039 + 2d9f0d9 commit c6699b5

41 files changed

Lines changed: 3608 additions & 1182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
* Freescale i.MX Keypad Port(KPP) device tree bindings
2+
3+
The KPP is designed to interface with a keypad matrix with 2-point contact
4+
or 3-point contact keys. The KPP is designed to simplify the software task
5+
of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
6+
and decoding one or multiple keys pressed simultaneously on a keypad.
7+
8+
Required SoC Specific Properties:
9+
- compatible: Should be "fsl,<soc>-kpp".
10+
11+
- reg: Physical base address of the KPP and length of memory mapped
12+
region.
13+
14+
- interrupts: The KPP interrupt number to the CPU(s).
15+
16+
- clocks: The clock provided by the SoC to the KPP. Some SoCs use dummy
17+
clock(The clock for the KPP is provided by the SoCs automatically).
18+
19+
Required Board Specific Properties:
20+
- pinctrl-names: The definition can be found at
21+
pinctrl/pinctrl-bindings.txt.
22+
23+
- pinctrl-0: The definition can be found at
24+
pinctrl/pinctrl-bindings.txt.
25+
26+
- linux,keymap: The definition can be found at
27+
bindings/input/matrix-keymap.txt.
28+
29+
Example:
30+
kpp: kpp@73f94000 {
31+
compatible = "fsl,imx51-kpp", "fsl,imx21-kpp";
32+
reg = <0x73f94000 0x4000>;
33+
interrupts = <60>;
34+
clocks = <&clks 0>;
35+
pinctrl-names = "default";
36+
pinctrl-0 = <&pinctrl_kpp_1>;
37+
linux,keymap = <0x00000067 /* KEY_UP */
38+
0x0001006c /* KEY_DOWN */
39+
0x00020072 /* KEY_VOLUMEDOWN */
40+
0x00030066 /* KEY_HOME */
41+
0x0100006a /* KEY_RIGHT */
42+
0x01010069 /* KEY_LEFT */
43+
0x0102001c /* KEY_ENTER */
44+
0x01030073 /* KEY_VOLUMEUP */
45+
0x02000040 /* KEY_F6 */
46+
0x02010042 /* KEY_F8 */
47+
0x02020043 /* KEY_F9 */
48+
0x02030044 /* KEY_F10 */
49+
0x0300003b /* KEY_F1 */
50+
0x0301003c /* KEY_F2 */
51+
0x0302003d /* KEY_F3 */
52+
0x03030074>; /* KEY_POWER */
53+
};

Documentation/devicetree/bindings/input/nvidia,tegra20-kbc.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
* Tegra keyboard controller
2+
The key controller has maximum 24 pins to make matrix keypad. Any pin
3+
can be configured as row or column. The maximum column pin can be 8
4+
and maximum row pins can be 16 for Tegra20/Tegra30.
25

36
Required properties:
47
- compatible: "nvidia,tegra20-kbc"
8+
- reg: Register base address of KBC.
9+
- interrupts: Interrupt number for the KBC.
10+
- nvidia,kbc-row-pins: The KBC pins which are configured as row. This is an
11+
array of pin numbers which is used as rows.
12+
- nvidia,kbc-col-pins: The KBC pins which are configured as column. This is an
13+
array of pin numbers which is used as column.
14+
- linux,keymap: The keymap for keys as described in the binding document
15+
devicetree/bindings/input/matrix-keymap.txt.
516

617
Optional properties, in addition to those specified by the shared
718
matrix-keyboard bindings:
@@ -19,5 +30,16 @@ Example:
1930
keyboard: keyboard {
2031
compatible = "nvidia,tegra20-kbc";
2132
reg = <0x7000e200 0x100>;
33+
interrupts = <0 85 0x04>;
2234
nvidia,ghost-filter;
35+
nvidia,debounce-delay-ms = <640>;
36+
nvidia,kbc-row-pins = <0 1 2>; /* pin 0, 1, 2 as rows */
37+
nvidia,kbc-col-pins = <11 12 13>; /* pin 11, 12, 13 as columns */
38+
linux,keymap = <0x00000074
39+
0x00010067
40+
0x00020066
41+
0x01010068
42+
0x02000069
43+
0x02010070
44+
0x02020071>;
2345
};

drivers/input/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
menu "Input device support"
6-
depends on !S390 && !UML
6+
depends on !UML
77

88
config INPUT
99
tristate "Generic input layer (needed for keyboard, mouse, ...)" if EXPERT

drivers/input/input-mt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static void copy_abs(struct input_dev *dev, unsigned int dst, unsigned int src)
1818
{
1919
if (dev->absinfo && test_bit(src, dev->absbit)) {
2020
dev->absinfo[dst] = dev->absinfo[src];
21+
dev->absinfo[dst].fuzz = 0;
2122
dev->absbit[BIT_WORD(dst)] |= BIT_MASK(dst);
2223
}
2324
}

drivers/input/joystick/walkera0701.c

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* the Free Software Foundation.
1313
*/
1414

15-
/* #define WK0701_DEBUG */
15+
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1616

1717
#define RESERVE 20000
1818
#define SYNC_PULSE 1306000
@@ -67,6 +67,7 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w)
6767
{
6868
int i;
6969
int val1, val2, val3, val4, val5, val6, val7, val8;
70+
int magic, magic_bit;
7071
int crc1, crc2;
7172

7273
for (crc1 = crc2 = i = 0; i < 10; i++) {
@@ -102,17 +103,12 @@ static inline void walkera0701_parse_frame(struct walkera_dev *w)
102103
val8 = (w->buf[18] & 1) << 8 | (w->buf[19] << 4) | w->buf[20];
103104
val8 *= (w->buf[18] & 2) - 1; /*sign */
104105

105-
#ifdef WK0701_DEBUG
106-
{
107-
int magic, magic_bit;
108-
magic = (w->buf[21] << 4) | w->buf[22];
109-
magic_bit = (w->buf[24] & 8) >> 3;
110-
printk(KERN_DEBUG
111-
"walkera0701: %4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n",
112-
val1, val2, val3, val4, val5, val6, val7, val8, magic,
113-
magic_bit);
114-
}
115-
#endif
106+
magic = (w->buf[21] << 4) | w->buf[22];
107+
magic_bit = (w->buf[24] & 8) >> 3;
108+
pr_debug("%4d %4d %4d %4d %4d %4d %4d %4d (magic %2x %d)\n",
109+
val1, val2, val3, val4, val5, val6, val7, val8,
110+
magic, magic_bit);
111+
116112
input_report_abs(w->input_dev, ABS_X, val2);
117113
input_report_abs(w->input_dev, ABS_Y, val1);
118114
input_report_abs(w->input_dev, ABS_Z, val6);
@@ -187,6 +183,9 @@ static int walkera0701_open(struct input_dev *dev)
187183
{
188184
struct walkera_dev *w = input_get_drvdata(dev);
189185

186+
if (parport_claim(w->pardevice))
187+
return -EBUSY;
188+
190189
parport_enable_irq(w->parport);
191190
return 0;
192191
}
@@ -197,40 +196,51 @@ static void walkera0701_close(struct input_dev *dev)
197196

198197
parport_disable_irq(w->parport);
199198
hrtimer_cancel(&w->timer);
199+
200+
parport_release(w->pardevice);
200201
}
201202

202203
static int walkera0701_connect(struct walkera_dev *w, int parport)
203204
{
204-
int err = -ENODEV;
205+
int error;
205206

206207
w->parport = parport_find_number(parport);
207-
if (w->parport == NULL)
208+
if (!w->parport) {
209+
pr_err("parport %d does not exist\n", parport);
208210
return -ENODEV;
211+
}
209212

210213
if (w->parport->irq == -1) {
211-
printk(KERN_ERR "walkera0701: parport without interrupt\n");
212-
goto init_err;
214+
pr_err("parport %d does not have interrupt assigned\n",
215+
parport);
216+
error = -EINVAL;
217+
goto err_put_parport;
213218
}
214219

215-
err = -EBUSY;
216220
w->pardevice = parport_register_device(w->parport, "walkera0701",
217221
NULL, NULL, walkera0701_irq_handler,
218222
PARPORT_DEV_EXCL, w);
219-
if (!w->pardevice)
220-
goto init_err;
221-
222-
if (parport_negotiate(w->pardevice->port, IEEE1284_MODE_COMPAT))
223-
goto init_err1;
223+
if (!w->pardevice) {
224+
pr_err("failed to register parport device\n");
225+
error = -EIO;
226+
goto err_put_parport;
227+
}
224228

225-
if (parport_claim(w->pardevice))
226-
goto init_err1;
229+
if (parport_negotiate(w->pardevice->port, IEEE1284_MODE_COMPAT)) {
230+
pr_err("failed to negotiate parport mode\n");
231+
error = -EIO;
232+
goto err_unregister_device;
233+
}
227234

228235
hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
229236
w->timer.function = timer_handler;
230237

231238
w->input_dev = input_allocate_device();
232-
if (!w->input_dev)
233-
goto init_err2;
239+
if (!w->input_dev) {
240+
pr_err("failed to allocate input device\n");
241+
error = -ENOMEM;
242+
goto err_unregister_device;
243+
}
234244

235245
input_set_drvdata(w->input_dev, w);
236246
w->input_dev->name = "Walkera WK-0701 TX";
@@ -241,6 +251,7 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
241251
w->input_dev->id.vendor = 0x0001;
242252
w->input_dev->id.product = 0x0001;
243253
w->input_dev->id.version = 0x0100;
254+
w->input_dev->dev.parent = w->parport->dev;
244255
w->input_dev->open = walkera0701_open;
245256
w->input_dev->close = walkera0701_close;
246257

@@ -254,27 +265,26 @@ static int walkera0701_connect(struct walkera_dev *w, int parport)
254265
input_set_abs_params(w->input_dev, ABS_RUDDER, -512, 512, 0, 0);
255266
input_set_abs_params(w->input_dev, ABS_MISC, -512, 512, 0, 0);
256267

257-
err = input_register_device(w->input_dev);
258-
if (err)
259-
goto init_err3;
268+
error = input_register_device(w->input_dev);
269+
if (error) {
270+
pr_err("failed to register input device\n");
271+
goto err_free_input_dev;
272+
}
260273

261274
return 0;
262275

263-
init_err3:
276+
err_free_input_dev:
264277
input_free_device(w->input_dev);
265-
init_err2:
266-
parport_release(w->pardevice);
267-
init_err1:
278+
err_unregister_device:
268279
parport_unregister_device(w->pardevice);
269-
init_err:
280+
err_put_parport:
270281
parport_put_port(w->parport);
271-
return err;
282+
return error;
272283
}
273284

274285
static void walkera0701_disconnect(struct walkera_dev *w)
275286
{
276287
input_unregister_device(w->input_dev);
277-
parport_release(w->pardevice);
278288
parport_unregister_device(w->pardevice);
279289
parport_put_port(w->parport);
280290
}

drivers/input/keyboard/Kconfig

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ config KEYBOARD_TCA6416
224224

225225
config KEYBOARD_TCA8418
226226
tristate "TCA8418 Keypad Support"
227-
depends on I2C
227+
depends on I2C && GENERIC_HARDIRQS
228228
select INPUT_MATRIXKMAP
229229
help
230230
This driver implements basic keypad functionality
@@ -303,7 +303,7 @@ config KEYBOARD_HP7XX
303303

304304
config KEYBOARD_LM8323
305305
tristate "LM8323 keypad chip"
306-
depends on I2C
306+
depends on I2C && GENERIC_HARDIRQS
307307
depends on LEDS_CLASS
308308
help
309309
If you say yes here you get support for the National Semiconductor
@@ -420,7 +420,7 @@ config KEYBOARD_NOMADIK
420420

421421
config KEYBOARD_TEGRA
422422
tristate "NVIDIA Tegra internal matrix keyboard controller support"
423-
depends on ARCH_TEGRA
423+
depends on ARCH_TEGRA && OF
424424
select INPUT_MATRIXKMAP
425425
help
426426
Say Y here if you want to use a matrix keyboard connected directly
@@ -479,6 +479,16 @@ config KEYBOARD_SAMSUNG
479479
To compile this driver as a module, choose M here: the
480480
module will be called samsung-keypad.
481481

482+
config KEYBOARD_GOLDFISH_EVENTS
483+
depends on GOLDFISH
484+
tristate "Generic Input Event device for Goldfish"
485+
help
486+
Say Y here to get an input event device for the Goldfish virtual
487+
device emulator.
488+
489+
To compile this driver as a module, choose M here: the
490+
module will be called goldfish-events.
491+
482492
config KEYBOARD_STOWAWAY
483493
tristate "Stowaway keyboard"
484494
select SERIO

drivers/input/keyboard/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ obj-$(CONFIG_KEYBOARD_ATKBD) += atkbd.o
1313
obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o
1414
obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o
1515
obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o
16+
obj-$(CONFIG_KEYBOARD_GOLDFISH_EVENTS) += goldfish_events.o
1617
obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o
1718
obj-$(CONFIG_KEYBOARD_GPIO_POLLED) += gpio_keys_polled.o
1819
obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o

0 commit comments

Comments
 (0)