aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 19:43:53 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-11-15 19:43:53 -0500
commit4937e2a6f939a41bf811378e80d71f68aa0950c6 (patch)
treeed8ac843c96f01cd054542169afc968ec5d96189 /drivers/input/misc
parentdb0b2d01163cc3050eb52a979541e0d16553be48 (diff)
parent42249094f79422fbf5ed4b54eeb48ff096809b8f (diff)
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 ...
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/Kconfig4
-rw-r--r--drivers/input/misc/ad714x-spi.c1
-rw-r--r--drivers/input/misc/cobalt_btns.c2
-rw-r--r--drivers/input/misc/mma8450.c4
-rw-r--r--drivers/input/misc/mpu3050.c1
-rw-r--r--drivers/input/misc/pwm-beeper.c1
-rw-r--r--drivers/input/misc/rb532_button.c1
-rw-r--r--drivers/input/misc/rotary_encoder.c1
-rw-r--r--drivers/input/misc/sirfsoc-onkey.c2
-rw-r--r--drivers/input/misc/uinput.c26
10 files changed, 27 insertions, 16 deletions
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
index aa51baaa9b1e..5f4967d01bc3 100644
--- a/drivers/input/misc/Kconfig
+++ b/drivers/input/misc/Kconfig
@@ -156,7 +156,7 @@ config INPUT_MAX8925_ONKEY
156 156
157config INPUT_MAX8997_HAPTIC 157config INPUT_MAX8997_HAPTIC
158 tristate "MAXIM MAX8997 haptic controller support" 158 tristate "MAXIM MAX8997 haptic controller support"
159 depends on HAVE_PWM && MFD_MAX8997 159 depends on PWM && HAVE_PWM && MFD_MAX8997
160 select INPUT_FF_MEMLESS 160 select INPUT_FF_MEMLESS
161 help 161 help
162 This option enables device driver support for the haptic controller 162 This option enables device driver support for the haptic controller
@@ -461,7 +461,7 @@ config INPUT_PCF8574
461 461
462config INPUT_PWM_BEEPER 462config INPUT_PWM_BEEPER
463 tristate "PWM beeper support" 463 tristate "PWM beeper support"
464 depends on HAVE_PWM || PWM 464 depends on PWM && HAVE_PWM
465 help 465 help
466 Say Y here to get support for PWM based beeper devices. 466 Say Y here to get support for PWM based beeper devices.
467 467
diff --git a/drivers/input/misc/ad714x-spi.c b/drivers/input/misc/ad714x-spi.c
index 61891486067c..3a90b710e309 100644
--- a/drivers/input/misc/ad714x-spi.c
+++ b/drivers/input/misc/ad714x-spi.c
@@ -108,7 +108,6 @@ static int ad714x_spi_remove(struct spi_device *spi)
108 struct ad714x_chip *chip = spi_get_drvdata(spi); 108 struct ad714x_chip *chip = spi_get_drvdata(spi);
109 109
110 ad714x_remove(chip); 110 ad714x_remove(chip);
111 spi_set_drvdata(spi, NULL);
112 111
113 return 0; 112 return 0;
114} 113}
diff --git a/drivers/input/misc/cobalt_btns.c b/drivers/input/misc/cobalt_btns.c
index 4f77f87847e8..b5d71d245854 100644
--- a/drivers/input/misc/cobalt_btns.c
+++ b/drivers/input/misc/cobalt_btns.c
@@ -131,7 +131,6 @@ static int cobalt_buttons_probe(struct platform_device *pdev)
131 err_free_mem: 131 err_free_mem:
132 input_free_polled_device(poll_dev); 132 input_free_polled_device(poll_dev);
133 kfree(bdev); 133 kfree(bdev);
134 dev_set_drvdata(&pdev->dev, NULL);
135 return error; 134 return error;
136} 135}
137 136
@@ -144,7 +143,6 @@ static int cobalt_buttons_remove(struct platform_device *pdev)
144 input_free_polled_device(bdev->poll_dev); 143 input_free_polled_device(bdev->poll_dev);
145 iounmap(bdev->reg); 144 iounmap(bdev->reg);
146 kfree(bdev); 145 kfree(bdev);
147 dev_set_drvdata(dev, NULL);
148 146
149 return 0; 147 return 0;
150} 148}
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
index f3309696d053..59d4dcddf6de 100644
--- a/drivers/input/misc/mma8450.c
+++ b/drivers/input/misc/mma8450.c
@@ -168,7 +168,7 @@ static void mma8450_close(struct input_polled_dev *dev)
168 * I2C init/probing/exit functions 168 * I2C init/probing/exit functions
169 */ 169 */
170static int mma8450_probe(struct i2c_client *c, 170static int mma8450_probe(struct i2c_client *c,
171 const struct i2c_device_id *id) 171 const struct i2c_device_id *id)
172{ 172{
173 struct input_polled_dev *idev; 173 struct input_polled_dev *idev;
174 struct mma8450 *m; 174 struct mma8450 *m;
@@ -204,6 +204,8 @@ static int mma8450_probe(struct i2c_client *c,
204 goto err_free_mem; 204 goto err_free_mem;
205 } 205 }
206 206
207 i2c_set_clientdata(c, m);
208
207 return 0; 209 return 0;
208 210
209err_free_mem: 211err_free_mem:
diff --git a/drivers/input/misc/mpu3050.c b/drivers/input/misc/mpu3050.c
index dce0d95943c5..6983ffbbfb94 100644
--- a/drivers/input/misc/mpu3050.c
+++ b/drivers/input/misc/mpu3050.c
@@ -383,6 +383,7 @@ static int mpu3050_probe(struct i2c_client *client,
383 383
384 pm_runtime_enable(&client->dev); 384 pm_runtime_enable(&client->dev);
385 pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY); 385 pm_runtime_set_autosuspend_delay(&client->dev, MPU3050_AUTO_DELAY);
386 i2c_set_clientdata(client, sensor);
386 387
387 return 0; 388 return 0;
388 389
diff --git a/drivers/input/misc/pwm-beeper.c b/drivers/input/misc/pwm-beeper.c
index 2ff4d1c78ab8..940566e7be13 100644
--- a/drivers/input/misc/pwm-beeper.c
+++ b/drivers/input/misc/pwm-beeper.c
@@ -16,6 +16,7 @@
16#include <linux/input.h> 16#include <linux/input.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/of.h>
19#include <linux/platform_device.h> 20#include <linux/platform_device.h>
20#include <linux/pwm.h> 21#include <linux/pwm.h>
21#include <linux/slab.h> 22#include <linux/slab.h>
diff --git a/drivers/input/misc/rb532_button.c b/drivers/input/misc/rb532_button.c
index fb4f8ac3343b..83fff38b86b3 100644
--- a/drivers/input/misc/rb532_button.c
+++ b/drivers/input/misc/rb532_button.c
@@ -87,7 +87,6 @@ static int rb532_button_remove(struct platform_device *pdev)
87 87
88 input_unregister_polled_device(poll_dev); 88 input_unregister_polled_device(poll_dev);
89 input_free_polled_device(poll_dev); 89 input_free_polled_device(poll_dev);
90 dev_set_drvdata(&pdev->dev, NULL);
91 90
92 return 0; 91 return 0;
93} 92}
diff --git a/drivers/input/misc/rotary_encoder.c b/drivers/input/misc/rotary_encoder.c
index 5b1aff825138..f920ba7ab51f 100644
--- a/drivers/input/misc/rotary_encoder.c
+++ b/drivers/input/misc/rotary_encoder.c
@@ -24,6 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/rotary_encoder.h> 25#include <linux/rotary_encoder.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/of.h>
27#include <linux/of_platform.h> 28#include <linux/of_platform.h>
28#include <linux/of_gpio.h> 29#include <linux/of_gpio.h>
29 30
diff --git a/drivers/input/misc/sirfsoc-onkey.c b/drivers/input/misc/sirfsoc-onkey.c
index 0621c367049a..7b8b03e0d0be 100644
--- a/drivers/input/misc/sirfsoc-onkey.c
+++ b/drivers/input/misc/sirfsoc-onkey.c
@@ -153,7 +153,7 @@ static struct platform_driver sirfsoc_pwrc_driver = {
153 .name = "sirfsoc-pwrc", 153 .name = "sirfsoc-pwrc",
154 .owner = THIS_MODULE, 154 .owner = THIS_MODULE,
155 .pm = &sirfsoc_pwrc_pm_ops, 155 .pm = &sirfsoc_pwrc_pm_ops,
156 .of_match_table = of_match_ptr(sirfsoc_pwrc_of_match), 156 .of_match_table = sirfsoc_pwrc_of_match,
157 } 157 }
158}; 158};
159 159
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index a0a4bbaef02c..772835938a52 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -430,20 +430,30 @@ static int uinput_setup_device(struct uinput_device *udev,
430 return retval; 430 return retval;
431} 431}
432 432
433static ssize_t uinput_inject_event(struct uinput_device *udev, 433static ssize_t uinput_inject_events(struct uinput_device *udev,
434 const char __user *buffer, size_t count) 434 const char __user *buffer, size_t count)
435{ 435{
436 struct input_event ev; 436 struct input_event ev;
437 size_t bytes = 0;
437 438
438 if (count < input_event_size()) 439 if (count != 0 && count < input_event_size())
439 return -EINVAL; 440 return -EINVAL;
440 441
441 if (input_event_from_user(buffer, &ev)) 442 while (bytes + input_event_size() <= count) {
442 return -EFAULT; 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;
443 451
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 }
445 455
446 return input_event_size(); 456 return bytes;
447} 457}
448 458
449static ssize_t uinput_write(struct file *file, const char __user *buffer, 459static 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,
460 return retval; 470 return retval;
461 471
462 retval = udev->state == UIST_CREATED ? 472 retval = udev->state == UIST_CREATED ?
463 uinput_inject_event(udev, buffer, count) : 473 uinput_inject_events(udev, buffer, count) :
464 uinput_setup_device(udev, buffer, count); 474 uinput_setup_device(udev, buffer, count);
465 475
466 mutex_unlock(&udev->mutex); 476 mutex_unlock(&udev->mutex);