Skip to content

Commit 4937e2a

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: "Updates for the input subsystem. You will get an new drivers for Hyper-V synthetic keyboard and for Neonode zForce touchscreens, plus a bunch of driver fixes and cleanups" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (49 commits) Revert "Input: ALPS - add support for model found on Dell XT2" arm: dts: am335x sk: add touchscreen support Input: ti_am335x_tsc - fix spelling mistake in TSC/ADC DT binding Input: cyttsp4 - replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO Input: mma8450 - add missing i2c_set_clientdata() in mma8450_probe() Input: mpu3050 - add missing i2c_set_clientdata() in mpu3050_probe() Input: tnetv107x-keypad - make irqs signed for error handling Input: add driver for Neonode zForce based touchscreens Input: sh_keysc - enable the driver on all ARM platforms Input: remove a redundant max() call Input: mousedev - allow disabling even without CONFIG_EXPERT Input: allow deselecting serio drivers even without CONFIG_EXPERT Input: i8042 - add PNP modaliases Input: evdev - fall back to vmalloc for client event buffer Input: cypress_ps2 - do not consider data bad if palm is detected Input: cypress_ps2 - remove useless cast Input: fix PWM-related undefined reference errors Input: ALPS - change secondary device's name Input: wacom - not all multi-interface devices support touch Input: nspire-keypad - add missing clk_disable_unprepare() on error path ...
2 parents db0b2d0 + 4224909 commit 4937e2a

Some content is hidden

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

47 files changed

+1585
-128
lines changed

Documentation/devicetree/bindings/input/touchscreen/ti-tsc-adc.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Required properties:
66
ti,wires: Wires refer to application modes i.e. 4/5/8 wire touchscreen
77
support on the platform.
88
ti,x-plate-resistance: X plate resistance
9-
ti,coordiante-readouts: The sequencer supports a total of 16
9+
ti,coordinate-readouts: The sequencer supports a total of 16
1010
programmable steps each step is used to
1111
read a single coordinate. A single
1212
readout is enough but multiple reads can

Documentation/input/gamepad.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,14 @@ D-Pad:
122122
BTN_DPAD_*
123123
Analog buttons are reported as:
124124
ABS_HAT0X and ABS_HAT0Y
125+
(for ABS values negative is left/up, positive is right/down)
125126

126127
Analog-Sticks:
127128
The left analog-stick is reported as ABS_X, ABS_Y. The right analog stick is
128129
reported as ABS_RX, ABS_RY. Zero, one or two sticks may be present.
129130
If analog-sticks provide digital buttons, they are mapped accordingly as
130131
BTN_THUMBL (first/left) and BTN_THUMBR (second/right).
132+
(for ABS values negative is left/up, positive is right/down)
131133

132134
Triggers:
133135
Trigger buttons can be available as digital or analog buttons or both. User-
@@ -138,6 +140,7 @@ Triggers:
138140
ABS_HAT2X (right/ZR) and BTN_TL2 or ABS_HAT2Y (left/ZL).
139141
If only one trigger-button combination is present (upper+lower), they are
140142
reported as "right" triggers (BTN_TR/ABS_HAT1X).
143+
(ABS trigger values start at 0, pressure is reported as positive values)
141144

142145
Menu-Pad:
143146
Menu buttons are always digital and are mapped according to their location

arch/arm/boot/dts/am335x-evm.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@
630630
tsc {
631631
ti,wires = <4>;
632632
ti,x-plate-resistance = <200>;
633-
ti,coordiante-readouts = <5>;
633+
ti,coordinate-readouts = <5>;
634634
ti,wire-config = <0x00 0x11 0x22 0x33>;
635635
};
636636

arch/arm/boot/dts/am335x-evmsk.dts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,3 +485,13 @@
485485
tx-num-evt = <1>;
486486
rx-num-evt = <1>;
487487
};
488+
489+
&tscadc {
490+
status = "okay";
491+
tsc {
492+
ti,wires = <4>;
493+
ti,x-plate-resistance = <200>;
494+
ti,coordinate-readouts = <5>;
495+
ti,wire-config = <0x00 0x11 0x22 0x33>;
496+
};
497+
};

drivers/input/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ config INPUT_MATRIXKMAP
8080
comment "Userland interfaces"
8181

8282
config INPUT_MOUSEDEV
83-
tristate "Mouse interface" if EXPERT
83+
tristate "Mouse interface"
8484
default y
8585
help
8686
Say Y here if you want your mouse to be accessible as char devices

