Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull second round of input updates from Dmitry Torokhov:
"Mostly simple bug fixes, although we do have one brand new driver for
Microchip AR1021 i2c touchscreen.

Also there is the change to stop trying to use i8042 active
multiplexing by default (it is still possible to activate it via
i8042.nomux=0 on boxes that implement it)"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: xpad - add Thrustmaster as Xbox 360 controller vendor
Input: xpad - add USB ID for Thrustmaster Ferrari 458 Racing Wheel
Input: max77693-haptic - fix state check in imax77693_haptic_disable()
Input: xen-kbdfront - free grant table entry in xenkbd_disconnect_backend
Input: alps - fix v4 button press recognition
Input: i8042 - disable active multiplexing by default
Input: i8042 - add noloop quirk for Asus X750LN
Input: synaptics - gate forcepad support by DMI check
Input: Add Microchip AR1021 i2c touchscreen
Input: cros_ec_keyb - add of match table
Input: serio - avoid negative serio device numbers
Input: avoid negative input device numbers
Input: automatically set EV_ABS bit in input_set_abs_params
Input: adp5588-keys - cancel workqueue in failure path
Input: opencores-kbd - switch to using managed resources
Input: evdev - fix EVIOCG{type} ioctl

+280 -351
+1 -1
Documentation/kernel-parameters.txt
··· 1260 1260 i8042.noloop [HW] Disable the AUX Loopback command while probing 1261 1261 for the AUX port 1262 1262 i8042.nomux [HW] Don't check presence of an active multiplexing 1263 - controller 1263 + controller. Default: true. 1264 1264 i8042.nopnp [HW] Don't use ACPIPnP / PnPBIOS to discover KBD/AUX 1265 1265 controllers 1266 1266 i8042.notimeout [HW] Ignore timeout condition signalled by controller
+8 -5
drivers/input/evdev.c
··· 738 738 */ 739 739 static int evdev_handle_get_val(struct evdev_client *client, 740 740 struct input_dev *dev, unsigned int type, 741 - unsigned long *bits, unsigned int max, 742 - unsigned int size, void __user *p, int compat) 741 + unsigned long *bits, unsigned int maxbit, 742 + unsigned int maxlen, void __user *p, 743 + int compat) 743 744 { 744 745 int ret; 745 746 unsigned long *mem; 747 + size_t len; 746 748 747 - mem = kmalloc(sizeof(unsigned long) * max, GFP_KERNEL); 749 + len = BITS_TO_LONGS(maxbit) * sizeof(unsigned long); 750 + mem = kmalloc(len, GFP_KERNEL); 748 751 if (!mem) 749 752 return -ENOMEM; 750 753 751 754 spin_lock_irq(&dev->event_lock); 752 755 spin_lock(&client->buffer_lock); 753 756 754 - memcpy(mem, bits, sizeof(unsigned long) * max); 757 + memcpy(mem, bits, len); 755 758 756 759 spin_unlock(&dev->event_lock); 757 760 ··· 762 759 763 760 spin_unlock_irq(&client->buffer_lock); 764 761 765 - ret = bits_to_user(mem, max, size, p, compat); 762 + ret = bits_to_user(mem, maxbit, maxlen, p, compat); 766 763 if (ret < 0) 767 764 evdev_queue_syn_dropped(client); 768 765
+3 -2
drivers/input/input.c
··· 498 498 absinfo->fuzz = fuzz; 499 499 absinfo->flat = flat; 500 500 501 - dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); 501 + __set_bit(EV_ABS, dev->evbit); 502 + __set_bit(axis, dev->absbit); 502 503 } 503 504 EXPORT_SYMBOL(input_set_abs_params); 504 505 ··· 1789 1788 INIT_LIST_HEAD(&dev->h_list); 1790 1789 INIT_LIST_HEAD(&dev->node); 1791 1790 1792 - dev_set_name(&dev->dev, "input%ld", 1791 + dev_set_name(&dev->dev, "input%lu", 1793 1792 (unsigned long) atomic_inc_return(&input_no) - 1); 1794 1793 1795 1794 __module_get(THIS_MODULE);
+2
drivers/input/joystick/xpad.c
··· 209 209 { 0x24c6, 0x5501, "Hori Real Arcade Pro VX-SA", 0, XTYPE_XBOX360 }, 210 210 { 0x24c6, 0x5506, "Hori SOULCALIBUR V Stick", 0, XTYPE_XBOX360 }, 211 211 { 0x24c6, 0x5b02, "Thrustmaster, Inc. GPX Controller", 0, XTYPE_XBOX360 }, 212 + { 0x24c6, 0x5b03, "Thrustmaster Ferrari 458 Racing Wheel", 0, XTYPE_XBOX360 }, 212 213 { 0xffff, 0xffff, "Chinese-made Xbox Controller", 0, XTYPE_XBOX }, 213 214 { 0x0000, 0x0000, "Generic X-Box pad", 0, XTYPE_UNKNOWN } 214 215 }; ··· 293 292 294 293 static struct usb_device_id xpad_table[] = { 295 294 { USB_INTERFACE_INFO('X', 'B', 0) }, /* X-Box USB-IF not approved class */ 295 + XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster X-Box 360 controllers */ 296 296 XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */ 297 297 XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */ 298 298 XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
+1
drivers/input/keyboard/adp5588-keys.c
··· 587 587 588 588 err_free_irq: 589 589 free_irq(client->irq, kpad); 590 + cancel_delayed_work_sync(&kpad->work); 590 591 err_unreg_dev: 591 592 input_unregister_device(input); 592 593 input = NULL;
+9
drivers/input/keyboard/cros_ec_keyb.c
··· 348 348 349 349 static SIMPLE_DEV_PM_OPS(cros_ec_keyb_pm_ops, NULL, cros_ec_keyb_resume); 350 350 351 + #ifdef CONFIG_OF 352 + static const struct of_device_id cros_ec_keyb_of_match[] = { 353 + { .compatible = "google,cros-ec-keyb" }, 354 + {}, 355 + }; 356 + MODULE_DEVICE_TABLE(of, cros_ec_keyb_of_match); 357 + #endif 358 + 351 359 static struct platform_driver cros_ec_keyb_driver = { 352 360 .probe = cros_ec_keyb_probe, 353 361 .driver = { 354 362 .name = "cros-ec-keyb", 363 + .of_match_table = of_match_ptr(cros_ec_keyb_of_match), 355 364 .pm = &cros_ec_keyb_pm_ops, 356 365 }, 357 366 };
+17 -55
drivers/input/keyboard/opencores-kbd.c
··· 18 18 19 19 struct opencores_kbd { 20 20 struct input_dev *input; 21 - struct resource *addr_res; 22 21 void __iomem *addr; 23 22 int irq; 24 23 unsigned short keycodes[128]; ··· 55 56 return -EINVAL; 56 57 } 57 58 58 - opencores_kbd = kzalloc(sizeof(*opencores_kbd), GFP_KERNEL); 59 - input = input_allocate_device(); 60 - if (!opencores_kbd || !input) { 61 - dev_err(&pdev->dev, "failed to allocate device structures\n"); 62 - error = -ENOMEM; 63 - goto err_free_mem; 64 - } 59 + opencores_kbd = devm_kzalloc(&pdev->dev, sizeof(*opencores_kbd), 60 + GFP_KERNEL); 61 + if (!opencores_kbd) 62 + return -ENOMEM; 65 63 66 - opencores_kbd->addr_res = res; 67 - res = request_mem_region(res->start, resource_size(res), pdev->name); 68 - if (!res) { 69 - dev_err(&pdev->dev, "failed to request I/O memory\n"); 70 - error = -EBUSY; 71 - goto err_free_mem; 72 - } 73 - 74 - opencores_kbd->addr = ioremap(res->start, resource_size(res)); 75 - if (!opencores_kbd->addr) { 76 - dev_err(&pdev->dev, "failed to remap I/O memory\n"); 77 - error = -ENXIO; 78 - goto err_rel_mem; 64 + input = devm_input_allocate_device(&pdev->dev); 65 + if (!input) { 66 + dev_err(&pdev->dev, "failed to allocate input device\n"); 67 + return -ENOMEM; 79 68 } 80 69 81 70 opencores_kbd->input = input; 82 - opencores_kbd->irq = irq; 71 + 72 + opencores_kbd->addr = devm_ioremap_resource(&pdev->dev, res); 73 + if (IS_ERR(opencores_kbd->addr)) 74 + error = PTR_ERR(opencores_kbd->addr); 83 75 84 76 input->name = pdev->name; 85 77 input->phys = "opencores-kbd/input0"; 86 - input->dev.parent = &pdev->dev; 87 78 88 79 input_set_drvdata(input, opencores_kbd); 89 80 ··· 98 109 } 99 110 __clear_bit(KEY_RESERVED, input->keybit); 100 111 101 - error = request_irq(irq, &opencores_kbd_isr, 102 - IRQF_TRIGGER_RISING, pdev->name, opencores_kbd); 112 + error = devm_request_irq(&pdev->dev, irq, &opencores_kbd_isr, 113 + IRQF_TRIGGER_RISING, 114 + pdev->name, opencores_kbd); 103 115 if (error) { 104 116 dev_err(&pdev->dev, "unable to claim irq %d\n", irq); 105 - goto err_unmap_mem; 117 + return error; 106 118 } 107 119 108 120 error = input_register_device(input); 109 121 if (error) { 110 122 dev_err(&pdev->dev, "unable to register input device\n"); 111 - goto err_free_irq; 123 + return error; 112 124 } 113 125 114 126 platform_set_drvdata(pdev, opencores_kbd); 115 - 116 - return 0; 117 - 118 - err_free_irq: 119 - free_irq(irq, opencores_kbd); 120 - err_unmap_mem: 121 - iounmap(opencores_kbd->addr); 122 - err_rel_mem: 123 - release_mem_region(res->start, resource_size(res)); 124 - err_free_mem: 125 - input_free_device(input); 126 - kfree(opencores_kbd); 127 - 128 - return error; 129 - } 130 - 131 - static int opencores_kbd_remove(struct platform_device *pdev) 132 - { 133 - struct opencores_kbd *opencores_kbd = platform_get_drvdata(pdev); 134 - 135 - free_irq(opencores_kbd->irq, opencores_kbd); 136 - 137 - iounmap(opencores_kbd->addr); 138 - release_mem_region(opencores_kbd->addr_res->start, 139 - resource_size(opencores_kbd->addr_res)); 140 - input_unregister_device(opencores_kbd->input); 141 - kfree(opencores_kbd); 142 127 143 128 return 0; 144 129 } 145 130 146 131 static struct platform_driver opencores_kbd_device_driver = { 147 132 .probe = opencores_kbd_probe, 148 - .remove = opencores_kbd_remove, 149 133 .driver = { 150 134 .name = "opencores-kbd", 151 135 },
+1 -1
drivers/input/misc/max77693-haptic.c
··· 152 152 { 153 153 int error; 154 154 155 - if (haptic->enabled) 155 + if (!haptic->enabled) 156 156 return; 157 157 158 158 error = max77693_haptic_configure(haptic, false);
+2 -2
drivers/input/misc/xen-kbdfront.c
··· 285 285 error_evtchan: 286 286 xenbus_free_evtchn(dev, evtchn); 287 287 error_grant: 288 - gnttab_end_foreign_access_ref(info->gref, 0); 288 + gnttab_end_foreign_access(info->gref, 0, 0UL); 289 289 info->gref = -1; 290 290 return ret; 291 291 } ··· 296 296 unbind_from_irqhandler(info->irq, info); 297 297 info->irq = -1; 298 298 if (info->gref >= 0) 299 - gnttab_end_foreign_access_ref(info->gref, 0); 299 + gnttab_end_foreign_access(info->gref, 0, 0UL); 300 300 info->gref = -1; 301 301 } 302 302
+2 -2
drivers/input/mouse/alps.c
··· 835 835 f->fingers = alps_process_bitmap(priv, f); 836 836 } 837 837 838 - f->left = packet[4] & 0x01; 839 - f->right = packet[4] & 0x02; 838 + f->left = !!(packet[4] & 0x01); 839 + f->right = !!(packet[4] & 0x02); 840 840 841 841 f->st.x = ((packet[1] & 0x7f) << 4) | ((packet[3] & 0x30) >> 2) | 842 842 ((packet[0] & 0x30) >> 4);
+21 -1
drivers/input/mouse/synaptics.c
··· 607 607 priv->agm_pending = true; 608 608 } 609 609 610 + static bool is_forcepad; 611 + 610 612 static int synaptics_parse_hw_state(const unsigned char buf[], 611 613 struct synaptics_data *priv, 612 614 struct synaptics_hw_state *hw) ··· 638 636 hw->left = (buf[0] & 0x01) ? 1 : 0; 639 637 hw->right = (buf[0] & 0x02) ? 1 : 0; 640 638 641 - if (SYN_CAP_FORCEPAD(priv->ext_cap_0c)) { 639 + if (is_forcepad) { 642 640 /* 643 641 * ForcePads, like Clickpads, use middle button 644 642 * bits to report primary button clicks. ··· 1669 1667 { } 1670 1668 }; 1671 1669 1670 + static const struct dmi_system_id forcepad_dmi_table[] __initconst = { 1671 + #if defined(CONFIG_DMI) && defined(CONFIG_X86) 1672 + { 1673 + .matches = { 1674 + DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 1675 + DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook Folio 1040 G1"), 1676 + }, 1677 + }, 1678 + #endif 1679 + { } 1680 + }; 1681 + 1672 1682 void __init synaptics_module_init(void) 1673 1683 { 1674 1684 impaired_toshiba_kbc = dmi_check_system(toshiba_dmi_table); 1675 1685 broken_olpc_ec = dmi_check_system(olpc_dmi_table); 1676 1686 cr48_profile_sensor = dmi_check_system(cr48_dmi_table); 1687 + 1688 + /* 1689 + * Unfortunately ForcePad capability is not exported over PS/2, 1690 + * so we have to resort to checking DMI. 1691 + */ 1692 + is_forcepad = dmi_check_system(forcepad_dmi_table); 1677 1693 } 1678 1694 1679 1695 static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
+2 -6
drivers/input/mouse/synaptics.h
··· 77 77 * for noise. 78 78 * 2 0x08 image sensor image sensor tracks 5 fingers, but only 79 79 * reports 2. 80 + * 2 0x01 uniform clickpad whole clickpad moves instead of being 81 + * hinged at the top. 80 82 * 2 0x20 report min query 0x0f gives min coord reported 81 - * 2 0x80 forcepad forcepad is a variant of clickpad that 82 - * does not have physical buttons but rather 83 - * uses pressure above certain threshold to 84 - * report primary clicks. Forcepads also have 85 - * clickpad bit set. 86 83 */ 87 84 #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ 88 85 #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ ··· 88 91 #define SYN_CAP_ADV_GESTURE(ex0c) ((ex0c) & 0x080000) 89 92 #define SYN_CAP_REDUCED_FILTERING(ex0c) ((ex0c) & 0x000400) 90 93 #define SYN_CAP_IMAGE_SENSOR(ex0c) ((ex0c) & 0x000800) 91 - #define SYN_CAP_FORCEPAD(ex0c) ((ex0c) & 0x008000) 92 94 93 95 /* synaptics modes query bits */ 94 96 #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7))
+14 -273
drivers/input/serio/i8042-x86ia64io.h
··· 101 101 }, 102 102 { 103 103 .matches = { 104 + DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 105 + DMI_MATCH(DMI_PRODUCT_NAME, "X750LN"), 106 + }, 107 + }, 108 + { 109 + .matches = { 104 110 DMI_MATCH(DMI_SYS_VENDOR, "Compaq"), 105 111 DMI_MATCH(DMI_PRODUCT_NAME , "ProLiant"), 106 112 DMI_MATCH(DMI_PRODUCT_VERSION, "8500"), ··· 207 201 }; 208 202 209 203 /* 210 - * Some Fujitsu notebooks are having trouble with touchpads if 211 - * active multiplexing mode is activated. Luckily they don't have 212 - * external PS/2 ports so we can safely disable it. 213 - * ... apparently some Toshibas don't like MUX mode either and 214 - * die horrible death on reboot. 204 + * Some laptops do implement active multiplexing mode correctly; 205 + * unfortunately they are in minority. 215 206 */ 216 - static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { 217 - { 218 - /* Fujitsu Lifebook P7010/P7010D */ 219 - .matches = { 220 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 221 - DMI_MATCH(DMI_PRODUCT_NAME, "P7010"), 222 - }, 223 - }, 224 - { 225 - /* Fujitsu Lifebook P7010 */ 226 - .matches = { 227 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 228 - DMI_MATCH(DMI_PRODUCT_NAME, "0000000000"), 229 - }, 230 - }, 231 - { 232 - /* Fujitsu Lifebook P5020D */ 233 - .matches = { 234 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 235 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook P Series"), 236 - }, 237 - }, 238 - { 239 - /* Fujitsu Lifebook S2000 */ 240 - .matches = { 241 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 242 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S Series"), 243 - }, 244 - }, 245 - { 246 - /* Fujitsu Lifebook S6230 */ 247 - .matches = { 248 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 249 - DMI_MATCH(DMI_PRODUCT_NAME, "LifeBook S6230"), 250 - }, 251 - }, 252 - { 253 - /* Fujitsu T70H */ 254 - .matches = { 255 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"), 256 - DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"), 257 - }, 258 - }, 259 - { 260 - /* Fujitsu-Siemens Lifebook T3010 */ 261 - .matches = { 262 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 263 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK T3010"), 264 - }, 265 - }, 266 - { 267 - /* Fujitsu-Siemens Lifebook E4010 */ 268 - .matches = { 269 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 270 - DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E4010"), 271 - }, 272 - }, 273 - { 274 - /* Fujitsu-Siemens Amilo Pro 2010 */ 275 - .matches = { 276 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 277 - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Pro V2010"), 278 - }, 279 - }, 280 - { 281 - /* Fujitsu-Siemens Amilo Pro 2030 */ 282 - .matches = { 283 - DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), 284 - DMI_MATCH(DMI_PRODUCT_NAME, "AMILO PRO V2030"), 285 - }, 286 - }, 207 + static const struct dmi_system_id __initconst i8042_dmi_mux_table[] = { 287 208 { 288 209 /* 289 - * No data is coming from the touchscreen unless KBC 290 - * is in legacy mode. 291 - */ 292 - /* Panasonic CF-29 */ 293 - .matches = { 294 - DMI_MATCH(DMI_SYS_VENDOR, "Matsushita"), 295 - DMI_MATCH(DMI_PRODUCT_NAME, "CF-29"), 296 - }, 297 - }, 298 - { 299 - /* 300 - * HP Pavilion DV4017EA - 301 - * errors on MUX ports are reported without raising AUXDATA 302 - * causing "spurious NAK" messages. 210 + * Panasonic CF-18 needs to be in MUX mode since the 211 + * touchscreen is on serio3 and it also has touchpad. 303 212 */ 304 213 .matches = { 305 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 306 - DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EA032EA#ABF)"), 307 - }, 308 - }, 309 - { 310 - /* 311 - * HP Pavilion ZT1000 - 312 - * like DV4017EA does not raise AUXERR for errors on MUX ports. 313 - */ 314 - .matches = { 315 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 316 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Notebook PC"), 317 - DMI_MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook ZT1000"), 318 - }, 319 - }, 320 - { 321 - /* 322 - * HP Pavilion DV4270ca - 323 - * like DV4017EA does not raise AUXERR for errors on MUX ports. 324 - */ 325 - .matches = { 326 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 327 - DMI_MATCH(DMI_PRODUCT_NAME, "Pavilion dv4000 (EH476UA#ABL)"), 328 - }, 329 - }, 330 - { 331 - .matches = { 332 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 333 - DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"), 334 - }, 335 - }, 336 - { 337 - .matches = { 338 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 339 - DMI_MATCH(DMI_PRODUCT_NAME, "EQUIUM A110"), 340 - }, 341 - }, 342 - { 343 - .matches = { 344 - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), 345 - DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE C850D"), 346 - }, 347 - }, 348 - { 349 - .matches = { 350 - DMI_MATCH(DMI_SYS_VENDOR, "ALIENWARE"), 351 - DMI_MATCH(DMI_PRODUCT_NAME, "Sentia"), 352 - }, 353 - }, 354 - { 355 - /* Sharp Actius MM20 */ 356 - .matches = { 357 - DMI_MATCH(DMI_SYS_VENDOR, "SHARP"), 358 - DMI_MATCH(DMI_PRODUCT_NAME, "PC-MM20 Series"), 359 - }, 360 - }, 361 - { 362 - /* Sony Vaio FS-115b */ 363 - .matches = { 364 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 365 - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FS115B"), 366 - }, 367 - }, 368 - { 369 - /* 370 - * Sony Vaio FZ-240E - 371 - * reset and GET ID commands issued via KBD port are 372 - * sometimes being delivered to AUX3. 373 - */ 374 - .matches = { 375 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 376 - DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FZ240E"), 377 - }, 378 - }, 379 - { 380 - /* 381 - * Most (all?) VAIOs do not have external PS/2 ports nor 382 - * they implement active multiplexing properly, and 383 - * MUX discovery usually messes up keyboard/touchpad. 384 - */ 385 - .matches = { 386 - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), 387 - DMI_MATCH(DMI_BOARD_NAME, "VAIO"), 388 - }, 389 - }, 390 - { 391 - /* Amoi M636/A737 */ 392 - .matches = { 393 - DMI_MATCH(DMI_SYS_VENDOR, "Amoi Electronics CO.,LTD."), 394 - DMI_MATCH(DMI_PRODUCT_NAME, "M636/A737 platform"), 395 - }, 396 - }, 397 - { 398 - /* Lenovo 3000 n100 */ 399 - .matches = { 400 - DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), 401 - DMI_MATCH(DMI_PRODUCT_NAME, "076804U"), 402 - }, 403 - }, 404 - { 405 - .matches = { 406 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 407 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1360"), 408 - }, 409 - }, 410 - { 411 - /* Acer Aspire 5710 */ 412 - .matches = { 413 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 414 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710"), 415 - }, 416 - }, 417 - { 418 - /* Gericom Bellagio */ 419 - .matches = { 420 - DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), 421 - DMI_MATCH(DMI_PRODUCT_NAME, "N34AS6"), 422 - }, 423 - }, 424 - { 425 - /* IBM 2656 */ 426 - .matches = { 427 - DMI_MATCH(DMI_SYS_VENDOR, "IBM"), 428 - DMI_MATCH(DMI_PRODUCT_NAME, "2656"), 429 - }, 430 - }, 431 - { 432 - /* Dell XPS M1530 */ 433 - .matches = { 434 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 435 - DMI_MATCH(DMI_PRODUCT_NAME, "XPS M1530"), 436 - }, 437 - }, 438 - { 439 - /* Compal HEL80I */ 440 - .matches = { 441 - DMI_MATCH(DMI_SYS_VENDOR, "COMPAL"), 442 - DMI_MATCH(DMI_PRODUCT_NAME, "HEL80I"), 443 - }, 444 - }, 445 - { 446 - /* Dell Vostro 1510 */ 447 - .matches = { 448 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 449 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro1510"), 450 - }, 451 - }, 452 - { 453 - /* Acer Aspire 5536 */ 454 - .matches = { 455 - DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 456 - DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5536"), 457 - DMI_MATCH(DMI_PRODUCT_VERSION, "0100"), 458 - }, 459 - }, 460 - { 461 - /* Dell Vostro V13 */ 462 - .matches = { 463 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 464 - DMI_MATCH(DMI_PRODUCT_NAME, "Vostro V13"), 465 - }, 466 - }, 467 - { 468 - /* Newer HP Pavilion dv4 models */ 469 - .matches = { 470 - DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), 471 - DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4 Notebook PC"), 472 - }, 473 - }, 474 - { 475 - /* Asus X450LCP */ 476 - .matches = { 477 - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), 478 - DMI_MATCH(DMI_PRODUCT_NAME, "X450LCP"), 479 - }, 480 - }, 481 - { 482 - /* Avatar AVIU-145A6 */ 483 - .matches = { 484 - DMI_MATCH(DMI_SYS_VENDOR, "Intel"), 485 - DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"), 214 + DMI_MATCH(DMI_PRODUCT_NAME, "CF-18"), 486 215 }, 487 216 }, 488 217 { } ··· 740 999 if (dmi_check_system(i8042_dmi_noloop_table)) 741 1000 i8042_noloop = true; 742 1001 743 - if (dmi_check_system(i8042_dmi_nomux_table)) 744 - i8042_nomux = true; 1002 + if (dmi_check_system(i8042_dmi_mux_table)) 1003 + i8042_nomux = false; 745 1004 746 1005 if (dmi_check_system(i8042_dmi_notimeout_table)) 747 1006 i8042_notimeout = true;
+1 -1
drivers/input/serio/i8042.c
··· 39 39 module_param_named(noaux, i8042_noaux, bool, 0); 40 40 MODULE_PARM_DESC(noaux, "Do not probe or use AUX (mouse) port."); 41 41 42 - static bool i8042_nomux; 42 + static bool i8042_nomux = true; 43 43 module_param_named(nomux, i8042_nomux, bool, 0); 44 44 MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing controller is present."); 45 45
+2 -2
drivers/input/serio/serio.c
··· 524 524 spin_lock_init(&serio->lock); 525 525 mutex_init(&serio->drv_mutex); 526 526 device_initialize(&serio->dev); 527 - dev_set_name(&serio->dev, "serio%ld", 528 - (long)atomic_inc_return(&serio_no) - 1); 527 + dev_set_name(&serio->dev, "serio%lu", 528 + (unsigned long)atomic_inc_return(&serio_no) - 1); 529 529 serio->dev.bus = &serio_bus; 530 530 serio->dev.release = serio_release_port; 531 531 serio->dev.groups = serio_device_attr_groups;
+12
drivers/input/touchscreen/Kconfig
··· 90 90 To compile this driver as a module, choose M here: the 91 91 module will be called ad7879-spi. 92 92 93 + config TOUCHSCREEN_AR1021_I2C 94 + tristate "Microchip AR1021 i2c touchscreen" 95 + depends on I2C && OF 96 + help 97 + Say Y here if you have the Microchip AR1021 touchscreen controller 98 + chip in your system. 99 + 100 + If unsure, say N. 101 + 102 + To compile this driver as a module, choose M here: the 103 + module will be called ar1021_i2c. 104 + 93 105 config TOUCHSCREEN_ATMEL_MXT 94 106 tristate "Atmel mXT I2C Touchscreen" 95 107 depends on I2C
+1
drivers/input/touchscreen/Makefile
··· 13 13 obj-$(CONFIG_TOUCHSCREEN_AD7879_I2C) += ad7879-i2c.o 14 14 obj-$(CONFIG_TOUCHSCREEN_AD7879_SPI) += ad7879-spi.o 15 15 obj-$(CONFIG_TOUCHSCREEN_ADS7846) += ads7846.o 16 + obj-$(CONFIG_TOUCHSCREEN_AR1021_I2C) += ar1021_i2c.o 16 17 obj-$(CONFIG_TOUCHSCREEN_ATMEL_MXT) += atmel_mxt_ts.o 17 18 obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o 18 19 obj-$(CONFIG_TOUCHSCREEN_BU21013) += bu21013_ts.o
+181
drivers/input/touchscreen/ar1021_i2c.c
··· 1 + /* 2 + * Microchip AR1021 driver for I2C 3 + * 4 + * Author: Christian Gmeiner <christian.gmeiner@gmail.com> 5 + * 6 + * License: GPLv2 as published by the FSF. 7 + */ 8 + 9 + #include <linux/module.h> 10 + #include <linux/input.h> 11 + #include <linux/of.h> 12 + #include <linux/i2c.h> 13 + #include <linux/irq.h> 14 + #include <linux/interrupt.h> 15 + 16 + #define AR1021_TOCUH_PKG_SIZE 5 17 + 18 + #define AR1021_MAX_X 4095 19 + #define AR1021_MAX_Y 4095 20 + 21 + struct ar1021_i2c { 22 + struct i2c_client *client; 23 + struct input_dev *input; 24 + u8 data[AR1021_TOCUH_PKG_SIZE]; 25 + }; 26 + 27 + static irqreturn_t ar1021_i2c_irq(int irq, void *dev_id) 28 + { 29 + struct ar1021_i2c *ar1021 = dev_id; 30 + struct input_dev *input = ar1021->input; 31 + u8 *data = ar1021->data; 32 + unsigned int x, y, button; 33 + int retval; 34 + 35 + retval = i2c_master_recv(ar1021->client, 36 + ar1021->data, sizeof(ar1021->data)); 37 + if (retval != sizeof(ar1021->data)) 38 + goto out; 39 + 40 + /* sync bit set ? */ 41 + if ((data[0] & 0x80) == 0) 42 + goto out; 43 + 44 + button = data[0] & BIT(0); 45 + x = ((data[2] & 0x1f) << 7) | (data[1] & 0x7f); 46 + y = ((data[4] & 0x1f) << 7) | (data[3] & 0x7f); 47 + 48 + input_report_abs(input, ABS_X, x); 49 + input_report_abs(input, ABS_Y, y); 50 + input_report_key(input, BTN_TOUCH, button); 51 + input_sync(input); 52 + 53 + out: 54 + return IRQ_HANDLED; 55 + } 56 + 57 + static int ar1021_i2c_open(struct input_dev *dev) 58 + { 59 + struct ar1021_i2c *ar1021 = input_get_drvdata(dev); 60 + struct i2c_client *client = ar1021->client; 61 + 62 + enable_irq(client->irq); 63 + 64 + return 0; 65 + } 66 + 67 + static void ar1021_i2c_close(struct input_dev *dev) 68 + { 69 + struct ar1021_i2c *ar1021 = input_get_drvdata(dev); 70 + struct i2c_client *client = ar1021->client; 71 + 72 + disable_irq(client->irq); 73 + } 74 + 75 + static int ar1021_i2c_probe(struct i2c_client *client, 76 + const struct i2c_device_id *id) 77 + { 78 + struct ar1021_i2c *ar1021; 79 + struct input_dev *input; 80 + int error; 81 + 82 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 83 + dev_err(&client->dev, "i2c_check_functionality error\n"); 84 + return -ENXIO; 85 + } 86 + 87 + ar1021 = devm_kzalloc(&client->dev, sizeof(*ar1021), GFP_KERNEL); 88 + if (!ar1021) 89 + return -ENOMEM; 90 + 91 + input = devm_input_allocate_device(&client->dev); 92 + if (!input) 93 + return -ENOMEM; 94 + 95 + ar1021->client = client; 96 + ar1021->input = input; 97 + 98 + input->name = "ar1021 I2C Touchscreen"; 99 + input->id.bustype = BUS_I2C; 100 + input->dev.parent = &client->dev; 101 + input->open = ar1021_i2c_open; 102 + input->close = ar1021_i2c_close; 103 + 104 + input_set_capability(input, EV_KEY, BTN_TOUCH); 105 + input_set_abs_params(input, ABS_X, 0, AR1021_MAX_X, 0, 0); 106 + input_set_abs_params(input, ABS_Y, 0, AR1021_MAX_Y, 0, 0); 107 + 108 + input_set_drvdata(input, ar1021); 109 + 110 + error = devm_request_threaded_irq(&client->dev, client->irq, 111 + NULL, ar1021_i2c_irq, 112 + IRQF_TRIGGER_RISING | IRQF_ONESHOT, 113 + "ar1021_i2c", ar1021); 114 + if (error) { 115 + dev_err(&client->dev, 116 + "Failed to enable IRQ, error: %d\n", error); 117 + return error; 118 + } 119 + 120 + /* Disable the IRQ, we'll enable it in ar1021_i2c_open() */ 121 + disable_irq(client->irq); 122 + 123 + error = input_register_device(ar1021->input); 124 + if (error) { 125 + dev_err(&client->dev, 126 + "Failed to register input device, error: %d\n", error); 127 + return error; 128 + } 129 + 130 + i2c_set_clientdata(client, ar1021); 131 + return 0; 132 + } 133 + 134 + static int __maybe_unused ar1021_i2c_suspend(struct device *dev) 135 + { 136 + struct i2c_client *client = to_i2c_client(dev); 137 + 138 + disable_irq(client->irq); 139 + 140 + return 0; 141 + } 142 + 143 + static int __maybe_unused ar1021_i2c_resume(struct device *dev) 144 + { 145 + struct i2c_client *client = to_i2c_client(dev); 146 + 147 + enable_irq(client->irq); 148 + 149 + return 0; 150 + } 151 + 152 + static SIMPLE_DEV_PM_OPS(ar1021_i2c_pm, ar1021_i2c_suspend, ar1021_i2c_resume); 153 + 154 + static const struct i2c_device_id ar1021_i2c_id[] = { 155 + { "MICROCHIP_AR1021_I2C", 0 }, 156 + { }, 157 + }; 158 + MODULE_DEVICE_TABLE(i2c, ar1021_i2c_id); 159 + 160 + static struct of_device_id ar1021_i2c_of_match[] = { 161 + { .compatible = "microchip,ar1021-i2c", }, 162 + { } 163 + }; 164 + MODULE_DEVICE_TABLE(of, ar1021_i2c_of_match); 165 + 166 + static struct i2c_driver ar1021_i2c_driver = { 167 + .driver = { 168 + .name = "ar1021_i2c", 169 + .owner = THIS_MODULE, 170 + .pm = &ar1021_i2c_pm, 171 + .of_match_table = ar1021_i2c_of_match, 172 + }, 173 + 174 + .probe = ar1021_i2c_probe, 175 + .id_table = ar1021_i2c_id, 176 + }; 177 + module_i2c_driver(ar1021_i2c_driver); 178 + 179 + MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>"); 180 + MODULE_DESCRIPTION("Microchip AR1021 I2C Driver"); 181 + MODULE_LICENSE("GPL");