aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/input/event-codes.txt4
-rw-r--r--drivers/input/joystick/xpad.c2
-rw-r--r--drivers/input/misc/arizona-haptics.c1
-rw-r--r--drivers/input/misc/max8997_haptic.c6
-rw-r--r--drivers/input/misc/pmic8xxx-pwrkey.c7
-rw-r--r--drivers/input/misc/twl4030-vibra.c1
-rw-r--r--drivers/input/misc/twl6040-vibra.c25
-rw-r--r--drivers/input/mouse/byd.c4
-rw-r--r--drivers/input/tablet/gtco.c10
-rw-r--r--drivers/input/touchscreen/atmel_mxt_ts.c28
-rw-r--r--drivers/input/touchscreen/zforce_ts.c4
11 files changed, 53 insertions, 39 deletions
diff --git a/Documentation/input/event-codes.txt b/Documentation/input/event-codes.txt
index 3f0f5ce3338b..36ea940e5bb9 100644
--- a/Documentation/input/event-codes.txt
+++ b/Documentation/input/event-codes.txt
@@ -173,6 +173,10 @@ A few EV_ABS codes have special meanings:
173 proximity of the device and while the value of the BTN_TOUCH code is 0. If 173 proximity of the device and while the value of the BTN_TOUCH code is 0. If
174 the input device may be used freely in three dimensions, consider ABS_Z 174 the input device may be used freely in three dimensions, consider ABS_Z
175 instead. 175 instead.
176 - BTN_TOOL_<name> should be set to 1 when the tool comes into detectable
177 proximity and set to 0 when the tool leaves detectable proximity.
178 BTN_TOOL_<name> signals the type of tool that is currently detected by the
179 hardware and is otherwise independent of ABS_DISTANCE and/or BTN_TOUCH.
176 180
177* ABS_MT_<name>: 181* ABS_MT_<name>:
178 - Used to describe multitouch input events. Please see 182 - Used to describe multitouch input events. Please see
diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index e8a84d12b7ff..1142a93dd90b 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -153,6 +153,7 @@ static const struct xpad_device {
153 { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 153 { 0x0738, 0x4728, "Mad Catz Street Fighter IV FightPad", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
154 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 }, 154 { 0x0738, 0x4738, "Mad Catz Wired Xbox 360 Controller (SFIV)", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOX360 },
155 { 0x0738, 0x4740, "Mad Catz Beat Pad", 0, XTYPE_XBOX360 }, 155 { 0x0738, 0x4740, "Mad Catz Beat Pad", 0, XTYPE_XBOX360 },
156 { 0x0738, 0x4a01, "Mad Catz FightStick TE 2", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
156 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX }, 157 { 0x0738, 0x6040, "Mad Catz Beat Pad Pro", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX },
157 { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 }, 158 { 0x0738, 0xb726, "Mad Catz Xbox controller - MW2", 0, XTYPE_XBOX360 },
158 { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 }, 159 { 0x0738, 0xbeef, "Mad Catz JOYTECH NEO SE Advanced GamePad", XTYPE_XBOX360 },
@@ -304,6 +305,7 @@ static struct usb_device_id xpad_table[] = {
304 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */ 305 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
305 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */ 306 XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
306 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */ 307 { USB_DEVICE(0x0738, 0x4540) }, /* Mad Catz Beat Pad */
308 XPAD_XBOXONE_VENDOR(0x0738), /* Mad Catz FightStick TE 2 */
307 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */ 309 XPAD_XBOX360_VENDOR(0x0e6f), /* 0x0e6f X-Box 360 controllers */
308 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */ 310 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
309 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */ 311 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
diff --git a/drivers/input/misc/arizona-haptics.c b/drivers/input/misc/arizona-haptics.c
index d5994a745ffa..982936334537 100644
--- a/drivers/input/misc/arizona-haptics.c
+++ b/drivers/input/misc/arizona-haptics.c
@@ -178,7 +178,6 @@ static int arizona_haptics_probe(struct platform_device *pdev)
178 input_set_drvdata(haptics->input_dev, haptics); 178 input_set_drvdata(haptics->input_dev, haptics);
179 179
180 haptics->input_dev->name = "arizona:haptics"; 180 haptics->input_dev->name = "arizona:haptics";
181 haptics->input_dev->dev.parent = pdev->dev.parent;
182 haptics->input_dev->close = arizona_haptics_close; 181 haptics->input_dev->close = arizona_haptics_close;
183 __set_bit(FF_RUMBLE, haptics->input_dev->ffbit); 182 __set_bit(FF_RUMBLE, haptics->input_dev->ffbit);
184 183
diff --git a/drivers/input/misc/max8997_haptic.c b/drivers/input/misc/max8997_haptic.c
index a806ba3818f7..8d6326d7e7be 100644
--- a/drivers/input/misc/max8997_haptic.c
+++ b/drivers/input/misc/max8997_haptic.c
@@ -255,12 +255,14 @@ static int max8997_haptic_probe(struct platform_device *pdev)
255 struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent); 255 struct max8997_dev *iodev = dev_get_drvdata(pdev->dev.parent);
256 const struct max8997_platform_data *pdata = 256 const struct max8997_platform_data *pdata =
257 dev_get_platdata(iodev->dev); 257 dev_get_platdata(iodev->dev);
258 const struct max8997_haptic_platform_data *haptic_pdata = 258 const struct max8997_haptic_platform_data *haptic_pdata = NULL;
259 pdata->haptic_pdata;
260 struct max8997_haptic *chip; 259 struct max8997_haptic *chip;
261 struct input_dev *input_dev; 260 struct input_dev *input_dev;
262 int error; 261 int error;
263 262
263 if (pdata)
264 haptic_pdata = pdata->haptic_pdata;
265
264 if (!haptic_pdata) { 266 if (!haptic_pdata) {
265 dev_err(&pdev->dev, "no haptic platform data\n"); 267 dev_err(&pdev->dev, "no haptic platform data\n");
266 return -EINVAL; 268 return -EINVAL;
diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
index 3f02e0e03d12..67aab86048ad 100644
--- a/drivers/input/misc/pmic8xxx-pwrkey.c
+++ b/drivers/input/misc/pmic8xxx-pwrkey.c
@@ -353,7 +353,8 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
353 if (of_property_read_u32(pdev->dev.of_node, "debounce", &kpd_delay)) 353 if (of_property_read_u32(pdev->dev.of_node, "debounce", &kpd_delay))
354 kpd_delay = 15625; 354 kpd_delay = 15625;
355 355
356 if (kpd_delay > 62500 || kpd_delay == 0) { 356 /* Valid range of pwr key trigger delay is 1/64 sec to 2 seconds. */
357 if (kpd_delay > USEC_PER_SEC * 2 || kpd_delay < USEC_PER_SEC / 64) {
357 dev_err(&pdev->dev, "invalid power key trigger delay\n"); 358 dev_err(&pdev->dev, "invalid power key trigger delay\n");
358 return -EINVAL; 359 return -EINVAL;
359 } 360 }
@@ -385,8 +386,8 @@ static int pmic8xxx_pwrkey_probe(struct platform_device *pdev)
385 pwr->name = "pmic8xxx_pwrkey"; 386 pwr->name = "pmic8xxx_pwrkey";
386 pwr->phys = "pmic8xxx_pwrkey/input0"; 387 pwr->phys = "pmic8xxx_pwrkey/input0";
387 388
388 delay = (kpd_delay << 10) / USEC_PER_SEC; 389 delay = (kpd_delay << 6) / USEC_PER_SEC;
389 delay = 1 + ilog2(delay); 390 delay = ilog2(delay);
390 391
391 err = regmap_read(regmap, PON_CNTL_1, &pon_cntl); 392 err = regmap_read(regmap, PON_CNTL_1, &pon_cntl);
392 if (err < 0) { 393 if (err < 0) {
diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c
index 10c4e3d462f1..caa5a62c42fb 100644
--- a/drivers/input/misc/twl4030-vibra.c
+++ b/drivers/input/misc/twl4030-vibra.c
@@ -222,7 +222,6 @@ static int twl4030_vibra_probe(struct platform_device *pdev)
222 222
223 info->input_dev->name = "twl4030:vibrator"; 223 info->input_dev->name = "twl4030:vibrator";
224 info->input_dev->id.version = 1; 224 info->input_dev->id.version = 1;
225 info->input_dev->dev.parent = pdev->dev.parent;
226 info->input_dev->close = twl4030_vibra_close; 225 info->input_dev->close = twl4030_vibra_close;
227 __set_bit(FF_RUMBLE, info->input_dev->ffbit); 226 __set_bit(FF_RUMBLE, info->input_dev->ffbit);
228 227
diff --git a/drivers/input/misc/twl6040-vibra.c b/drivers/input/misc/twl6040-vibra.c
index 36c8182b7bd2..5690eb7ff954 100644
--- a/drivers/input/misc/twl6040-vibra.c
+++ b/drivers/input/misc/twl6040-vibra.c
@@ -45,7 +45,6 @@
45struct vibra_info { 45struct vibra_info {
46 struct device *dev; 46 struct device *dev;
47 struct input_dev *input_dev; 47 struct input_dev *input_dev;
48 struct workqueue_struct *workqueue;
49 struct work_struct play_work; 48 struct work_struct play_work;
50 49
51 int irq; 50 int irq;
@@ -182,6 +181,14 @@ static void vibra_play_work(struct work_struct *work)
182{ 181{
183 struct vibra_info *info = container_of(work, 182 struct vibra_info *info = container_of(work,
184 struct vibra_info, play_work); 183 struct vibra_info, play_work);
184 int ret;
185
186 /* Do not allow effect, while the routing is set to use audio */
187 ret = twl6040_get_vibralr_status(info->twl6040);
188 if (ret & TWL6040_VIBSEL) {
189 dev_info(info->dev, "Vibra is configured for audio\n");
190 return;
191 }
185 192
186 if (info->weak_speed || info->strong_speed) { 193 if (info->weak_speed || info->strong_speed) {
187 if (!info->enabled) 194 if (!info->enabled)
@@ -197,24 +204,12 @@ static int vibra_play(struct input_dev *input, void *data,
197 struct ff_effect *effect) 204 struct ff_effect *effect)
198{ 205{
199 struct vibra_info *info = input_get_drvdata(input); 206 struct vibra_info *info = input_get_drvdata(input);
200 int ret;
201
202 /* Do not allow effect, while the routing is set to use audio */
203 ret = twl6040_get_vibralr_status(info->twl6040);
204 if (ret & TWL6040_VIBSEL) {
205 dev_info(&input->dev, "Vibra is configured for audio\n");
206 return -EBUSY;
207 }
208 207
209 info->weak_speed = effect->u.rumble.weak_magnitude; 208 info->weak_speed = effect->u.rumble.weak_magnitude;
210 info->strong_speed = effect->u.rumble.strong_magnitude; 209 info->strong_speed = effect->u.rumble.strong_magnitude;
211 info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1; 210 info->direction = effect->direction < EFFECT_DIR_180_DEG ? 1 : -1;
212 211
213 ret = queue_work(info->workqueue, &info->play_work); 212 schedule_work(&info->play_work);
214 if (!ret) {
215 dev_info(&input->dev, "work is already on queue\n");
216 return ret;
217 }
218 213
219 return 0; 214 return 0;
220} 215}
@@ -253,6 +248,7 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
253 int vddvibr_uV = 0; 248 int vddvibr_uV = 0;
254 int error; 249 int error;
255 250
251 of_node_get(twl6040_core_dev->of_node);
256 twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node, 252 twl6040_core_node = of_find_node_by_name(twl6040_core_dev->of_node,
257 "vibra"); 253 "vibra");
258 if (!twl6040_core_node) { 254 if (!twl6040_core_node) {
@@ -351,7 +347,6 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
351 347
352 info->input_dev->name = "twl6040:vibrator"; 348 info->input_dev->name = "twl6040:vibrator";
353 info->input_dev->id.version = 1; 349 info->input_dev->id.version = 1;
354 info->input_dev->dev.parent = pdev->dev.parent;
355 info->input_dev->close = twl6040_vibra_close; 350 info->input_dev->close = twl6040_vibra_close;
356 __set_bit(FF_RUMBLE, info->input_dev->ffbit); 351 __set_bit(FF_RUMBLE, info->input_dev->ffbit);
357 352
diff --git a/drivers/input/mouse/byd.c b/drivers/input/mouse/byd.c
index ec73f7564245..b27aa637f877 100644
--- a/drivers/input/mouse/byd.c
+++ b/drivers/input/mouse/byd.c
@@ -2,6 +2,10 @@
2 * BYD TouchPad PS/2 mouse driver 2 * BYD TouchPad PS/2 mouse driver
3 * 3 *
4 * Copyright (C) 2015 Chris Diamand <chris@diamand.org> 4 * Copyright (C) 2015 Chris Diamand <chris@diamand.org>
5 * Copyright (C) 2015 Richard Pospesel
6 * Copyright (C) 2015 Tai Chi Minh Ralph Eastwood
7 * Copyright (C) 2015 Martin Wimpress
8 * Copyright (C) 2015 Jay Kuri
5 * 9 *
6 * This program is free software; you can redistribute it and/or modify it 10 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by 11 * under the terms of the GNU General Public License version 2 as published by
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 362ae3b5e188..abf09ac42ce4 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -857,6 +857,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
857 goto err_free_buf; 857 goto err_free_buf;
858 } 858 }
859 859
860 /* Sanity check that a device has an endpoint */
861 if (usbinterface->altsetting[0].desc.bNumEndpoints < 1) {
862 dev_err(&usbinterface->dev,
863 "Invalid number of endpoints\n");
864 error = -EINVAL;
865 goto err_free_urb;
866 }
867
860 /* 868 /*
861 * The endpoint is always altsetting 0, we know this since we know 869 * The endpoint is always altsetting 0, we know this since we know
862 * this device only has one interrupt endpoint 870 * this device only has one interrupt endpoint
@@ -878,7 +886,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
878 * HID report descriptor 886 * HID report descriptor
879 */ 887 */
880 if (usb_get_extra_descriptor(usbinterface->cur_altsetting, 888 if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
881 HID_DEVICE_TYPE, &hid_desc) != 0){ 889 HID_DEVICE_TYPE, &hid_desc) != 0) {
882 dev_err(&usbinterface->dev, 890 dev_err(&usbinterface->dev,
883 "Can't retrieve exta USB descriptor to get hid report descriptor length\n"); 891 "Can't retrieve exta USB descriptor to get hid report descriptor length\n");
884 error = -EIO; 892 error = -EIO;
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 2160512e861a..5af7907d0af4 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -1093,6 +1093,19 @@ static int mxt_t6_command(struct mxt_data *data, u16 cmd_offset,
1093 return 0; 1093 return 0;
1094} 1094}
1095 1095
1096static int mxt_acquire_irq(struct mxt_data *data)
1097{
1098 int error;
1099
1100 enable_irq(data->irq);
1101
1102 error = mxt_process_messages_until_invalid(data);
1103 if (error)
1104 return error;
1105
1106 return 0;
1107}
1108
1096static int mxt_soft_reset(struct mxt_data *data) 1109static int mxt_soft_reset(struct mxt_data *data)
1097{ 1110{
1098 struct device *dev = &data->client->dev; 1111 struct device *dev = &data->client->dev;
@@ -1111,7 +1124,7 @@ static int mxt_soft_reset(struct mxt_data *data)
1111 /* Ignore CHG line for 100ms after reset */ 1124 /* Ignore CHG line for 100ms after reset */
1112 msleep(100); 1125 msleep(100);
1113 1126
1114 enable_irq(data->irq); 1127 mxt_acquire_irq(data);
1115 1128
1116 ret = mxt_wait_for_completion(data, &data->reset_completion, 1129 ret = mxt_wait_for_completion(data, &data->reset_completion,
1117 MXT_RESET_TIMEOUT); 1130 MXT_RESET_TIMEOUT);
@@ -1466,19 +1479,6 @@ release_mem:
1466 return ret; 1479 return ret;
1467} 1480}
1468 1481
1469static int mxt_acquire_irq(struct mxt_data *data)
1470{
1471 int error;
1472
1473 enable_irq(data->irq);
1474
1475 error = mxt_process_messages_until_invalid(data);
1476 if (error)
1477 return error;
1478
1479 return 0;
1480}
1481
1482static int mxt_get_info(struct mxt_data *data) 1482static int mxt_get_info(struct mxt_data *data)
1483{ 1483{
1484 struct i2c_client *client = data->client; 1484 struct i2c_client *client = data->client;
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 9bbadaaf6bc3..7b3845aa5983 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -370,8 +370,8 @@ static int zforce_touch_event(struct zforce_ts *ts, u8 *payload)
370 point.coord_x = point.coord_y = 0; 370 point.coord_x = point.coord_y = 0;
371 } 371 }
372 372
373 point.state = payload[9 * i + 5] & 0x03; 373 point.state = payload[9 * i + 5] & 0x0f;
374 point.id = (payload[9 * i + 5] & 0xfc) >> 2; 374 point.id = (payload[9 * i + 5] & 0xf0) >> 4;
375 375
376 /* determine touch major, minor and orientation */ 376 /* determine touch major, minor and orientation */
377 point.area_major = max(payload[9 * i + 6], 377 point.area_major = max(payload[9 * i + 6],