History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov: "Just a few assorted driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: elants_i2c - fix wake-on-touch Input: elan_i2c - set input device's vendor and product IDs Input: sun4i-lradc-keys - fix typo in binding documentation Input: atmel_mxt_ts - add maxtouch to I2C table for module autoload Input: arizona-haptic - fix disabling of haptics device Input: aiptek - fix crash on detecting device without endpoints Input: atmel_mxt_ts - add generic platform data for Chromebooks Input: parkbd - clear unused function pointers Input: walkera0701 - clear unused function pointers Input: turbografx - clear unused function pointers Input: gamecon - clear unused function pointers Input: db9 - clear unused function pointers

Linus Torvalds committed 10 years ago

Commit 632f8572 parents 1eab0e4 478e5ed11 files · +65 −12Browse files

Unified · Split

11 files
  1. Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt +1 −1
  2. drivers/input/joystick/db9.c +1 −0
  3. drivers/input/joystick/gamecon.c +1 −0
  4. drivers/input/joystick/turbografx.c +1 −0
  5. drivers/input/joystick/walkera0701.c +1 −0
  6. drivers/input/misc/arizona-haptics.c +1 −2
  7. drivers/input/mouse/elan_i2c_core.c +3 −0
  8. drivers/input/serio/parkbd.c +1 −0
  9. drivers/input/tablet/aiptek.c +9 −0
  10. drivers/input/touchscreen/atmel_mxt_ts.c +34 −0
  11. drivers/input/touchscreen/elants_i2c.c +12 −9
Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt+1−1
@@ -12,7 +12,7 @@ Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys": · 11 unmodified lines
1212 Required subnode-properties:
1313 - label: Descriptive name of the key.
1414 - linux,code: Keycode to emit.
15− - channel: Channel this key is attached to, mut be 0 or 1.
15+ - channel: Channel this key is attached to, must be 0 or 1.
1616 - voltage: Voltage in µV at lradc input when this key is pressed.
1717
1818 Example:
drivers/input/joystick/db9.c+1−0
@@ -592,6 +592,7 @@ static void db9_attach(struct parport *pp) · 591 unmodified lines
592592 return;
593593 }
594594
595+ memset(&db9_parport_cb, 0, sizeof(db9_parport_cb));
595596 db9_parport_cb.flags = PARPORT_FLAG_EXCL;
596597
597598 pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx);
drivers/input/joystick/gamecon.c+1−0
@@ -951,6 +951,7 @@ static void gc_attach(struct parport *pp) · 950 unmodified lines
951951 pads = gc_cfg[port_idx].args + 1;
952952 n_pads = gc_cfg[port_idx].nargs - 1;
953953
954+ memset(&gc_parport_cb, 0, sizeof(gc_parport_cb));
954955 gc_parport_cb.flags = PARPORT_FLAG_EXCL;
955956
956957 pd = parport_register_dev_model(pp, "gamecon", &gc_parport_cb,
drivers/input/joystick/turbografx.c+1−0
@@ -181,6 +181,7 @@ static void tgfx_attach(struct parport *pp) · 180 unmodified lines
181181 n_buttons = tgfx_cfg[port_idx].args + 1;
182182 n_devs = tgfx_cfg[port_idx].nargs - 1;
183183
184+ memset(&tgfx_parport_cb, 0, sizeof(tgfx_parport_cb));
184185 tgfx_parport_cb.flags = PARPORT_FLAG_EXCL;
185186
186187 pd = parport_register_dev_model(pp, "turbografx", &tgfx_parport_cb,
drivers/input/joystick/walkera0701.c+1−0
@@ -218,6 +218,7 @@ static void walkera0701_attach(struct parport *pp) · 217 unmodified lines
218218
219219 w->parport = pp;
220220
221+ memset(&walkera0701_parport_cb, 0, sizeof(walkera0701_parport_cb));
221222 walkera0701_parport_cb.flags = PARPORT_FLAG_EXCL;
222223 walkera0701_parport_cb.irq_func = walkera0701_irq_handler;
223224 walkera0701_parport_cb.private = w;
drivers/input/misc/arizona-haptics.c+1−2
@@ -97,8 +97,7 @@ static void arizona_haptics_work(struct work_struct *work) · 96 unmodified lines
9797
9898 ret = regmap_update_bits(arizona->regmap,
9999 ARIZONA_HAPTICS_CONTROL_1,
100− ARIZONA_HAP_CTRL_MASK,
101− 1 << ARIZONA_HAP_CTRL_SHIFT);
100+ ARIZONA_HAP_CTRL_MASK, 0);
102101 if (ret != 0) {
103102 dev_err(arizona->dev, "Failed to stop haptics: %d\n",
104103 ret);
drivers/input/mouse/elan_i2c_core.c+3−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141
4242 #define DRIVER_NAME "elan_i2c"
4343 #define ELAN_DRIVER_VERSION "1.6.1"
44+#define ELAN_VENDOR_ID 0x04f3
4445 #define ETP_MAX_PRESSURE 255
4546 #define ETP_FWIDTH_REDUCE 90
4647 #define ETP_FINGER_WIDTH 15
@@ -914,6 +915,8 @@ static int elan_setup_input_device(struct elan_tp_data *data) · 867 unmodified lines
914915
915916 input->name = "Elan Touchpad";
916917 input->id.bustype = BUS_I2C;
918+ input->id.vendor = ELAN_VENDOR_ID;
919+ input->id.product = data->product_id;
917920 input_set_drvdata(input, data);
918921
919922 error = input_mt_init_slots(input, ETP_MAX_FINGERS,
drivers/input/serio/parkbd.c+1−0
@@ -145,6 +145,7 @@ static int parkbd_getport(struct parport *pp) · 144 unmodified lines
145145 {
146146 struct pardev_cb parkbd_parport_cb;
147147
148+ memset(&parkbd_parport_cb, 0, sizeof(parkbd_parport_cb));
148149 parkbd_parport_cb.irq_func = parkbd_interrupt;
149150 parkbd_parport_cb.flags = PARPORT_FLAG_EXCL;
150151
drivers/input/tablet/aiptek.c+9−0
@@ -1819,6 +1819,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) · 1818 unmodified lines
18191819 input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
18201820 input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
18211821
1822+ /* Verify that a device really has an endpoint */
1823+ if (intf->altsetting[0].desc.bNumEndpoints < 1) {
1824+ dev_err(&intf->dev,
1825+ "interface has %d endpoints, but must have minimum 1\n",
1826+ intf->altsetting[0].desc.bNumEndpoints);
1827+ err = -EINVAL;
1828+ goto fail3;
1829+ }
18221830 endpoint = &intf->altsetting[0].endpoint[0].desc;
18231831
18241832 /* Go set up our URB, which is called when the tablet receives
@@ -1861,6 +1869,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) · 36 unmodified lines
18611869 if (i == ARRAY_SIZE(speeds)) {
18621870 dev_info(&intf->dev,
18631871 "Aiptek tried all speeds, no sane response\n");
1872+ err = -EINVAL;
18641873 goto fail3;
18651874 }
18661875
drivers/input/touchscreen/atmel_mxt_ts.c+34−0
@@ -2487,6 +2487,31 @@ static struct mxt_acpi_platform_data samus_platform_data[] = { · 2486 unmodified lines
24872487 { }
24882488 };
24892489
2490+static unsigned int chromebook_tp_buttons[] = {
2491+ KEY_RESERVED,
2492+ KEY_RESERVED,
2493+ KEY_RESERVED,
2494+ KEY_RESERVED,
2495+ KEY_RESERVED,
2496+ BTN_LEFT
2497+};
2498+
2499+static struct mxt_acpi_platform_data chromebook_platform_data[] = {
2500+ {
2501+ /* Touchpad */
2502+ .hid = "ATML0000",
2503+ .pdata = {
2504+ .t19_num_keys = ARRAY_SIZE(chromebook_tp_buttons),
2505+ .t19_keymap = chromebook_tp_buttons,
2506+ },
2507+ },
2508+ {
2509+ /* Touchscreen */
2510+ .hid = "ATML0001",
2511+ },
2512+ { }
2513+};
2514+
24902515 static const struct dmi_system_id mxt_dmi_table[] = {
24912516 {
24922517 /* 2015 Google Pixel */
@@ -2497,6 +2522,14 @@ static const struct dmi_system_id mxt_dmi_table[] = { · 4 unmodified lines
24972522 },
24982523 .driver_data = samus_platform_data,
24992524 },
2525+ {
2526+ /* Other Google Chromebooks */
2527+ .ident = "Chromebook",
2528+ .matches = {
2529+ DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
2530+ },
2531+ .driver_data = chromebook_platform_data,
2532+ },
25002533 { }
25012534 };
25022535
@@ -2701,6 +2734,7 @@ static const struct i2c_device_id mxt_id[] = { · 198 unmodified lines
27012734 { "qt602240_ts", 0 },
27022735 { "atmel_mxt_ts", 0 },
27032736 { "atmel_mxt_tp", 0 },
2737+ { "maxtouch", 0 },
27042738 { "mXT224", 0 },
27052739 { }
27062740 };
drivers/input/touchscreen/elants_i2c.c+12−9
@@ -1316,7 +1316,13 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev) · 1315 unmodified lines
13161316
13171317 disable_irq(client->irq);
13181318
1319− if (device_may_wakeup(dev) || ts->keep_power_in_suspend) {
1319+ if (device_may_wakeup(dev)) {
1320+ /*
1321+ * The device will automatically enter idle mode
1322+ * that has reduced power consumption.
1323+ */
1324+ ts->wake_irq_enabled = (enable_irq_wake(client->irq) == 0);
1325+ } else if (ts->keep_power_in_suspend) {
13201326 for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) {
13211327 error = elants_i2c_send(client, set_sleep_cmd,
13221328 sizeof(set_sleep_cmd));
@@ -1326,10 +1332,6 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev) · 3 unmodified lines
13261332 dev_err(&client->dev,
13271333 "suspend command failed: %d\n", error);
13281334 }
1329−
1330− if (device_may_wakeup(dev))
1331− ts->wake_irq_enabled =
1332− (enable_irq_wake(client->irq) == 0);
13331335 } else {
13341336 elants_i2c_power_off(ts);
13351337 }
@@ -1345,10 +1347,11 @@ static int __maybe_unused elants_i2c_resume(struct device *dev) · 9 unmodified lines
13451347 int retry_cnt;
13461348 int error;
13471349
1348− if (device_may_wakeup(dev) && ts->wake_irq_enabled)
1349− disable_irq_wake(client->irq);
1350−
1351− if (ts->keep_power_in_suspend) {
1350+ if (device_may_wakeup(dev)) {
1351+ if (ts->wake_irq_enabled)
1352+ disable_irq_wake(client->irq);
1353+ elants_i2c_sw_reset(client);
1354+ } else if (ts->keep_power_in_suspend) {
13521355 for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) {
13531356 error = elants_i2c_send(client, set_active_cmd,
13541357 sizeof(set_active_cmd));