Skip to content

Commit 2c01e7b

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer updates from Dmitry Torokhov: - a bunch of new drivers (DA9052/53 touchscreenn controller, Synaptics Navpoint, LM8333 keypads, Wacom I2C touhscreen); - updates to existing touchpad drivers (ALPS, Sntelic); - Wacom driver now supports Intuos5; - device-tree bindings in numerous drivers; - other cleanups and fixes. Fix annoying conflict in drivers/input/tablet/wacom_wac.c that I think implies that the input layer device naming is broken, but let's see. I brough it up with Dmitry. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (57 commits) Input: matrix-keymap - fix building keymaps Input: spear-keyboard - document DT bindings Input: spear-keyboard - add device tree bindings Input: matrix-keymap - wire up device tree support Input: matrix-keymap - uninline and prepare for device tree support Input: adp5588 - add support for gpio names Input: omap-keypad - dynamically handle register offsets Input: synaptics - fix compile warning MAINTAINERS: adjust input-related patterns Input: ALPS - switch to using input_mt_report_finger_count Input: ALPS - add semi-MT support for v4 protocol Input: Add Synaptics NavPoint (PXA27x SSP/SPI) driver Input: atmel_mxt_ts - dump each message on just 1 line Input: atmel_mxt_ts - do not read extra (checksum) byte Input: atmel_mxt_ts - verify object size in mxt_write_object Input: atmel_mxt_ts - only allow root to update firmware Input: atmel_mxt_ts - use CONFIG_PM_SLEEP Input: sentelic - report device's production serial number Input: tl6040-vibra - Device Tree support Input: evdev - properly handle read/write with count 0 ...
2 parents ab11ca3 + e644dae commit 2c01e7b

106 files changed

Lines changed: 2845 additions & 1305 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/ABI/testing/sysfs-driver-wacom‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ Contact: linux-input@vger.kernel.org
2323
Description:
2424
Attribute group for control of the status LEDs and the OLEDs.
2525
This attribute group is only available for Intuos 4 M, L,
26-
and XL (with LEDs and OLEDs) and Cintiq 21UX2 and Cintiq 24HD
27-
(LEDs only). Therefore its presence implicitly signifies the
28-
presence of said LEDs and OLEDs on the tablet device.
26+
and XL (with LEDs and OLEDs), Intuos 5 (LEDs only), and Cintiq
27+
21UX2 and Cintiq 24HD (LEDs only). Therefore its presence
28+
implicitly signifies the presence of said LEDs and OLEDs on the
29+
tablet device.
2930

3031
What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status0_luminance
3132
Date: August 2011
@@ -48,10 +49,10 @@ What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led0
4849
Date: August 2011
4950
Contact: linux-input@vger.kernel.org
5051
Description:
51-
Writing to this file sets which one of the four (for Intuos 4)
52-
or of the right four (for Cintiq 21UX2 and Cintiq 24HD) status
53-
LEDs is active (0..3). The other three LEDs on the same side are
54-
always inactive.
52+
Writing to this file sets which one of the four (for Intuos 4
53+
and Intuos 5) or of the right four (for Cintiq 21UX2 and Cintiq
54+
24HD) status LEDs is active (0..3). The other three LEDs on the
55+
same side are always inactive.
5556