drivers/input/evdev.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include <linux/poll.h>
1919
#include <linux/sched.h>
2020
#include <linux/slab.h>
21+
#include <linux/vmalloc.h>
22+
#include <linux/mm.h>
2123
#include <linux/module.h>
2224
#include <linux/init.h>
2325
#include <linux/input/mt.h>
@@ -369,7 +371,11 @@ static int evdev_release(struct inode *inode, struct file *file)
369371
mutex_unlock(&evdev->mutex);
370372

371373
evdev_detach_client(evdev, client);
372-
kfree(client);
374+
375+
if (is_vmalloc_addr(client))
376+
vfree(client);
377+
else
378+
kfree(client);
373379

374380
evdev_close_device(evdev);
375381

@@ -389,12 +395,14 @@ static int evdev_open(struct inode *inode, struct file *file)
389395
{
390396
struct evdev *evdev = container_of(inode->i_cdev, struct evdev, cdev);
391397
unsigned int bufsize = evdev_compute_buffer_size(evdev->handle.dev);
398+
unsigned int size = sizeof(struct evdev_client) +
399+
bufsize * sizeof(struct input_event);
392400
struct evdev_client *client;
393401
int error;
394402

395-
client = kzalloc(sizeof(struct evdev_client) +
396-
bufsize * sizeof(struct input_event),
397-
GFP_KERNEL);
403+
client = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);
404+
if (!client)
405+
client = vzalloc(size);
398406
if (!client)
399407
return -ENOMEM;
400408

drivers/input/input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2052,7 +2052,7 @@ int input_register_device(struct input_dev *dev)
20522052
if (dev->hint_events_per_packet < packet_size)
20532053
dev->hint_events_per_packet = packet_size;
20542054

2055-
dev->max_vals = max(dev->hint_events_per_packet, packet_size) + 2;
2055+
dev->max_vals = dev->hint_events_per_packet + 2;
20562056
dev->vals = kcalloc(dev->max_vals, sizeof(*dev->vals), GFP_KERNEL);
20572057
if (!dev->vals) {
20582058
error = -ENOMEM;

drivers/input/keyboard/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Input core configuration
33
#
44
menuconfig INPUT_KEYBOARD
5-
bool "Keyboards" if EXPERT || !X86
5+
bool "Keyboards"
66
default y
77
help
88
Say Y here, and a list of supported keyboards will be displayed.
@@ -67,7 +67,7 @@ config KEYBOARD_ATARI
6767
module will be called atakbd.
6868

6969
config KEYBOARD_ATKBD
70-
tristate "AT keyboard" if EXPERT || !X86
70+
tristate "AT keyboard"
7171
default y
7272
select SERIO
7373
select SERIO_LIBPS2
@@ -525,7 +525,7 @@ config KEYBOARD_SUNKBD
525525

526526
config KEYBOARD_SH_KEYSC
527527
tristate "SuperH KEYSC keypad support"
528-
depends on SUPERH || ARCH_SHMOBILE
528+
depends on SUPERH || ARM || COMPILE_TEST
529529
help
530530
Say Y here if you want to use a keypad attached to the KEYSC block
531531
on SuperH processors such as sh7722 and sh7343.

drivers/input/keyboard/gpio_keys.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/gpio_keys.h>
2727
#include <linux/workqueue.h>
2828
#include <linux/gpio.h>
29+
#include <linux/of.h>
2930
#include <linux/of_platform.h>
3031
#include <linux/of_gpio.h>
3132
#include <linux/spinlock.h>

drivers/input/keyboard/gpio_keys_polled.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/platform_device.h>
2626
#include <linux/gpio.h>
2727
#include <linux/gpio_keys.h>
28+
#include <linux/of.h>
2829
#include <linux/of_platform.h>
2930
#include <linux/of_gpio.h>
3031

drivers/input/keyboard/lpc32xx-keys.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ static struct platform_driver lpc32xx_kscan_driver = {
383383
.name = DRV_NAME,
384384
.owner = THIS_MODULE,
385385
.pm = &lpc32xx_kscan_pm_ops,
386-
.of_match_table = of_match_ptr(lpc32xx_kscan_match),
386+
.of_match_table = lpc32xx_kscan_match,
387387
}
388388
};
389389

drivers/input/keyboard/nspire-keypad.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ static int nspire_keypad_open(struct input_dev *input)
143143
return error;
144144

