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
Unified · Split
| @@ -12,7 +12,7 @@ Each key is represented as a sub-node of "allwinner,sun4i-a10-lradc-keys": · 11 unmodified lines | |||
| 12 | Required subnode-properties: | 12 | Required subnode-properties: |
| 13 | - label: Descriptive name of the key. | 13 | - label: Descriptive name of the key. |
| 14 | - linux,code: Keycode to emit. | 14 | - 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. |
| 16 | - voltage: Voltage in µV at lradc input when this key is pressed. | 16 | - voltage: Voltage in µV at lradc input when this key is pressed. |
| 17 | 17 | ||
| 18 | Example: | 18 | Example: |
| @@ -592,6 +592,7 @@ static void db9_attach(struct parport *pp) · 591 unmodified lines | |||
| 592 | return; | 592 | return; |
| 593 | } | 593 | } |
| 594 | 594 | ||
| 595 | memset(&db9_parport_cb, 0, sizeof(db9_parport_cb)); | ||
| 595 | db9_parport_cb.flags = PARPORT_FLAG_EXCL; | 596 | db9_parport_cb.flags = PARPORT_FLAG_EXCL; |
| 596 | 597 | ||
| 597 | pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx); | 598 | pd = parport_register_dev_model(pp, "db9", &db9_parport_cb, port_idx); |
| @@ -951,6 +951,7 @@ static void gc_attach(struct parport *pp) · 950 unmodified lines | |||
| 951 | pads = gc_cfg[port_idx].args + 1; | 951 | pads = gc_cfg[port_idx].args + 1; |
| 952 | n_pads = gc_cfg[port_idx].nargs - 1; | 952 | n_pads = gc_cfg[port_idx].nargs - 1; |
| 953 | 953 | ||
| 954 | memset(&gc_parport_cb, 0, sizeof(gc_parport_cb)); | ||
| 954 | gc_parport_cb.flags = PARPORT_FLAG_EXCL; | 955 | gc_parport_cb.flags = PARPORT_FLAG_EXCL; |
| 955 | 956 | ||
| 956 | pd = parport_register_dev_model(pp, "gamecon", &gc_parport_cb, | 957 | pd = parport_register_dev_model(pp, "gamecon", &gc_parport_cb, |
| @@ -181,6 +181,7 @@ static void tgfx_attach(struct parport *pp) · 180 unmodified lines | |||
| 181 | n_buttons = tgfx_cfg[port_idx].args + 1; | 181 | n_buttons = tgfx_cfg[port_idx].args + 1; |
| 182 | n_devs = tgfx_cfg[port_idx].nargs - 1; | 182 | n_devs = tgfx_cfg[port_idx].nargs - 1; |
| 183 | 183 | ||
| 184 | memset(&tgfx_parport_cb, 0, sizeof(tgfx_parport_cb)); | ||
| 184 | tgfx_parport_cb.flags = PARPORT_FLAG_EXCL; | 185 | tgfx_parport_cb.flags = PARPORT_FLAG_EXCL; |
| 185 | 186 | ||
| 186 | pd = parport_register_dev_model(pp, "turbografx", &tgfx_parport_cb, | 187 | pd = parport_register_dev_model(pp, "turbografx", &tgfx_parport_cb, |
| @@ -218,6 +218,7 @@ static void walkera0701_attach(struct parport *pp) · 217 unmodified lines | |||
| 218 | 218 | ||
| 219 | w->parport = pp; | 219 | w->parport = pp; |
| 220 | 220 | ||
| 221 | memset(&walkera0701_parport_cb, 0, sizeof(walkera0701_parport_cb)); | ||
| 221 | walkera0701_parport_cb.flags = PARPORT_FLAG_EXCL; | 222 | walkera0701_parport_cb.flags = PARPORT_FLAG_EXCL; |
| 222 | walkera0701_parport_cb.irq_func = walkera0701_irq_handler; | 223 | walkera0701_parport_cb.irq_func = walkera0701_irq_handler; |
| 223 | walkera0701_parport_cb.private = w; | 224 | walkera0701_parport_cb.private = w; |
| @@ -97,8 +97,7 @@ static void arizona_haptics_work(struct work_struct *work) · 96 unmodified lines | |||
| 97 | 97 | ||
| 98 | ret = regmap_update_bits(arizona->regmap, | 98 | ret = regmap_update_bits(arizona->regmap, |
| 99 | ARIZONA_HAPTICS_CONTROL_1, | 99 | ARIZONA_HAPTICS_CONTROL_1, |
| 100 | ARIZONA_HAP_CTRL_MASK, | 100 | ARIZONA_HAP_CTRL_MASK, 0); |
| 101 | 1 << ARIZONA_HAP_CTRL_SHIFT); | ||
| 102 | if (ret != 0) { | 101 | if (ret != 0) { |
| 103 | dev_err(arizona->dev, "Failed to stop haptics: %d\n", | 102 | dev_err(arizona->dev, "Failed to stop haptics: %d\n", |
| 104 | ret); | 103 | ret); |
| @@ -41,6 +41,7 @@ · 40 unmodified lines | |||
| 41 | 41 | ||
| 42 | #define DRIVER_NAME "elan_i2c" | 42 | #define DRIVER_NAME "elan_i2c" |
| 43 | #define ELAN_DRIVER_VERSION "1.6.1" | 43 | #define ELAN_DRIVER_VERSION "1.6.1" |
| 44 | #define ELAN_VENDOR_ID 0x04f3 | ||
| 44 | #define ETP_MAX_PRESSURE 255 | 45 | #define ETP_MAX_PRESSURE 255 |
| 45 | #define ETP_FWIDTH_REDUCE 90 | 46 | #define ETP_FWIDTH_REDUCE 90 |
| 46 | #define ETP_FINGER_WIDTH 15 | 47 | #define ETP_FINGER_WIDTH 15 |
| @@ -914,6 +915,8 @@ static int elan_setup_input_device(struct elan_tp_data *data) · 867 unmodified lines | |||
| 914 | 915 | ||
| 915 | input->name = "Elan Touchpad"; | 916 | input->name = "Elan Touchpad"; |
| 916 | input->id.bustype = BUS_I2C; | 917 | input->id.bustype = BUS_I2C; |
| 918 | input->id.vendor = ELAN_VENDOR_ID; | ||
| 919 | input->id.product = data->product_id; | ||
| 917 | input_set_drvdata(input, data); | 920 | input_set_drvdata(input, data); |
| 918 | 921 | ||
| 919 | error = input_mt_init_slots(input, ETP_MAX_FINGERS, | 922 | error = input_mt_init_slots(input, ETP_MAX_FINGERS, |
| @@ -145,6 +145,7 @@ static int parkbd_getport(struct parport *pp) · 144 unmodified lines | |||
| 145 | { | 145 | { |
| 146 | struct pardev_cb parkbd_parport_cb; | 146 | struct pardev_cb parkbd_parport_cb; |
| 147 | 147 | ||
| 148 | memset(&parkbd_parport_cb, 0, sizeof(parkbd_parport_cb)); | ||
| 148 | parkbd_parport_cb.irq_func = parkbd_interrupt; | 149 | parkbd_parport_cb.irq_func = parkbd_interrupt; |
| 149 | parkbd_parport_cb.flags = PARPORT_FLAG_EXCL; | 150 | parkbd_parport_cb.flags = PARPORT_FLAG_EXCL; |
| 150 | 151 | ||
| @@ -1819,6 +1819,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id) · 1818 unmodified lines | |||
| 1819 | input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); | 1819 | input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0); |
| 1820 | input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); | 1820 | input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0); |
| 1821 | 1821 | ||
| 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 | } | ||
| 1822 | endpoint = &intf->altsetting[0].endpoint[0].desc; | 1830 | endpoint = &intf->altsetting[0].endpoint[0].desc; |
| 1823 | 1831 | ||
| 1824 | /* Go set up our URB, which is called when the tablet receives | 1832 | /* 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 | |||
| 1861 | if (i == ARRAY_SIZE(speeds)) { | 1869 | if (i == ARRAY_SIZE(speeds)) { |
| 1862 | dev_info(&intf->dev, | 1870 | dev_info(&intf->dev, |
| 1863 | "Aiptek tried all speeds, no sane response\n"); | 1871 | "Aiptek tried all speeds, no sane response\n"); |
| 1872 | err = -EINVAL; | ||
| 1864 | goto fail3; | 1873 | goto fail3; |
| 1865 | } | 1874 | } |
| 1866 | 1875 | ||
| @@ -2487,6 +2487,31 @@ static struct mxt_acpi_platform_data samus_platform_data[] = { · 2486 unmodified lines | |||
| 2487 | { } | 2487 | { } |
| 2488 | }; | 2488 | }; |
| 2489 | 2489 | ||
| 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 | |||
| 2490 | static const struct dmi_system_id mxt_dmi_table[] = { | 2515 | static const struct dmi_system_id mxt_dmi_table[] = { |
| 2491 | { | 2516 | { |
| 2492 | /* 2015 Google Pixel */ | 2517 | /* 2015 Google Pixel */ |
| @@ -2497,6 +2522,14 @@ static const struct dmi_system_id mxt_dmi_table[] = { · 4 unmodified lines | |||
| 2497 | }, | 2522 | }, |
| 2498 | .driver_data = samus_platform_data, | 2523 | .driver_data = samus_platform_data, |
| 2499 | }, | 2524 | }, |
| 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 | }, | ||
| 2500 | { } | 2533 | { } |
| 2501 | }; | 2534 | }; |
| 2502 | 2535 | ||
| @@ -2701,6 +2734,7 @@ static const struct i2c_device_id mxt_id[] = { · 198 unmodified lines | |||
| 2701 | { "qt602240_ts", 0 }, | 2734 | { "qt602240_ts", 0 }, |
| 2702 | { "atmel_mxt_ts", 0 }, | 2735 | { "atmel_mxt_ts", 0 }, |
| 2703 | { "atmel_mxt_tp", 0 }, | 2736 | { "atmel_mxt_tp", 0 }, |
| 2737 | { "maxtouch", 0 }, | ||
| 2704 | { "mXT224", 0 }, | 2738 | { "mXT224", 0 }, |
| 2705 | { } | 2739 | { } |
| 2706 | }; | 2740 | }; |
| @@ -1316,7 +1316,13 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev) · 1315 unmodified lines | |||
| 1316 | 1316 | ||
| 1317 | disable_irq(client->irq); | 1317 | disable_irq(client->irq); |
| 1318 | 1318 | ||
| 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) { | ||
| 1320 | for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) { | 1326 | for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) { |
| 1321 | error = elants_i2c_send(client, set_sleep_cmd, | 1327 | error = elants_i2c_send(client, set_sleep_cmd, |
| 1322 | sizeof(set_sleep_cmd)); | 1328 | sizeof(set_sleep_cmd)); |
| @@ -1326,10 +1332,6 @@ static int __maybe_unused elants_i2c_suspend(struct device *dev) · 3 unmodified lines | |||
| 1326 | dev_err(&client->dev, | 1332 | dev_err(&client->dev, |
| 1327 | "suspend command failed: %d\n", error); | 1333 | "suspend command failed: %d\n", error); |
| 1328 | } | 1334 | } |
| 1329 | |||
| 1330 | if (device_may_wakeup(dev)) | ||
| 1331 | ts->wake_irq_enabled = | ||
| 1332 | (enable_irq_wake(client->irq) == 0); | ||
| 1333 | } else { | 1335 | } else { |
| 1334 | elants_i2c_power_off(ts); | 1336 | elants_i2c_power_off(ts); |
| 1335 | } | 1337 | } |
| @@ -1345,10 +1347,11 @@ static int __maybe_unused elants_i2c_resume(struct device *dev) · 9 unmodified lines | |||
| 1345 | int retry_cnt; | 1347 | int retry_cnt; |
| 1346 | int error; | 1348 | int error; |
| 1347 | 1349 | ||
| 1348 | if (device_may_wakeup(dev) && ts->wake_irq_enabled) | 1350 | if (device_may_wakeup(dev)) { |
| 1349 | disable_irq_wake(client->irq); | 1351 | if (ts->wake_irq_enabled) |
| 1350 | 1352 | disable_irq_wake(client->irq); | |
| 1351 | if (ts->keep_power_in_suspend) { | 1353 | elants_i2c_sw_reset(client); |
| 1354 | } else if (ts->keep_power_in_suspend) { | ||
| 1352 | for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) { | 1355 | for (retry_cnt = 0; retry_cnt < MAX_RETRIES; retry_cnt++) { |
| 1353 | error = elants_i2c_send(client, set_active_cmd, | 1356 | error = elants_i2c_send(client, set_active_cmd, |
| 1354 | sizeof(set_active_cmd)); | 1357 | sizeof(set_active_cmd)); |