5657
What: /sys/bus/usb/devices/<busnum>-<devnum>:<cfg>.<intf>/wacom_led/status_led1_select
5758
Date: September 2011
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
* SPEAr keyboard controller
2+
3+
Required properties:
4+
- compatible: "st,spear300-kbd"
5+
6+
Optional properties, in addition to those specified by the shared
7+
matrix-keyboard bindings:
8+
- autorepeat: bool: enables key autorepeat
9+
- st,mode: keyboard mode: 0 - 9x9, 1 - 6x6, 2 - 2x2
10+
11+
Example:
12+
13+
kbd@fc400000 {
14+
compatible = "st,spear300-kbd";
15+
reg = <0xfc400000 0x100>;
16+
linux,keymap = < 0x00030012
17+
0x0102003a >;
18+
autorepeat;
19+
st,mode = <0>;
20+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
* NXP LPC32xx SoC Touchscreen Controller (TSC)
2+
3+
Required properties:
4+
- compatible: must be "nxp,lpc3220-tsc"
5+
- reg: physical base address of the controller and length of memory mapped
6+
region.
7+
- interrupts: The TSC/ADC interrupt
8+
9+
Example:
10+
11+
tsc@40048000 {
12+
compatible = "nxp,lpc3220-tsc";
13+
reg = <0x40048000 0x1000>;
14+
interrupt-parent = <&mic>;
15+
interrupts = <39 0>;
16+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Vibra driver for the twl6040 family
2+
3+
The vibra driver is a child of the twl6040 MFD dirver.
4+
Documentation/devicetree/bindings/mfd/twl6040.txt
5+
6+
Required properties:
7+
- compatible : Must be "ti,twl6040-vibra";
8+
- interrupts: 4, Vibra overcurrent interrupt
9+
- vddvibl-supply: Regulator supplying the left vibra motor
10+
- vddvibr-supply: Regulator supplying the right vibra motor
11+
- vibldrv_res: Board specific left driver resistance
12+
- vibrdrv_res: Board specific right driver resistance
13+
- viblmotor_res: Board specific left motor resistance
14+
- vibrmotor_res: Board specific right motor resistance
15+
16+
Optional properties:
17+
- vddvibl_uV: If the vddvibl default voltage need to be changed
18+
- vddvibr_uV: If the vddvibr default voltage need to be changed
19+
20+
Example:
21+
/*
22+
* 8-channel high quality low-power audio codec
23+
* http://www.ti.com/lit/ds/symlink/twl6040.pdf
24+
*/
25+
twl6040: twl6040@4b {
26+
...
27+
twl6040_vibra: twl6040@1 {
28+
compatible = "ti,twl6040-vibra";
29+
interrupts = <4>;
30+
vddvibl-supply = <&vbat>;
31+
vddvibr-supply = <&vbat>;
32+
vibldrv_res = <8>;
33+
vibrdrv_res = <3>;
34+
viblmotor_res = <10>;
35+
vibrmotor_res = <10>;
36+
};
37+
};

‎MAINTAINERS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,6 +3465,8 @@ Q: http://patchwork.kernel.org/project/linux-input/list/
34653465
T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
34663466
S: Maintained
34673467
F: drivers/input/
3468+
F: include/linux/input.h
3469+
F: include/linux/input/
34683470

34693471
INPUT MULTITOUCH (MT) PROTOCOL
34703472
M: Henrik Rydberg <rydberg@euromail.se>

‎drivers/input/Kconfig‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ config INPUT
2525

2626
if INPUT
2727

28-
config INPUT_OF_MATRIX_KEYMAP
29-
depends on USE_OF
30-
bool
31-
3228
config INPUT_FF_MEMLESS
3329
tristate "Support for memoryless force-feedback devices"
3430
help
@@ -68,6 +64,19 @@ config INPUT_SPARSEKMAP
6864
To compile this driver as a module, choose M here: the
6965
module will be called sparse-keymap.
7066

67+
config INPUT_MATRIXKMAP
68+
tristate "Matrix keymap support library"
69+
help
70+
Say Y here if you are using a driver for an input
71+
device that uses matrix keymap. This option is only
72+
useful for out-of-tree drivers since in-tree drivers
73+
select it automatically.
74+
75+
If unsure, say N.
76+
77+
To compile this driver as a module, choose M here: the
78+
module will be called matrix-keymap.
79+
7180
comment "Userland interfaces"
7281

7382
config INPUT_MOUSEDEV

‎drivers/input/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ input-core-y := input.o input-compat.o input-mt.o ff-core.o
1010
obj-$(CONFIG_INPUT_FF_MEMLESS) += ff-memless.o
1111
obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
1212
obj-$(CONFIG_INPUT_SPARSEKMAP) += sparse-keymap.o
13+
obj-$(CONFIG_INPUT_MATRIXKMAP) += matrix-keymap.o
1314

1415
obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o
1516
obj-$(CONFIG_INPUT_JOYDEV) += joydev.o
@@ -24,4 +25,3 @@ obj-$(CONFIG_INPUT_TOUCHSCREEN) += touchscreen/
2425
obj-$(CONFIG_INPUT_MISC) += misc/
2526

2627
obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
27-
obj-$(CONFIG_INPUT_OF_MATRIX_KEYMAP) += of_keymap.o

‎drivers/input/evdev.c‎

Lines changed: 43 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ static int evdev_grab(struct evdev *evdev, struct evdev_client *client)
180180

181181
static int evdev_ungrab(struct evdev *evdev, struct evdev_client *client)
182182
{
183-
if (evdev->grab != client)
183+
struct evdev_client *grab = rcu_dereference_protected(evdev->grab,
184+
lockdep_is_held(&evdev->mutex));
185+
186+
if (grab != client)
184187
return -EINVAL;
185188

186189
rcu_assign_pointer(evdev->grab, NULL);
@@ -259,8 +262,7 @@ static int evdev_release(struct inode *inode, struct file *file)
259262
struct evdev *evdev = client->evdev;
260263

261264
mutex_lock(&evdev->mutex);
262-
if (evdev->grab == client)
263-
evdev_ungrab(evdev, client);
265+
evdev_ungrab(evdev, client);
264266
mutex_unlock(&evdev->mutex);
265267

266268
evdev_detach_client(evdev, client);
@@ -343,7 +345,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
343345
struct input_event event;
344346
int retval = 0;
345347

346-
if (count < input_event_size())
348+
if (count != 0 && count < input_event_size())
347349
return -EINVAL;
348350

349351
retval = mutex_lock_interruptible(&evdev->mutex);
@@ -355,7 +357,8 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
355357
goto out;
356358
}
357359

358-
do {
360+
while (retval + input_event_size() <= count) {
361+
359362
if (input_event_from_user(buffer + retval, &event)) {
360363
retval = -EFAULT;
361364
goto out;
@@ -364,7 +367,7 @@ static ssize_t evdev_write(struct file *file, const char __user *buffer,
364367

365368
input_inject_event(&evdev->handle,
366369
event.type, event.code, event.value);
367-
} while (retval + input_event_size() <= count);
370+
}
368371

369372
out:
370373
mutex_unlock(&evdev->mutex);
@@ -395,35 +398,49 @@ static ssize_t evdev_read(struct file *file, char __user *buffer,
395398
struct evdev_client *client = file->private_data;
396399
struct evdev *evdev = client->evdev;
397400
struct input_event event;
398-
int retval = 0;
401+
size_t read = 0;
402+
int error;
399403

400-
if (count < input_event_size())
404+
if (count != 0 && count < input_event_size())
401405
return -EINVAL;
402406

403-
if (!(file->f_flags & O_NONBLOCK)) {
404-
retval = wait_event_interruptible(evdev->wait,
405-
client->packet_head != client->tail ||
406-
!evdev->exist);
407-
if (retval)
408-
return retval;
409-
}
407+
for (;;) {
408+
if (!evdev->exist)
409+
return -ENODEV;
410410

411-
if (!evdev->exist)
412-
return -ENODEV;
411+
if (client->packet_head == client->tail &&
412+
(file->f_flags & O_NONBLOCK))
413+
return -EAGAIN;
413414

414-
while (retval + input_event_size() <= count &&
415-
evdev_fetch_next_event(client, &event)) {
415+
/*
416+
* count == 0 is special - no IO is done but we check
417+
* for error conditions (see above).
418+
*/
419+
if (count == 0)
420+
break;
416421

417-
if (input_event_to_user(buffer + retval, &event))
418-
return -EFAULT;
422+
while (read + input_event_size() <= count &&
423+
evdev_fetch_next_event(client, &event)) {
419424

420-
retval += input_event_size();
421-
}
425+
if (input_event_to_user(buffer + read, &event))
426+
return -EFAULT;
422427

423-
if (retval == 0 && (file->f_flags & O_NONBLOCK))
424-
return -EAGAIN;
428+
read += input_event_size();
429+
}
425430

426-
return retval;
431+
if (read)
432+
break;
433+
434+
if (!(file->f_flags & O_NONBLOCK)) {
435+
error = wait_event_interruptible(evdev->wait,
436+
client->packet_head != client->tail ||
437+
!evdev->exist);
438+
if (error)
439+
return error;
440+
}
441+
}
442+
443+
return read;
427444
}
428445

429446
/* No kernel lock - fine */

‎drivers/input/gameport/emu10k1-gp.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,4 @@ static struct pci_driver emu_driver = {
125125
.remove = __devexit_p(emu_remove),
126126
};
127127

128-
static int __init emu_init(void)
129-
{
130-
return pci_register_driver(&emu_driver);
131-
}
132-
133-
static void __exit emu_exit(void)
134-
{
135-
pci_unregister_driver(&emu_driver);
136-
}
137-
138-
module_init(emu_init);
139-
module_exit(emu_exit);
128+
module_pci_driver(emu_driver);

‎drivers/input/gameport/fm801-gp.c‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ static const struct pci_device_id fm801_gp_id_table[] = {
144144
{ PCI_VENDOR_ID_FORTEMEDIA, PCI_DEVICE_ID_FM801_GP, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
145145
{ 0 }
146146
};
147+
MODULE_DEVICE_TABLE(pci, fm801_gp_id_table);
147148

148149
static struct pci_driver fm801_gp_driver = {
149150
.name = "FM801_gameport",
@@ -152,20 +153,7 @@ static struct pci_driver fm801_gp_driver = {
152153
.remove = __devexit_p(fm801_gp_remove),
153154
};
154155

155-
static int __init fm801_gp_init(void)
156-
{
157-
return pci_register_driver(&fm801_gp_driver);
158-
}
159-
160-
static void __exit fm801_gp_exit(void)
161-
{
162-
pci_unregister_driver(&fm801_gp_driver);
163-
}
164-
165-
module_init(fm801_gp_init);
166-
module_exit(fm801_gp_exit);
167-
168-
MODULE_DEVICE_TABLE(pci, fm801_gp_id_table);
156+
module_pci_driver(fm801_gp_driver);
169157

170158
MODULE_DESCRIPTION("FM801 gameport driver");
171159
MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");

0 commit comments

Comments
 (0)