145145
error = nspire_keypad_chip_init(keypad);
146-
if (error)
146+
if (error) {
147+
clk_disable_unprepare(keypad->clk);
147148
return error;
149+
}
148150

149151
return 0;
150152
}
@@ -267,7 +269,7 @@ static struct platform_driver nspire_keypad_driver = {
267269
.driver = {
268270
.name = "nspire-keypad",
269271
.owner = THIS_MODULE,
270-
.of_match_table = of_match_ptr(nspire_keypad_dt_match),
272+
.of_match_table = nspire_keypad_dt_match,
271273
},
272274
.probe = nspire_keypad_probe,
273275
};

drivers/input/keyboard/pxa27x_keypad.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/err.h>
2828
#include <linux/input/matrix_keypad.h>
2929
#include <linux/slab.h>
30+
#include <linux/of.h>
3031

3132
#include <asm/mach/arch.h>
3233
#include <asm/mach/map.h>

drivers/input/keyboard/tegra-kbc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ static int tegra_kbc_probe(struct platform_device *pdev)
614614
unsigned int keymap_rows;
615615
const struct of_device_id *match;
616616

617-
match = of_match_device(of_match_ptr(tegra_kbc_of_match), &pdev->dev);
617+
match = of_match_device(tegra_kbc_of_match, &pdev->dev);
618618

619619
kbc = devm_kzalloc(&pdev->dev, sizeof(*kbc), GFP_KERNEL);
620620
if (!kbc) {

drivers/input/keyboard/tnetv107x-keypad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ struct keypad_data {
6060
struct clk *clk;
6161
struct device *dev;
6262
spinlock_t lock;
63-
u32 irq_press;
64-
u32 irq_release;
63+
int irq_press;
64+
int irq_release;
6565
int rows, cols, row_shift;
6666
int debounce_ms, active_low;
6767
u32 prev_keys[3];

drivers/input/misc/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ config INPUT_MAX8925_ONKEY
156156

157157
config INPUT_MAX8997_HAPTIC
158158
tristate "MAXIM MAX8997 haptic controller support"
159-
depends on HAVE_PWM && MFD_MAX8997
159+
depends on PWM && HAVE_PWM && MFD_MAX8997
160160
select INPUT_FF_MEMLESS
161161
help
162162
This option enables device driver support for the haptic controller
@@ -461,7 +461,7 @@ config INPUT_PCF8574
461461

462462
config INPUT_PWM_BEEPER
463463
tristate "PWM beeper support"
464-
depends on HAVE_PWM || PWM
464+
depends on PWM && HAVE_PWM
465465
help
466466
Say Y here to get support for PWM based beeper devices.
467467

drivers/input/misc/ad714x-spi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ static int ad714x_spi_remove(struct spi_device *spi)
108108
struct ad714x_chip *chip = spi_get_drvdata(spi);
109109

110110
ad714x_remove(chip);
111-
spi_set_drvdata(spi, NULL);
112111

113112
return 0;
114113
}

drivers/input/misc/cobalt_btns.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ static int cobalt_buttons_probe(struct platform_device *pdev)
131131
err_free_mem:
132132
input_free_polled_device(poll_dev);
133133
kfree(bdev);
134-
dev_set_drvdata(&pdev->dev, NULL);
135134
return error;
136135
}
137136

@@ -144,7 +143,6 @@ static int cobalt_buttons_remove(struct platform_device *pdev)
144143
input_free_polled_device(bdev->poll_dev);
145144
iounmap(bdev->reg);
146145
kfree(bdev);
147-
dev_set_drvdata(dev, NULL);
148146

149147
return 0;
150148
}

