aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/joystick/xpad.c3
-rw-r--r--drivers/input/keyboard/Kconfig2
-rw-r--r--drivers/input/keyboard/cap11xx.c35
-rw-r--r--drivers/input/keyboard/matrix_keypad.c2
-rw-r--r--drivers/input/keyboard/qt2160.c69
-rw-r--r--drivers/input/keyboard/st-keyscan.c4
-rw-r--r--drivers/input/misc/apanel.c24
-rw-r--r--drivers/input/misc/bma150.c9
-rw-r--r--drivers/input/misc/pwm-vibra.c19
-rw-r--r--drivers/input/misc/uinput.c5
-rw-r--r--drivers/input/mouse/elan_i2c_core.c2
-rw-r--r--drivers/input/mouse/elantech.c9
-rw-r--r--drivers/input/serio/olpc_apsp.c17
-rw-r--r--drivers/input/serio/ps2-gpio.c1
-rw-r--r--drivers/input/touchscreen/Kconfig2
-rw-r--r--drivers/input/touchscreen/raspberrypi-ts.c4
16 files changed, 86 insertions, 121 deletions
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index cfc8b94527b9..aa4e431cbcd3 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -252,6 +252,8 @@ static const struct xpad_device {
252 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX }, 252 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
253 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX }, 253 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
254 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX }, 254 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
255 { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
256 { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
255 { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 }, 257 { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
256 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, 258 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
257 { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 }, 259 { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -428,6 +430,7 @@ static const struct usb_device_id xpad_table[] = {
428 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */ 430 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */
429 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */ 431 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
430 XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */ 432 XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
433 XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
431 XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */ 434 XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
432 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ 435 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
433 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ 436 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 4713957b0cbb..a878351f1643 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -420,7 +420,7 @@ config KEYBOARD_MPR121
420 420
421config KEYBOARD_SNVS_PWRKEY 421config KEYBOARD_SNVS_PWRKEY
422 tristate "IMX SNVS Power Key Driver" 422 tristate "IMX SNVS Power Key Driver"
423 depends on SOC_IMX6SX 423 depends on SOC_IMX6SX || SOC_IMX7D
424 depends on OF 424 depends on OF
425 help 425 help
426 This is the snvs powerkey driver for the Freescale i.MX application 426 This is the snvs powerkey driver for the Freescale i.MX application
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 312916f99597..73686c2460ce 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -75,9 +75,7 @@
75struct cap11xx_led { 75struct cap11xx_led {
76 struct cap11xx_priv *priv; 76 struct cap11xx_priv *priv;
77 struct led_classdev cdev; 77 struct led_classdev cdev;
78 struct work_struct work;
79 u32 reg; 78 u32 reg;
80 enum led_brightness new_brightness;
81}; 79};
82#endif 80#endif
83 81
@@ -233,30 +231,21 @@ static void cap11xx_input_close(struct input_dev *idev)
233} 231}
234 232
235#ifdef CONFIG_LEDS_CLASS 233#ifdef CONFIG_LEDS_CLASS
236static void cap11xx_led_work(struct work_struct *work) 234static int cap11xx_led_set(struct led_classdev *cdev,
235 enum led_brightness value)
237{ 236{
238 struct cap11xx_led *led = container_of(work, struct cap11xx_led, work); 237 struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
239 struct cap11xx_priv *priv = led->priv; 238 struct cap11xx_priv *priv = led->priv;
240 int value = led->new_brightness;
241 239
242 /* 240 /*
243 * All LEDs share the same duty cycle as this is a HW limitation. 241 * All LEDs share the same duty cycle as this is a HW
244 * Brightness levels per LED are either 0 (OFF) and 1 (ON). 242 * limitation. Brightness levels per LED are either
243 * 0 (OFF) and 1 (ON).
245 */ 244 */
246 regmap_update_bits(priv->regmap, CAP11XX_REG_LED_OUTPUT_CONTROL, 245 return regmap_update_bits(priv->regmap,
247 BIT(led->reg), value ? BIT(led->reg) : 0); 246 CAP11XX_REG_LED_OUTPUT_CONTROL,
248} 247 BIT(led->reg),
249 248 value ? BIT(led->reg) : 0);
250static void cap11xx_led_set(struct led_classdev *cdev,
251 enum led_brightness value)
252{
253 struct cap11xx_led *led = container_of(cdev, struct cap11xx_led, cdev);
254
255 if (led->new_brightness == value)
256 return;
257
258 led->new_brightness = value;
259 schedule_work(&led->work);
260} 249}
261 250
262static int cap11xx_init_leds(struct device *dev, 251static int cap11xx_init_leds(struct device *dev,
@@ -299,7 +288,7 @@ static int cap11xx_init_leds(struct device *dev,
299 led->cdev.default_trigger = 288 led->cdev.default_trigger =
300 of_get_property(child, "linux,default-trigger", NULL); 289 of_get_property(child, "linux,default-trigger", NULL);
301 led->cdev.flags = 0; 290 led->cdev.flags = 0;
302 led->cdev.brightness_set = cap11xx_led_set; 291 led->cdev.brightness_set_blocking = cap11xx_led_set;
303 led->cdev.max_brightness = 1; 292 led->cdev.max_brightness = 1;
304 led->cdev.brightness = LED_OFF; 293 led->cdev.brightness = LED_OFF;
305 294
@@ -312,8 +301,6 @@ static int cap11xx_init_leds(struct device *dev,
312 led->reg = reg; 301 led->reg = reg;
313 led->priv = priv; 302 led->priv = priv;
314 303
315 INIT_WORK(&led->work, cap11xx_led_work);
316
317 error = devm_led_classdev_register(dev, &led->cdev); 304 error = devm_led_classdev_register(dev, &led->cdev);
318 if (error) { 305 if (error) {
319 of_node_put(child); 306 of_node_put(child);
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c
index 403452ef00e6..3d1cb7bf5e35 100644
--- a/drivers/input/keyboard/matrix_keypad.c
+++ b/drivers/input/keyboard/matrix_keypad.c
@@ -222,7 +222,7 @@ static void matrix_keypad_stop(struct input_dev *dev)
222 keypad->stopped = true; 222 keypad->stopped = true;
223 spin_unlock_irq(&keypad->lock); 223 spin_unlock_irq(&keypad->lock);
224 224
225 flush_work(&keypad->work.work); 225 flush_delayed_work(&keypad->work);
226 /* 226 /*
227 * matrix_keypad_scan() will leave IRQs enabled; 227 * matrix_keypad_scan() will leave IRQs enabled;
228 * we should disable them now. 228 * we should disable them now.
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 43b86482dda0..d466bc07aebb 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -58,10 +58,9 @@ static unsigned char qt2160_key2code[] = {
58struct qt2160_led { 58struct qt2160_led {
59 struct qt2160_data *qt2160; 59 struct qt2160_data *qt2160;
60 struct led_classdev cdev; 60 struct led_classdev cdev;
61 struct work_struct work;
62 char name[32]; 61 char name[32];
63 int id; 62 int id;
64 enum led_brightness new_brightness; 63 enum led_brightness brightness;
65}; 64};
66#endif 65#endif
67 66
@@ -74,7 +73,6 @@ struct qt2160_data {
74 u16 key_matrix; 73 u16 key_matrix;
75#ifdef CONFIG_LEDS_CLASS 74#ifdef CONFIG_LEDS_CLASS
76 struct qt2160_led leds[QT2160_NUM_LEDS_X]; 75 struct qt2160_led leds[QT2160_NUM_LEDS_X];
77 struct mutex led_lock;
78#endif 76#endif
79}; 77};
80 78
@@ -83,46 +81,39 @@ static int qt2160_write(struct i2c_client *client, u8 reg, u8 data);
83 81
84#ifdef CONFIG_LEDS_CLASS 82#ifdef CONFIG_LEDS_CLASS
85 83
86static void qt2160_led_work(struct work_struct *work) 84static int qt2160_led_set(struct led_classdev *cdev,
85 enum led_brightness value)
87{ 86{
88 struct qt2160_led *led = container_of(work, struct qt2160_led, work); 87 struct qt2160_led *led = container_of(cdev, struct qt2160_led, cdev);
89 struct qt2160_data *qt2160 = led->qt2160; 88 struct qt2160_data *qt2160 = led->qt2160;
90 struct i2c_client *client = qt2160->client; 89 struct i2c_client *client = qt2160->client;
91 int value = led->new_brightness;
92 u32 drive, pwmen; 90 u32 drive, pwmen;
93 91
94 mutex_lock(&qt2160->led_lock); 92 if (value != led->brightness) {
95 93 drive = qt2160_read(client, QT2160_CMD_DRIVE_X);
96 drive = qt2160_read(client, QT2160_CMD_DRIVE_X); 94 pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X);
97 pwmen = qt2160_read(client, QT2160_CMD_PWMEN_X); 95 if (value != LED_OFF) {
98 if (value != LED_OFF) { 96 drive |= BIT(led->id);
99 drive |= (1 << led->id); 97 pwmen |= BIT(led->id);
100 pwmen |= (1 << led->id);
101
102 } else {
103 drive &= ~(1 << led->id);
104 pwmen &= ~(1 << led->id);
105 }
106 qt2160_write(client, QT2160_CMD_DRIVE_X, drive);
107 qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);
108 98
109 /* 99 } else {
110 * Changing this register will change the brightness 100 drive &= ~BIT(led->id);
111 * of every LED in the qt2160. It's a HW limitation. 101 pwmen &= ~BIT(led->id);
112 */ 102 }
113 if (value != LED_OFF) 103 qt2160_write(client, QT2160_CMD_DRIVE_X, drive);
114 qt2160_write(client, QT2160_CMD_PWM_DUTY, value); 104 qt2160_write(client, QT2160_CMD_PWMEN_X, pwmen);
115 105
116 mutex_unlock(&qt2160->led_lock); 106 /*
117} 107 * Changing this register will change the brightness
108 * of every LED in the qt2160. It's a HW limitation.
109 */
110 if (value != LED_OFF)
111 qt2160_write(client, QT2160_CMD_PWM_DUTY, value);
118 112
119static void qt2160_led_set(struct led_classdev *cdev, 113 led->brightness = value;
120 enum led_brightness value) 114 }
121{
122 struct qt2160_led *led = container_of(cdev, struct qt2160_led, cdev);
123 115
124 led->new_brightness = value; 116 return 0;
125 schedule_work(&led->work);
126} 117}
127 118
128#endif /* CONFIG_LEDS_CLASS */ 119#endif /* CONFIG_LEDS_CLASS */
@@ -293,20 +284,16 @@ static int qt2160_register_leds(struct qt2160_data *qt2160)
293 int ret; 284 int ret;
294 int i; 285 int i;
295 286
296 mutex_init(&qt2160->led_lock);
297
298 for (i = 0; i < QT2160_NUM_LEDS_X; i++) { 287 for (i = 0; i < QT2160_NUM_LEDS_X; i++) {
299 struct qt2160_led *led = &qt2160->leds[i]; 288 struct qt2160_led *led = &qt2160->leds[i];
300 289
301 snprintf(led->name, sizeof(led->name), "qt2160:x%d", i); 290 snprintf(led->name, sizeof(led->name), "qt2160:x%d", i);
302 led->cdev.name = led->name; 291 led->cdev.name = led->name;
303 led->cdev.brightness_set = qt2160_led_set; 292 led->cdev.brightness_set_blocking = qt2160_led_set;
304 led->cdev.brightness = LED_OFF; 293 led->cdev.brightness = LED_OFF;
305 led->id = i; 294 led->id = i;
306 led->qt2160 = qt2160; 295 led->qt2160 = qt2160;
307 296
308 INIT_WORK(&led->work, qt2160_led_work);
309
310 ret = led_classdev_register(&client->dev, &led->cdev); 297 ret = led_classdev_register(&client->dev, &led->cdev);
311 if (ret < 0) 298 if (ret < 0)
312 return ret; 299 return ret;
@@ -324,10 +311,8 @@ static void qt2160_unregister_leds(struct qt2160_data *qt2160)
324{ 311{
325 int i; 312 int i;
326 313
327 for (i = 0; i < QT2160_NUM_LEDS_X; i++) { 314 for (i = 0; i < QT2160_NUM_LEDS_X; i++)
328 led_classdev_unregister(&qt2160->leds[i].cdev); 315 led_classdev_unregister(&qt2160->leds[i].cdev);
329 cancel_work_sync(&qt2160->leds[i].work);
330 }
331} 316}
332 317
333#else 318#else
diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c
index babcfb165e4f..3b85631fde91 100644
--- a/drivers/input/keyboard/st-keyscan.c
+++ b/drivers/input/keyboard/st-keyscan.c
@@ -153,6 +153,8 @@ static int keyscan_probe(struct platform_device *pdev)
153 153
154 input_dev->id.bustype = BUS_HOST; 154 input_dev->id.bustype = BUS_HOST;
155 155
156 keypad_data->input_dev = input_dev;
157
156 error = keypad_matrix_key_parse_dt(keypad_data); 158 error = keypad_matrix_key_parse_dt(keypad_data);
157 if (error) 159 if (error)
158 return error; 160 return error;
@@ -168,8 +170,6 @@ static int keyscan_probe(struct platform_device *pdev)
168 170
169 input_set_drvdata(input_dev, keypad_data); 171 input_set_drvdata(input_dev, keypad_data);
170 172
171 keypad_data->input_dev = input_dev;
172
173 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 173 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
174 keypad_data->base = devm_ioremap_resource(&pdev->dev, res); 174 keypad_data->base = devm_ioremap_resource(&pdev->dev, res);
175 if (IS_ERR(keypad_data->base)) 175 if (IS_ERR(keypad_data->base))
diff --git a/drivers/input/misc/apanel.c b/drivers/input/misc/apanel.c
index 094bddf56755..c1e66f45d552 100644
--- a/drivers/input/misc/apanel.c
+++ b/drivers/input/misc/apanel.c
@@ -22,7 +22,6 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/input-polldev.h> 23#include <linux/input-polldev.h>
24#include <linux/i2c.h> 24#include <linux/i2c.h>
25#include <linux/workqueue.h>
26#include <linux/leds.h> 25#include <linux/leds.h>
27 26
28#define APANEL_NAME "Fujitsu Application Panel" 27#define APANEL_NAME "Fujitsu Application Panel"
@@ -59,8 +58,6 @@ struct apanel {
59 struct i2c_client *client; 58 struct i2c_client *client;
60 unsigned short keymap[MAX_PANEL_KEYS]; 59 unsigned short keymap[MAX_PANEL_KEYS];
61 u16 nkeys; 60 u16 nkeys;
62 u16 led_bits;
63 struct work_struct led_work;
64 struct led_classdev mail_led; 61 struct led_classdev mail_led;
65}; 62};
66 63
@@ -109,25 +106,13 @@ static void apanel_poll(struct input_polled_dev *ipdev)
109 report_key(idev, ap->keymap[i]); 106 report_key(idev, ap->keymap[i]);
110} 107}
111 108
112/* Track state changes of LED */ 109static int mail_led_set(struct led_classdev *led,
113static void led_update(struct work_struct *work)
114{
115 struct apanel *ap = container_of(work, struct apanel, led_work);
116
117 i2c_smbus_write_word_data(ap->client, 0x10, ap->led_bits);
118}
119
120static void mail_led_set(struct led_classdev *led,
121 enum led_brightness value) 110 enum led_brightness value)
122{ 111{
123 struct apanel *ap = container_of(led, struct apanel, mail_led); 112 struct apanel *ap = container_of(led, struct apanel, mail_led);
113 u16 led_bits = value != LED_OFF ? 0x8000 : 0x0000;
124 114
125 if (value != LED_OFF) 115 return i2c_smbus_write_word_data(ap->client, 0x10, led_bits);
126 ap->led_bits |= 0x8000;
127 else
128 ap->led_bits &= ~0x8000;
129
130 schedule_work(&ap->led_work);
131} 116}
132 117
133static int apanel_remove(struct i2c_client *client) 118static int apanel_remove(struct i2c_client *client)
@@ -179,7 +164,7 @@ static struct apanel apanel = {
179 }, 164 },
180 .mail_led = { 165 .mail_led = {
181 .name = "mail:blue", 166 .name = "mail:blue",
182 .brightness_set = mail_led_set, 167 .brightness_set_blocking = mail_led_set,
183 }, 168 },
184}; 169};
185 170
@@ -235,7 +220,6 @@ static int apanel_probe(struct i2c_client *client,
235 if (err) 220 if (err)
236 goto out3; 221 goto out3;
237 222
238 INIT_WORK(&ap->led_work, led_update);
239 if (device_chip[APANEL_DEV_LED] != CHIP_NONE) { 223 if (device_chip[APANEL_DEV_LED] != CHIP_NONE) {
240 err = led_classdev_register(&client->dev, &ap->mail_led); 224 err = led_classdev_register(&client->dev, &ap->mail_led);
241 if (err) 225 if (err)
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index 1efcfdf9f8a8..dd9dd4e40827 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -481,13 +481,14 @@ static int bma150_register_input_device(struct bma150_data *bma150)
481 idev->close = bma150_irq_close; 481 idev->close = bma150_irq_close;
482 input_set_drvdata(idev, bma150); 482 input_set_drvdata(idev, bma150);
483 483
484 bma150->input = idev;
485
484 error = input_register_device(idev); 486 error = input_register_device(idev);
485 if (error) { 487 if (error) {
486 input_free_device(idev); 488 input_free_device(idev);
487 return error; 489 return error;
488 } 490 }
489 491
490 bma150->input = idev;
491 return 0; 492 return 0;
492} 493}
493 494
@@ -510,15 +511,15 @@ static int bma150_register_polled_device(struct bma150_data *bma150)
510 511
511 bma150_init_input_device(bma150, ipoll_dev->input); 512 bma150_init_input_device(bma150, ipoll_dev->input);
512 513
514 bma150->input_polled = ipoll_dev;
515 bma150->input = ipoll_dev->input;
516
513 error = input_register_polled_device(ipoll_dev); 517 error = input_register_polled_device(ipoll_dev);
514 if (error) { 518 if (error) {
515 input_free_polled_device(ipoll_dev); 519 input_free_polled_device(ipoll_dev);
516 return error; 520 return error;
517 } 521 }
518 522
519 bma150->input_polled = ipoll_dev;
520 bma150->input = ipoll_dev->input;
521
522 return 0; 523 return 0;
523} 524}
524 525
diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c
index 55da191ae550..dbb6d9e1b947 100644
--- a/drivers/input/misc/pwm-vibra.c
+++ b/drivers/input/misc/pwm-vibra.c
@@ -34,6 +34,7 @@ struct pwm_vibrator {
34 struct work_struct play_work; 34 struct work_struct play_work;
35 u16 level; 35 u16 level;
36 u32 direction_duty_cycle; 36 u32 direction_duty_cycle;
37 bool vcc_on;
37}; 38};
38 39
39static int pwm_vibrator_start(struct pwm_vibrator *vibrator) 40static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
@@ -42,10 +43,13 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
42 struct pwm_state state; 43 struct pwm_state state;
43 int err; 44 int err;
44 45
45 err = regulator_enable(vibrator->vcc); 46 if (!vibrator->vcc_on) {
46 if (err) { 47 err = regulator_enable(vibrator->vcc);
47 dev_err(pdev, "failed to enable regulator: %d", err); 48 if (err) {
48 return err; 49 dev_err(pdev, "failed to enable regulator: %d", err);
50 return err;
51 }
52 vibrator->vcc_on = true;
49 } 53 }
50 54
51 pwm_get_state(vibrator->pwm, &state); 55 pwm_get_state(vibrator->pwm, &state);
@@ -76,11 +80,14 @@ static int pwm_vibrator_start(struct pwm_vibrator *vibrator)
76 80
77static void pwm_vibrator_stop(struct pwm_vibrator *vibrator) 81static void pwm_vibrator_stop(struct pwm_vibrator *vibrator)
78{ 82{
79 regulator_disable(vibrator->vcc);
80
81 if (vibrator->pwm_dir) 83 if (vibrator->pwm_dir)
82 pwm_disable(vibrator->pwm_dir); 84 pwm_disable(vibrator->pwm_dir);
83 pwm_disable(vibrator->pwm); 85 pwm_disable(vibrator->pwm);
86
87 if (vibrator->vcc_on) {
88 regulator_disable(vibrator->vcc);
89 vibrator->vcc_on = false;
90 }
84} 91}
85 92
86static void pwm_vibrator_play_work(struct work_struct *work) 93static void pwm_vibrator_play_work(struct work_struct *work)
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 8ec483e8688b..26ec603fe220 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -39,6 +39,7 @@
39#include <linux/init.h> 39#include <linux/init.h>
40#include <linux/fs.h> 40#include <linux/fs.h>
41#include <linux/miscdevice.h> 41#include <linux/miscdevice.h>
42#include <linux/overflow.h>
42#include <linux/input/mt.h> 43#include <linux/input/mt.h>
43#include "../input-compat.h" 44#include "../input-compat.h"
44 45
@@ -405,7 +406,7 @@ static int uinput_open(struct inode *inode, struct file *file)
405static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, 406static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
406 const struct input_absinfo *abs) 407 const struct input_absinfo *abs)
407{ 408{
408 int min, max; 409 int min, max, range;
409 410
410 min = abs->minimum; 411 min = abs->minimum;
411 max = abs->maximum; 412 max = abs->maximum;
@@ -417,7 +418,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
417 return -EINVAL; 418 return -EINVAL;
418 } 419 }
419 420
420 if (abs->flat > max - min) { 421 if (!check_sub_overflow(max, min, &range) && abs->flat > range) {
421 printk(KERN_DEBUG 422 printk(KERN_DEBUG
422 "%s: abs_flat #%02x out of range: %d (min:%d/max:%d)\n", 423 "%s: abs_flat #%02x out of range: %d (min:%d/max:%d)\n",
423 UINPUT_NAME, code, abs->flat, min, max); 424 UINPUT_NAME, code, abs->flat, min, max);
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index f322a1768fbb..225ae6980182 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1336,7 +1336,6 @@ MODULE_DEVICE_TABLE(i2c, elan_id);
1336static const struct acpi_device_id elan_acpi_id[] = { 1336static const struct acpi_device_id elan_acpi_id[] = {
1337 { "ELAN0000", 0 }, 1337 { "ELAN0000", 0 },
1338 { "ELAN0100", 0 }, 1338 { "ELAN0100", 0 },
1339 { "ELAN0501", 0 },
1340 { "ELAN0600", 0 }, 1339 { "ELAN0600", 0 },
1341 { "ELAN0602", 0 }, 1340 { "ELAN0602", 0 },
1342 { "ELAN0605", 0 }, 1341 { "ELAN0605", 0 },
@@ -1346,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = {
1346 { "ELAN060C", 0 }, 1345 { "ELAN060C", 0 },
1347 { "ELAN0611", 0 }, 1346 { "ELAN0611", 0 },
1348 { "ELAN0612", 0 }, 1347 { "ELAN0612", 0 },
1348 { "ELAN0617", 0 },
1349 { "ELAN0618", 0 }, 1349 { "ELAN0618", 0 },
1350 { "ELAN061C", 0 }, 1350 { "ELAN061C", 0 },
1351 { "ELAN061D", 0 }, 1351 { "ELAN061D", 0 },
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c
index 9fe075c137dc..a7f8b1614559 100644
--- a/drivers/input/mouse/elantech.c
+++ b/drivers/input/mouse/elantech.c
@@ -1119,6 +1119,8 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse,
1119 * Asus UX31 0x361f00 20, 15, 0e clickpad 1119 * Asus UX31 0x361f00 20, 15, 0e clickpad
1120 * Asus UX32VD 0x361f02 00, 15, 0e clickpad 1120 * Asus UX32VD 0x361f02 00, 15, 0e clickpad
1121 * Avatar AVIU-145A2 0x361f00 ? clickpad 1121 * Avatar AVIU-145A2 0x361f00 ? clickpad
1122 * Fujitsu CELSIUS H760 0x570f02 40, 14, 0c 3 hw buttons (**)
1123 * Fujitsu CELSIUS H780 0x5d0f02 41, 16, 0d 3 hw buttons (**)
1122 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons 1124 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
1123 * Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons 1125 * Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons
1124 * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons 1126 * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons
@@ -1171,6 +1173,13 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = {
1171 DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"), 1173 DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H760"),
1172 }, 1174 },
1173 }, 1175 },
1176 {
1177 /* Fujitsu H780 also has a middle button */
1178 .matches = {
1179 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1180 DMI_MATCH(DMI_PRODUCT_NAME, "CELSIUS H780"),
1181 },
1182 },
1174#endif 1183#endif
1175 { } 1184 { }
1176}; 1185};
diff --git a/drivers/input/serio/olpc_apsp.c b/drivers/input/serio/olpc_apsp.c
index b36084710f69..a7cfab3db9ee 100644
--- a/drivers/input/serio/olpc_apsp.c
+++ b/drivers/input/serio/olpc_apsp.c
@@ -23,7 +23,6 @@
23#include <linux/of.h> 23#include <linux/of.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/delay.h> 25#include <linux/delay.h>
26#include <linux/clk.h>
27 26
28/* 27/*
29 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller. 28 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
@@ -75,7 +74,6 @@ struct olpc_apsp {
75 struct serio *kbio; 74 struct serio *kbio;
76 struct serio *padio; 75 struct serio *padio;
77 void __iomem *base; 76 void __iomem *base;
78 struct clk *clk;
79 int open_count; 77 int open_count;
80 int irq; 78 int irq;
81}; 79};
@@ -148,17 +146,11 @@ static int olpc_apsp_open(struct serio *port)
148 struct olpc_apsp *priv = port->port_data; 146 struct olpc_apsp *priv = port->port_data;
149 unsigned int tmp; 147 unsigned int tmp;
150 unsigned long l; 148 unsigned long l;
151 int error;
152 149
153 if (priv->open_count++ == 0) { 150 if (priv->open_count++ == 0) {
154 error = clk_prepare_enable(priv->clk);
155 if (error)
156 return error;
157
158 l = readl(priv->base + COMMAND_FIFO_STATUS); 151 l = readl(priv->base + COMMAND_FIFO_STATUS);
159 if (!(l & CMD_STS_MASK)) { 152 if (!(l & CMD_STS_MASK)) {
160 dev_err(priv->dev, "SP cannot accept commands.\n"); 153 dev_err(priv->dev, "SP cannot accept commands.\n");
161 clk_disable_unprepare(priv->clk);
162 return -EIO; 154 return -EIO;
163 } 155 }
164 156
@@ -179,8 +171,6 @@ static void olpc_apsp_close(struct serio *port)
179 /* Disable interrupt 0 */ 171 /* Disable interrupt 0 */
180 tmp = readl(priv->base + PJ_INTERRUPT_MASK); 172 tmp = readl(priv->base + PJ_INTERRUPT_MASK);
181 writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK); 173 writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
182
183 clk_disable_unprepare(priv->clk);
184 } 174 }
185} 175}
186 176
@@ -195,6 +185,8 @@ static int olpc_apsp_probe(struct platform_device *pdev)
195 if (!priv) 185 if (!priv)
196 return -ENOMEM; 186 return -ENOMEM;
197 187
188 priv->dev = &pdev->dev;
189
198 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 190 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
199 priv->base = devm_ioremap_resource(&pdev->dev, res); 191 priv->base = devm_ioremap_resource(&pdev->dev, res);
200 if (IS_ERR(priv->base)) { 192 if (IS_ERR(priv->base)) {
@@ -206,10 +198,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
206 if (priv->irq < 0) 198 if (priv->irq < 0)
207 return priv->irq; 199 return priv->irq;
208 200
209 priv->clk = devm_clk_get(&pdev->dev, "sp");
210 if (IS_ERR(priv->clk))
211 return PTR_ERR(priv->clk);
212
213 /* KEYBOARD */ 201 /* KEYBOARD */
214 kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL); 202 kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
215 if (!kb_serio) 203 if (!kb_serio)
@@ -248,7 +236,6 @@ static int olpc_apsp_probe(struct platform_device *pdev)
248 goto err_irq; 236 goto err_irq;
249 } 237 }
250 238
251 priv->dev = &pdev->dev;
252 device_init_wakeup(priv->dev, 1); 239 device_init_wakeup(priv->dev, 1);
253 platform_set_drvdata(pdev, priv); 240 platform_set_drvdata(pdev, priv);
254 241
diff --git a/drivers/input/serio/ps2-gpio.c b/drivers/input/serio/ps2-gpio.c
index c62cceb97bb1..5e8d8384aa2a 100644
--- a/drivers/input/serio/ps2-gpio.c
+++ b/drivers/input/serio/ps2-gpio.c
@@ -76,6 +76,7 @@ static void ps2_gpio_close(struct serio *serio)
76{ 76{
77 struct ps2_gpio_data *drvdata = serio->port_data; 77 struct ps2_gpio_data *drvdata = serio->port_data;
78 78
79 flush_delayed_work(&drvdata->tx_work);
79 disable_irq(drvdata->irq); 80 disable_irq(drvdata->irq);
80} 81}
81 82
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index af6027cc7bbf..068dbbc610fc 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -698,7 +698,7 @@ config TOUCHSCREEN_EDT_FT5X06
698 698
699config TOUCHSCREEN_RASPBERRYPI_FW 699config TOUCHSCREEN_RASPBERRYPI_FW
700 tristate "Raspberry Pi's firmware base touch screen support" 700 tristate "Raspberry Pi's firmware base touch screen support"
701 depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST 701 depends on RASPBERRYPI_FIRMWARE || (RASPBERRYPI_FIRMWARE=n && COMPILE_TEST)
702 help 702 help
703 Say Y here if you have the official Raspberry Pi 7 inch screen on 703 Say Y here if you have the official Raspberry Pi 7 inch screen on
704 your system. 704 your system.
diff --git a/drivers/input/touchscreen/raspberrypi-ts.c b/drivers/input/touchscreen/raspberrypi-ts.c
index f456c1125bd6..69881265d121 100644
--- a/drivers/input/touchscreen/raspberrypi-ts.c
+++ b/drivers/input/touchscreen/raspberrypi-ts.c
@@ -147,8 +147,8 @@ static int rpi_ts_probe(struct platform_device *pdev)
147 return -ENOMEM; 147 return -ENOMEM;
148 ts->pdev = pdev; 148 ts->pdev = pdev;
149 149
150 ts->fw_regs_va = dma_zalloc_coherent(dev, PAGE_SIZE, &ts->fw_regs_phys, 150 ts->fw_regs_va = dma_alloc_coherent(dev, PAGE_SIZE, &ts->fw_regs_phys,
151 GFP_KERNEL); 151 GFP_KERNEL);
152 if (!ts->fw_regs_va) { 152 if (!ts->fw_regs_va) {
153 dev_err(dev, "failed to dma_alloc_coherent\n"); 153 dev_err(dev, "failed to dma_alloc_coherent\n");
154 return -ENOMEM; 154 return -ENOMEM;