drivers/input/misc/mma8450.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static void mma8450_close(struct input_polled_dev *dev)
168168
* I2C init/probing/exit functions
169169
*/
170170
static int mma8450_probe(struct i2c_client *c,
171-
const struct i2c_device_id *id)
171+
const struct i2c_device_id *id)
172172
{
173173
struct input_polled_dev *idev;
174174
struct mma8450 *m;
@@ -204,6 +204,8 @@ static int mma8450_probe(struct i2c_client *c,
204204
goto err_free_mem;
205205
}
206206

207+
i2c_set_clientdata(c, m);
208+
207209
return 0;
208210

209211
err_free_mem:

drivers/input/misc/mpu3050.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ static int mpu3050_probe(struct i2c_client *client,
383383

384384
pm_runtime_enable(&client->dev);
385385
pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
386+
i2c_set_clientdata(client, sensor);
386387

387388
return 0;
388389

drivers/input/misc/pwm-beeper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/input.h>
1717
#include <linux/module.h>
1818
#include <linux/kernel.h>
19+
#include <linux/of.h>
1920
#include <linux/platform_device.h>
2021
#include <linux/pwm.h>
2122
#include <linux/slab.h>

drivers/input/misc/rb532_button.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ static int rb532_button_remove(struct platform_device *pdev)
8787

8888
input_unregister_polled_device(poll_dev);
8989
input_free_polled_device(poll_dev);
90-
dev_set_drvdata(&pdev->dev, NULL);
9190

9291
return 0;
9392
}

drivers/input/misc/rotary_encoder.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/gpio.h>
2525
#include <linux/rotary_encoder.h>
2626
#include <linux/slab.h>
27+
#include <linux/of.h>
2728
#include <linux/of_platform.h>
2829
#include <linux/of_gpio.h>
2930

drivers/input/misc/sirfsoc-onkey.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {
153153
.name = "sirfsoc-pwrc",
154154
.owner = THIS_MODULE,
155155
.pm = &sirfsoc_pwrc_pm_ops,
156-
.of_match_table = of_match_ptr(sirfsoc_pwrc_of_match),
156+
.of_match_table = sirfsoc_pwrc_of_match,
157157
}
158158
};
159159

drivers/input/misc/uinput.c

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -430,20 +430,30 @@ static int uinput_setup_device(struct uinput_device *udev,
430430
return retval;
431431
}
432432

433-
static ssize_t uinput_inject_event(struct uinput_device *udev,
434-
const char __user *buffer, size_t count)
433+
static ssize_t uinput_inject_events(struct uinput_device *udev,
434+
const char __user *buffer, size_t count)
435435
{
436436
struct input_event ev;
437+
size_t bytes = 0;
437438

438-
if (count < input_event_size())
439+
if (count != 0 && count < input_event_size())
439440
return -EINVAL;
440441

441-
if (input_event_from_user(buffer, &ev))
442-
return -EFAULT;
442+
while (bytes + input_event_size() <= count) {
443+
/*
444+
* Note that even if some events were fetched successfully
445+
* we are still going to return EFAULT instead of partial
446+
* count to let userspace know that it got it's buffers
447+
* all wrong.
448+
*/
449+
if (input_event_from_user(buffer + bytes, &ev))
450+
return -EFAULT;
443451

444-
input_event(udev->dev, ev.type, ev.code, ev.value);
452+
input_event(udev->dev, ev.type, ev.code, ev.value);
453+
bytes += input_event_size();
454+
}
445455

446-
return input_event_size();
456+
return bytes;
447457
}
448458

449459
static ssize_t uinput_write(struct file *file, const char __user *buffer,
@@ -460,7 +470,7 @@ static ssize_t uinput_write(struct file *file, const char __user *buffer,
460470
return retval;
461471

462472
retval = udev->state == UIST_CREATED ?
463-
uinput_inject_event(udev, buffer, count) :
473+
uinput_inject_events(udev, buffer, count) :
464474
uinput_setup_device(udev, buffer, count);
465475

466476
mutex_unlock(&udev->mutex);

drivers/input/mouse/alps.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ static const struct alps_model_info alps_model_data[] = {
103103
/* Dell Latitude E5500, E6400, E6500, Precision M4400 */
104104
{ { 0x62, 0x02, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf,
105105
ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED },
106-
{ { 0x73, 0x00, 0x14 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_DUALPOINT }, /* Dell XT2 */
107106
{ { 0x73, 0x02, 0x50 }, 0x00, ALPS_PROTO_V2, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */
108107
{ { 0x52, 0x01, 0x14 }, 0x00, ALPS_PROTO_V2, 0xff, 0xff,
109108
ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */
@@ -1793,7 +1792,7 @@ int alps_init(struct psmouse *psmouse)
17931792
snprintf(priv->phys, sizeof(priv->phys), "%s/input1", psmouse->ps2dev.serio->phys);
17941793
dev2->phys = priv->phys;
17951794
dev2->name = (priv->flags & ALPS_DUALPOINT) ?
1796-
"DualPoint Stick" : "PS/2 Mouse";
1795+
"DualPoint Stick" : "ALPS PS/2 Device";
17971796
dev2->id.bustype = BUS_I8042;
17981797
dev2->id.vendor = 0x0002;
17991798
dev2->id.product = PSMOUSE_ALPS;

0 commit comments

Comments
 (0)