diff options
| author | Tejun Heo <tj@kernel.org> | 2012-11-06 15:26:23 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2012-11-06 15:26:23 -0500 |
| commit | 5b805f2a7675634fbdf9ac1c9b2256905ab2ea68 (patch) | |
| tree | ee00d1e3d757458d66209b926d274491c6c3f61c /drivers/input | |
| parent | 1db1e31b1ee3ae126ef98f39083b5f213c7b41bf (diff) | |
| parent | 201e72acb2d3821e2de9ce6091e98859c316b29a (diff) | |
Merge branch 'cgroup/for-3.7-fixes' into cgroup/for-3.8
This is to receive device_cgroup fixes so that further device_cgroup
changes can be made in cgroup/for-3.8.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/input')
| -rw-r--r-- | drivers/input/evdev.c | 3 | ||||
| -rw-r--r-- | drivers/input/joydev.c | 3 | ||||
| -rw-r--r-- | drivers/input/keyboard/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/input/keyboard/pxa27x_keypad.c | 3 | ||||
| -rw-r--r-- | drivers/input/misc/xen-kbdfront.c | 5 | ||||
| -rw-r--r-- | drivers/input/mouse/bcm5974.c | 21 | ||||
| -rw-r--r-- | drivers/input/mousedev.c | 3 | ||||
| -rw-r--r-- | drivers/input/tablet/wacom_sys.c | 51 | ||||
| -rw-r--r-- | drivers/input/tablet/wacom_wac.c | 91 | ||||
| -rw-r--r-- | drivers/input/tablet/wacom_wac.h | 5 | ||||
| -rw-r--r-- | drivers/input/touchscreen/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/input/touchscreen/egalax_ts.c | 23 | ||||
| -rw-r--r-- | drivers/input/touchscreen/tsc40.c | 1 |
13 files changed, 196 insertions, 16 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c index 6ae2ac47c9c8..f0f8928b3c8a 100644 --- a/drivers/input/evdev.c +++ b/drivers/input/evdev.c | |||
| @@ -292,7 +292,6 @@ static int evdev_release(struct inode *inode, struct file *file) | |||
| 292 | kfree(client); | 292 | kfree(client); |
| 293 | 293 | ||
| 294 | evdev_close_device(evdev); | 294 | evdev_close_device(evdev); |
| 295 | put_device(&evdev->dev); | ||
| 296 | 295 | ||
| 297 | return 0; | 296 | return 0; |
| 298 | } | 297 | } |
| @@ -331,7 +330,6 @@ static int evdev_open(struct inode *inode, struct file *file) | |||
| 331 | file->private_data = client; | 330 | file->private_data = client; |
| 332 | nonseekable_open(inode, file); | 331 | nonseekable_open(inode, file); |
| 333 | 332 | ||
| 334 | get_device(&evdev->dev); | ||
| 335 | return 0; | 333 | return 0; |
| 336 | 334 | ||
| 337 | err_free_client: | 335 | err_free_client: |
| @@ -1001,6 +999,7 @@ static int evdev_connect(struct input_handler *handler, struct input_dev *dev, | |||
| 1001 | goto err_free_evdev; | 999 | goto err_free_evdev; |
| 1002 | 1000 | ||
| 1003 | cdev_init(&evdev->cdev, &evdev_fops); | 1001 | cdev_init(&evdev->cdev, &evdev_fops); |
| 1002 | evdev->cdev.kobj.parent = &evdev->dev.kobj; | ||
| 1004 | error = cdev_add(&evdev->cdev, evdev->dev.devt, 1); | 1003 | error = cdev_add(&evdev->cdev, evdev->dev.devt, 1); |
| 1005 | if (error) | 1004 | if (error) |
| 1006 | goto err_unregister_handle; | 1005 | goto err_unregister_handle; |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index b62b5891f399..f362883c94e3 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -243,7 +243,6 @@ static int joydev_release(struct inode *inode, struct file *file) | |||
| 243 | kfree(client); | 243 | kfree(client); |
| 244 | 244 | ||
| 245 | joydev_close_device(joydev); | 245 | joydev_close_device(joydev); |
| 246 | put_device(&joydev->dev); | ||
| 247 | 246 | ||
| 248 | return 0; | 247 | return 0; |
| 249 | } | 248 | } |
| @@ -270,7 +269,6 @@ static int joydev_open(struct inode *inode, struct file *file) | |||
| 270 | file->private_data = client; | 269 | file->private_data = client; |
| 271 | nonseekable_open(inode, file); | 270 | nonseekable_open(inode, file); |
| 272 | 271 | ||
| 273 | get_device(&joydev->dev); | ||
| 274 | return 0; | 272 | return 0; |
| 275 | 273 | ||
| 276 | err_free_client: | 274 | err_free_client: |
| @@ -858,6 +856,7 @@ static int joydev_connect(struct input_handler *handler, struct input_dev *dev, | |||
| 858 | goto err_free_joydev; | 856 | goto err_free_joydev; |
| 859 | 857 | ||
| 860 | cdev_init(&joydev->cdev, &joydev_fops); | 858 | cdev_init(&joydev->cdev, &joydev_fops); |
| 859 | joydev->cdev.kobj.parent = &joydev->dev.kobj; | ||
| 861 | error = cdev_add(&joydev->cdev, joydev->dev.devt, 1); | 860 | error = cdev_add(&joydev->cdev, joydev->dev.devt, 1); |
| 862 | if (error) | 861 | if (error) |
| 863 | goto err_unregister_handle; | 862 | goto err_unregister_handle; |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index b4b65af8612a..de0874054e9f 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -335,6 +335,7 @@ config KEYBOARD_LOCOMO | |||
| 335 | config KEYBOARD_LPC32XX | 335 | config KEYBOARD_LPC32XX |
| 336 | tristate "LPC32XX matrix key scanner support" | 336 | tristate "LPC32XX matrix key scanner support" |
| 337 | depends on ARCH_LPC32XX && OF | 337 | depends on ARCH_LPC32XX && OF |
| 338 | select INPUT_MATRIXKMAP | ||
| 338 | help | 339 | help |
| 339 | Say Y here if you want to use NXP LPC32XX SoC key scanner interface, | 340 | Say Y here if you want to use NXP LPC32XX SoC key scanner interface, |
| 340 | connected to a key matrix. | 341 | connected to a key matrix. |
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 803ff6fe021e..cad9d5dd5973 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
| @@ -368,6 +368,9 @@ static void pxa27x_keypad_config(struct pxa27x_keypad *keypad) | |||
| 368 | unsigned int mask = 0, direct_key_num = 0; | 368 | unsigned int mask = 0, direct_key_num = 0; |
| 369 | unsigned long kpc = 0; | 369 | unsigned long kpc = 0; |
| 370 | 370 | ||
| 371 | /* clear pending interrupt bit */ | ||
| 372 | keypad_readl(KPC); | ||
| 373 | |||
| 371 | /* enable matrix keys with automatic scan */ | 374 | /* enable matrix keys with automatic scan */ |
| 372 | if (pdata->matrix_key_rows && pdata->matrix_key_cols) { | 375 | if (pdata->matrix_key_rows && pdata->matrix_key_cols) { |
| 373 | kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL; | 376 | kpc |= KPC_ASACT | KPC_MIE | KPC_ME | KPC_MS_ALL; |
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 02ca8680ea5b..6f7d99013031 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c | |||
| @@ -311,7 +311,6 @@ static void xenkbd_backend_changed(struct xenbus_device *dev, | |||
| 311 | case XenbusStateReconfiguring: | 311 | case XenbusStateReconfiguring: |
| 312 | case XenbusStateReconfigured: | 312 | case XenbusStateReconfigured: |
| 313 | case XenbusStateUnknown: | 313 | case XenbusStateUnknown: |
| 314 | case XenbusStateClosed: | ||
| 315 | break; | 314 | break; |
| 316 | 315 | ||
| 317 | case XenbusStateInitWait: | 316 | case XenbusStateInitWait: |
| @@ -350,6 +349,10 @@ InitWait: | |||
| 350 | 349 | ||
| 351 | break; | 350 | break; |
| 352 | 351 | ||
| 352 | case XenbusStateClosed: | ||
| 353 | if (dev->state == XenbusStateClosed) | ||
| 354 | break; | ||
| 355 | /* Missed the backend's CLOSING state -- fallthrough */ | ||
| 353 | case XenbusStateClosing: | 356 | case XenbusStateClosing: |
| 354 | xenbus_frontend_closed(dev); | 357 | xenbus_frontend_closed(dev); |
| 355 | break; | 358 | break; |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index 3a78f235fa3e..2baff1b79a55 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
| @@ -84,6 +84,10 @@ | |||
| 84 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 | 84 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI 0x0262 |
| 85 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 | 85 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_ISO 0x0263 |
| 86 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 | 86 | #define USB_DEVICE_ID_APPLE_WELLSPRING7_JIS 0x0264 |
| 87 | /* MacbookPro10,2 (unibody, October 2012) */ | ||
| 88 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI 0x0259 | ||
| 89 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO 0x025a | ||
| 90 | #define USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS 0x025b | ||
| 87 | 91 | ||
| 88 | #define BCM5974_DEVICE(prod) { \ | 92 | #define BCM5974_DEVICE(prod) { \ |
| 89 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ | 93 | .match_flags = (USB_DEVICE_ID_MATCH_DEVICE | \ |
| @@ -137,6 +141,10 @@ static const struct usb_device_id bcm5974_table[] = { | |||
| 137 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), | 141 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ANSI), |
| 138 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), | 142 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_ISO), |
| 139 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), | 143 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7_JIS), |
| 144 | /* MacbookPro10,2 */ | ||
| 145 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI), | ||
| 146 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO), | ||
| 147 | BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS), | ||
| 140 | /* Terminating entry */ | 148 | /* Terminating entry */ |
| 141 | {} | 149 | {} |
| 142 | }; | 150 | }; |
| @@ -379,6 +387,19 @@ static const struct bcm5974_config bcm5974_config_table[] = { | |||
| 379 | { SN_COORD, -150, 6730 }, | 387 | { SN_COORD, -150, 6730 }, |
| 380 | { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } | 388 | { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } |
| 381 | }, | 389 | }, |
| 390 | { | ||
| 391 | USB_DEVICE_ID_APPLE_WELLSPRING7A_ANSI, | ||
| 392 | USB_DEVICE_ID_APPLE_WELLSPRING7A_ISO, | ||
| 393 | USB_DEVICE_ID_APPLE_WELLSPRING7A_JIS, | ||
| 394 | HAS_INTEGRATED_BUTTON, | ||
| 395 | 0x84, sizeof(struct bt_data), | ||
| 396 | 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, | ||
| 397 | { SN_PRESSURE, 0, 300 }, | ||
| 398 | { SN_WIDTH, 0, 2048 }, | ||
| 399 | { SN_COORD, -4750, 5280 }, | ||
| 400 | { SN_COORD, -150, 6730 }, | ||
| 401 | { SN_ORIENT, -MAX_FINGER_ORIENTATION, MAX_FINGER_ORIENTATION } | ||
| 402 | }, | ||
| 382 | {} | 403 | {} |
| 383 | }; | 404 | }; |
| 384 | 405 | ||
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index a1b4c37956b2..8f02e3d0e712 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
| @@ -523,7 +523,6 @@ static int mousedev_release(struct inode *inode, struct file *file) | |||
| 523 | kfree(client); | 523 | kfree(client); |
| 524 | 524 | ||
| 525 | mousedev_close_device(mousedev); | 525 | mousedev_close_device(mousedev); |
| 526 | put_device(&mousedev->dev); | ||
| 527 | 526 | ||
| 528 | return 0; | 527 | return 0; |
| 529 | } | 528 | } |
| @@ -558,7 +557,6 @@ static int mousedev_open(struct inode *inode, struct file *file) | |||
| 558 | file->private_data = client; | 557 | file->private_data = client; |
| 559 | nonseekable_open(inode, file); | 558 | nonseekable_open(inode, file); |
| 560 | 559 | ||
| 561 | get_device(&mousedev->dev); | ||
| 562 | return 0; | 560 | return 0; |
| 563 | 561 | ||
| 564 | err_free_client: | 562 | err_free_client: |
| @@ -892,6 +890,7 @@ static struct mousedev *mousedev_create(struct input_dev *dev, | |||
| 892 | } | 890 | } |
| 893 | 891 | ||
| 894 | cdev_init(&mousedev->cdev, &mousedev_fops); | 892 | cdev_init(&mousedev->cdev, &mousedev_fops); |
| 893 | mousedev->cdev.kobj.parent = &mousedev->dev.kobj; | ||
| 895 | error = cdev_add(&mousedev->cdev, mousedev->dev.devt, 1); | 894 | error = cdev_add(&mousedev->cdev, mousedev->dev.devt, 1); |
| 896 | if (error) | 895 | if (error) |
| 897 | goto err_unregister_handle; | 896 | goto err_unregister_handle; |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index 9edf9806cff9..858ad446de91 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
| @@ -391,7 +391,7 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 391 | features->pktlen = WACOM_PKGLEN_TPC2FG; | 391 | features->pktlen = WACOM_PKGLEN_TPC2FG; |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | if (features->type == MTSCREEN) | 394 | if (features->type == MTSCREEN || features->type == WACOM_24HDT) |
| 395 | features->pktlen = WACOM_PKGLEN_MTOUCH; | 395 | features->pktlen = WACOM_PKGLEN_MTOUCH; |
| 396 | 396 | ||
| 397 | if (features->type == BAMBOO_PT) { | 397 | if (features->type == BAMBOO_PT) { |
| @@ -402,6 +402,14 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 402 | features->x_max = | 402 | features->x_max = |
| 403 | get_unaligned_le16(&report[i + 8]); | 403 | get_unaligned_le16(&report[i + 8]); |
| 404 | i += 15; | 404 | i += 15; |
| 405 | } else if (features->type == WACOM_24HDT) { | ||
| 406 | features->x_max = | ||
| 407 | get_unaligned_le16(&report[i + 3]); | ||
| 408 | features->x_phy = | ||
| 409 | get_unaligned_le16(&report[i + 8]); | ||
| 410 | features->unit = report[i - 1]; | ||
| 411 | features->unitExpo = report[i - 3]; | ||
| 412 | i += 12; | ||
| 405 | } else { | 413 | } else { |
| 406 | features->x_max = | 414 | features->x_max = |
| 407 | get_unaligned_le16(&report[i + 3]); | 415 | get_unaligned_le16(&report[i + 3]); |
| @@ -434,6 +442,12 @@ static int wacom_parse_hid(struct usb_interface *intf, | |||
| 434 | features->y_phy = | 442 | features->y_phy = |
| 435 | get_unaligned_le16(&report[i + 6]); | 443 | get_unaligned_le16(&report[i + 6]); |
| 436 | i += 7; | 444 | i += 7; |
| 445 | } else if (type == WACOM_24HDT) { | ||
| 446 | features->y_max = | ||
| 447 | get_unaligned_le16(&report[i + 3]); | ||
| 448 | features->y_phy = | ||
| 449 | get_unaligned_le16(&report[i - 2]); | ||
| 450 | i += 7; | ||
| 437 | } else if (type == BAMBOO_PT) { | 451 | } else if (type == BAMBOO_PT) { |
| 438 | features->y_phy = | 452 | features->y_phy = |
| 439 | get_unaligned_le16(&report[i + 3]); | 453 | get_unaligned_le16(&report[i + 3]); |
| @@ -541,6 +555,9 @@ static int wacom_query_tablet_data(struct usb_interface *intf, struct wacom_feat | |||
| 541 | /* MT Tablet PC touch */ | 555 | /* MT Tablet PC touch */ |
| 542 | return wacom_set_device_mode(intf, 3, 4, 4); | 556 | return wacom_set_device_mode(intf, 3, 4, 4); |
| 543 | } | 557 | } |
| 558 | else if (features->type == WACOM_24HDT) { | ||
| 559 | return wacom_set_device_mode(intf, 18, 3, 2); | ||
| 560 | } | ||
| 544 | } else if (features->device_type == BTN_TOOL_PEN) { | 561 | } else if (features->device_type == BTN_TOOL_PEN) { |
| 545 | if (features->type <= BAMBOO_PT && features->type != WIRELESS) { | 562 | if (features->type <= BAMBOO_PT && features->type != WIRELESS) { |
| 546 | return wacom_set_device_mode(intf, 2, 2, 2); | 563 | return wacom_set_device_mode(intf, 2, 2, 2); |
| @@ -613,6 +630,30 @@ struct wacom_usbdev_data { | |||
| 613 | static LIST_HEAD(wacom_udev_list); | 630 | static LIST_HEAD(wacom_udev_list); |
| 614 | static DEFINE_MUTEX(wacom_udev_list_lock); | 631 | static DEFINE_MUTEX(wacom_udev_list_lock); |
| 615 | 632 | ||
| 633 | static struct usb_device *wacom_get_sibling(struct usb_device *dev, int vendor, int product) | ||
| 634 | { | ||
| 635 | int port1; | ||
| 636 | struct usb_device *sibling; | ||
| 637 | |||
| 638 | if (vendor == 0 && product == 0) | ||
| 639 | return dev; | ||
| 640 | |||
| 641 | if (dev->parent == NULL) | ||
| 642 | return NULL; | ||
| 643 | |||
| 644 | usb_hub_for_each_child(dev->parent, port1, sibling) { | ||
| 645 | struct usb_device_descriptor *d; | ||
| 646 | if (sibling == NULL) | ||
| 647 | continue; | ||
| 648 | |||
| 649 | d = &sibling->descriptor; | ||
| 650 | if (d->idVendor == vendor && d->idProduct == product) | ||
| 651 | return sibling; | ||
| 652 | } | ||
| 653 | |||
| 654 | return NULL; | ||
| 655 | } | ||
| 656 | |||
| 616 | static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev) | 657 | static struct wacom_usbdev_data *wacom_get_usbdev_data(struct usb_device *dev) |
| 617 | { | 658 | { |
| 618 | struct wacom_usbdev_data *data; | 659 | struct wacom_usbdev_data *data; |
| @@ -1257,13 +1298,19 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
| 1257 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); | 1298 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); |
| 1258 | 1299 | ||
| 1259 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { | 1300 | if (features->quirks & WACOM_QUIRK_MULTI_INPUT) { |
| 1301 | struct usb_device *other_dev; | ||
| 1302 | |||
| 1260 | /* Append the device type to the name */ | 1303 | /* Append the device type to the name */ |
| 1261 | strlcat(wacom_wac->name, | 1304 | strlcat(wacom_wac->name, |
| 1262 | features->device_type == BTN_TOOL_PEN ? | 1305 | features->device_type == BTN_TOOL_PEN ? |
| 1263 | " Pen" : " Finger", | 1306 | " Pen" : " Finger", |
| 1264 | sizeof(wacom_wac->name)); | 1307 | sizeof(wacom_wac->name)); |
| 1265 | 1308 | ||
| 1266 | error = wacom_add_shared_data(wacom_wac, dev); | 1309 | |
| 1310 | other_dev = wacom_get_sibling(dev, features->oVid, features->oPid); | ||
| 1311 | if (other_dev == NULL || wacom_get_usbdev_data(other_dev) == NULL) | ||
| 1312 | other_dev = dev; | ||
| 1313 | error = wacom_add_shared_data(wacom_wac, other_dev); | ||
| 1267 | if (error) | 1314 | if (error) |
| 1268 | goto fail3; | 1315 | goto fail3; |
| 1269 | } | 1316 | } |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index c3468c8dbd89..0a67031ffc13 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -806,6 +806,70 @@ static int find_slot_from_contactid(struct wacom_wac *wacom, int contactid) | |||
| 806 | return -1; | 806 | return -1; |
| 807 | } | 807 | } |
| 808 | 808 | ||
| 809 | static int int_dist(int x1, int y1, int x2, int y2) | ||
| 810 | { | ||
| 811 | int x = x2 - x1; | ||
| 812 | int y = y2 - y1; | ||
| 813 | |||
| 814 | return int_sqrt(x*x + y*y); | ||
| 815 | } | ||
| 816 | |||
| 817 | static int wacom_24hdt_irq(struct wacom_wac *wacom) | ||
| 818 | { | ||
| 819 | struct input_dev *input = wacom->input; | ||
| 820 | char *data = wacom->data; | ||
| 821 | int i; | ||
| 822 | int current_num_contacts = data[61]; | ||
| 823 | int contacts_to_send = 0; | ||
| 824 | |||
| 825 | /* | ||
| 826 | * First packet resets the counter since only the first | ||
| 827 | * packet in series will have non-zero current_num_contacts. | ||
| 828 | */ | ||
| 829 | if (current_num_contacts) | ||
| 830 | wacom->num_contacts_left = current_num_contacts; | ||
| 831 | |||
| 832 | /* There are at most 4 contacts per packet */ | ||
| 833 | contacts_to_send = min(4, wacom->num_contacts_left); | ||
| 834 | |||
| 835 | for (i = 0; i < contacts_to_send; i++) { | ||
| 836 | int offset = (WACOM_BYTES_PER_24HDT_PACKET * i) + 1; | ||
| 837 | bool touch = data[offset] & 0x1 && !wacom->shared->stylus_in_proximity; | ||
| 838 | int id = data[offset + 1]; | ||
| 839 | int slot = find_slot_from_contactid(wacom, id); | ||
| 840 | |||
| 841 | if (slot < 0) | ||
| 842 | continue; | ||
| 843 | input_mt_slot(input, slot); | ||
| 844 | input_mt_report_slot_state(input, MT_TOOL_FINGER, touch); | ||
| 845 | |||
| 846 | if (touch) { | ||
| 847 | int t_x = le16_to_cpup((__le16 *)&data[offset + 2]); | ||
| 848 | int c_x = le16_to_cpup((__le16 *)&data[offset + 4]); | ||
| 849 | int t_y = le16_to_cpup((__le16 *)&data[offset + 6]); | ||
| 850 | int c_y = le16_to_cpup((__le16 *)&data[offset + 8]); | ||
| 851 | int w = le16_to_cpup((__le16 *)&data[offset + 10]); | ||
| 852 | int h = le16_to_cpup((__le16 *)&data[offset + 12]); | ||
| 853 | |||
| 854 | input_report_abs(input, ABS_MT_POSITION_X, t_x); | ||
| 855 | input_report_abs(input, ABS_MT_POSITION_Y, t_y); | ||
| 856 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, min(w,h)); | ||
| 857 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, min(w, h) + int_dist(t_x, t_y, c_x, c_y)); | ||
| 858 | input_report_abs(input, ABS_MT_WIDTH_MINOR, min(w, h)); | ||
| 859 | input_report_abs(input, ABS_MT_ORIENTATION, w > h); | ||
| 860 | } | ||
| 861 | wacom->slots[slot] = touch ? id : -1; | ||
| 862 | } | ||
| 863 | |||
| 864 | input_mt_report_pointer_emulation(input, true); | ||
| 865 | |||
| 866 | wacom->num_contacts_left -= contacts_to_send; | ||
| 867 | if (wacom->num_contacts_left <= 0) | ||
| 868 | wacom->num_contacts_left = 0; | ||
| 869 | |||
| 870 | return 1; | ||
| 871 | } | ||
| 872 | |||
| 809 | static int wacom_mt_touch(struct wacom_wac *wacom) | 873 | static int wacom_mt_touch(struct wacom_wac *wacom) |
| 810 | { | 874 | { |
| 811 | struct input_dev *input = wacom->input; | 875 | struct input_dev *input = wacom->input; |
| @@ -1255,6 +1319,10 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) | |||
| 1255 | sync = wacom_intuos_irq(wacom_wac); | 1319 | sync = wacom_intuos_irq(wacom_wac); |
| 1256 | break; | 1320 | break; |
| 1257 | 1321 | ||
| 1322 | case WACOM_24HDT: | ||
| 1323 | sync = wacom_24hdt_irq(wacom_wac); | ||
| 1324 | break; | ||
| 1325 | |||
| 1258 | case INTUOS5S: | 1326 | case INTUOS5S: |
| 1259 | case INTUOS5: | 1327 | case INTUOS5: |
| 1260 | case INTUOS5L: | 1328 | case INTUOS5L: |
| @@ -1340,7 +1408,8 @@ void wacom_setup_device_quirks(struct wacom_features *features) | |||
| 1340 | 1408 | ||
| 1341 | /* these device have multiple inputs */ | 1409 | /* these device have multiple inputs */ |
| 1342 | if (features->type >= WIRELESS || | 1410 | if (features->type >= WIRELESS || |
| 1343 | (features->type >= INTUOS5S && features->type <= INTUOS5L)) | 1411 | (features->type >= INTUOS5S && features->type <= INTUOS5L) || |
| 1412 | (features->oVid && features->oPid)) | ||
| 1344 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; | 1413 | features->quirks |= WACOM_QUIRK_MULTI_INPUT; |
| 1345 | 1414 | ||
| 1346 | /* quirk for bamboo touch with 2 low res touches */ | 1415 | /* quirk for bamboo touch with 2 low res touches */ |
| @@ -1449,6 +1518,9 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1449 | 1518 | ||
| 1450 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 1519 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
| 1451 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); | 1520 | input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0); |
| 1521 | |||
| 1522 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
| 1523 | |||
| 1452 | wacom_setup_cintiq(wacom_wac); | 1524 | wacom_setup_cintiq(wacom_wac); |
| 1453 | break; | 1525 | break; |
| 1454 | 1526 | ||
| @@ -1575,6 +1647,15 @@ int wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
| 1575 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | 1647 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); |
| 1576 | break; | 1648 | break; |
| 1577 | 1649 | ||
| 1650 | case WACOM_24HDT: | ||
| 1651 | if (features->device_type == BTN_TOOL_FINGER) { | ||
| 1652 | input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0); | ||
| 1653 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MAJOR, 0, features->x_max, 0, 0); | ||
| 1654 | input_set_abs_params(input_dev, ABS_MT_WIDTH_MINOR, 0, features->y_max, 0, 0); | ||
| 1655 | input_set_abs_params(input_dev, ABS_MT_ORIENTATION, 0, 1, 0, 0); | ||
| 1656 | } | ||
| 1657 | /* fall through */ | ||
| 1658 | |||
| 1578 | case MTSCREEN: | 1659 | case MTSCREEN: |
| 1579 | if (features->device_type == BTN_TOOL_FINGER) { | 1660 | if (features->device_type == BTN_TOOL_FINGER) { |
| 1580 | wacom_wac->slots = kmalloc(features->touch_max * | 1661 | wacom_wac->slots = kmalloc(features->touch_max * |
| @@ -1869,8 +1950,11 @@ static const struct wacom_features wacom_features_0xF4 = | |||
| 1869 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 1950 | { "Wacom Cintiq 24HD", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, |
| 1870 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1951 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
| 1871 | static const struct wacom_features wacom_features_0xF8 = | 1952 | static const struct wacom_features wacom_features_0xF8 = |
| 1872 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, | 1953 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ |
| 1873 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1954 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; |
| 1955 | static const struct wacom_features wacom_features_0xF6 = | ||
| 1956 | { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ | ||
| 1957 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; | ||
| 1874 | static const struct wacom_features wacom_features_0x3F = | 1958 | static const struct wacom_features wacom_features_0x3F = |
| 1875 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, | 1959 | { "Wacom Cintiq 21UX", WACOM_PKGLEN_INTUOS, 87200, 65600, 1023, |
| 1876 | 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1960 | 63, CINTIQ, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
| @@ -2113,6 +2197,7 @@ const struct usb_device_id wacom_ids[] = { | |||
| 2113 | { USB_DEVICE_WACOM(0x47) }, | 2197 | { USB_DEVICE_WACOM(0x47) }, |
| 2114 | { USB_DEVICE_WACOM(0xF4) }, | 2198 | { USB_DEVICE_WACOM(0xF4) }, |
| 2115 | { USB_DEVICE_WACOM(0xF8) }, | 2199 | { USB_DEVICE_WACOM(0xF8) }, |
| 2200 | { USB_DEVICE_WACOM(0xF6) }, | ||
| 2116 | { USB_DEVICE_WACOM(0xFA) }, | 2201 | { USB_DEVICE_WACOM(0xFA) }, |
| 2117 | { USB_DEVICE_LENOVO(0x6004) }, | 2202 | { USB_DEVICE_LENOVO(0x6004) }, |
| 2118 | { } | 2203 | { } |
diff --git a/drivers/input/tablet/wacom_wac.h b/drivers/input/tablet/wacom_wac.h index 96c185cc301e..345f1e76975e 100644 --- a/drivers/input/tablet/wacom_wac.h +++ b/drivers/input/tablet/wacom_wac.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | 29 | ||
| 30 | /* wacom data size per MT contact */ | 30 | /* wacom data size per MT contact */ |
| 31 | #define WACOM_BYTES_PER_MT_PACKET 11 | 31 | #define WACOM_BYTES_PER_MT_PACKET 11 |
| 32 | #define WACOM_BYTES_PER_24HDT_PACKET 14 | ||
| 32 | 33 | ||
| 33 | /* device IDs */ | 34 | /* device IDs */ |
| 34 | #define STYLUS_DEVICE_ID 0x02 | 35 | #define STYLUS_DEVICE_ID 0x02 |
| @@ -49,6 +50,7 @@ | |||
| 49 | #define WACOM_REPORT_TPCHID 15 | 50 | #define WACOM_REPORT_TPCHID 15 |
| 50 | #define WACOM_REPORT_TPCST 16 | 51 | #define WACOM_REPORT_TPCST 16 |
| 51 | #define WACOM_REPORT_TPC1FGE 18 | 52 | #define WACOM_REPORT_TPC1FGE 18 |
| 53 | #define WACOM_REPORT_24HDT 1 | ||
| 52 | 54 | ||
| 53 | /* device quirks */ | 55 | /* device quirks */ |
| 54 | #define WACOM_QUIRK_MULTI_INPUT 0x0001 | 56 | #define WACOM_QUIRK_MULTI_INPUT 0x0001 |
| @@ -81,6 +83,7 @@ enum { | |||
| 81 | WACOM_MO, | 83 | WACOM_MO, |
| 82 | WIRELESS, | 84 | WIRELESS, |
| 83 | BAMBOO_PT, | 85 | BAMBOO_PT, |
| 86 | WACOM_24HDT, | ||
| 84 | TABLETPC, /* add new TPC below */ | 87 | TABLETPC, /* add new TPC below */ |
| 85 | TABLETPCE, | 88 | TABLETPCE, |
| 86 | TABLETPC2FG, | 89 | TABLETPC2FG, |
| @@ -109,6 +112,8 @@ struct wacom_features { | |||
| 109 | int distance_fuzz; | 112 | int distance_fuzz; |
| 110 | unsigned quirks; | 113 | unsigned quirks; |
| 111 | unsigned touch_max; | 114 | unsigned touch_max; |
| 115 | int oVid; | ||
| 116 | int oPid; | ||
| 112 | }; | 117 | }; |
| 113 | 118 | ||
| 114 | struct wacom_shared { | 119 | struct wacom_shared { |
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index 1ba232cbc09d..f7668b24c378 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig | |||
| @@ -239,7 +239,7 @@ config TOUCHSCREEN_EETI | |||
| 239 | 239 | ||
| 240 | config TOUCHSCREEN_EGALAX | 240 | config TOUCHSCREEN_EGALAX |
| 241 | tristate "EETI eGalax multi-touch panel support" | 241 | tristate "EETI eGalax multi-touch panel support" |
| 242 | depends on I2C | 242 | depends on I2C && OF |
| 243 | help | 243 | help |
| 244 | Say Y here to enable support for I2C connected EETI | 244 | Say Y here to enable support for I2C connected EETI |
| 245 | eGalax multi-touch panels. | 245 | eGalax multi-touch panels. |
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index c1e3460f1195..13fa62fdfb0b 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
| 29 | #include <linux/bitops.h> | 29 | #include <linux/bitops.h> |
| 30 | #include <linux/input/mt.h> | 30 | #include <linux/input/mt.h> |
| 31 | #include <linux/of_gpio.h> | ||
| 31 | 32 | ||
| 32 | /* | 33 | /* |
| 33 | * Mouse Mode: some panel may configure the controller to mouse mode, | 34 | * Mouse Mode: some panel may configure the controller to mouse mode, |
| @@ -122,9 +123,17 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id) | |||
| 122 | /* wake up controller by an falling edge of interrupt gpio. */ | 123 | /* wake up controller by an falling edge of interrupt gpio. */ |
| 123 | static int egalax_wake_up_device(struct i2c_client *client) | 124 | static int egalax_wake_up_device(struct i2c_client *client) |
| 124 | { | 125 | { |
| 125 | int gpio = irq_to_gpio(client->irq); | 126 | struct device_node *np = client->dev.of_node; |
| 127 | int gpio; | ||
| 126 | int ret; | 128 | int ret; |
| 127 | 129 | ||
| 130 | if (!np) | ||
| 131 | return -ENODEV; | ||
| 132 | |||
| 133 | gpio = of_get_named_gpio(np, "wakeup-gpios", 0); | ||
| 134 | if (!gpio_is_valid(gpio)) | ||
| 135 | return -ENODEV; | ||
| 136 | |||
| 128 | ret = gpio_request(gpio, "egalax_irq"); | 137 | ret = gpio_request(gpio, "egalax_irq"); |
| 129 | if (ret < 0) { | 138 | if (ret < 0) { |
| 130 | dev_err(&client->dev, | 139 | dev_err(&client->dev, |
| @@ -181,7 +190,11 @@ static int __devinit egalax_ts_probe(struct i2c_client *client, | |||
| 181 | ts->input_dev = input_dev; | 190 | ts->input_dev = input_dev; |
| 182 | 191 | ||
| 183 | /* controller may be in sleep, wake it up. */ | 192 | /* controller may be in sleep, wake it up. */ |
| 184 | egalax_wake_up_device(client); | 193 | error = egalax_wake_up_device(client); |
| 194 | if (error) { | ||
| 195 | dev_err(&client->dev, "Failed to wake up the controller\n"); | ||
| 196 | goto err_free_dev; | ||
| 197 | } | ||
| 185 | 198 | ||
| 186 | ret = egalax_firmware_version(client); | 199 | ret = egalax_firmware_version(client); |
| 187 | if (ret < 0) { | 200 | if (ret < 0) { |
| @@ -274,11 +287,17 @@ static int egalax_ts_resume(struct device *dev) | |||
| 274 | 287 | ||
| 275 | static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume); | 288 | static SIMPLE_DEV_PM_OPS(egalax_ts_pm_ops, egalax_ts_suspend, egalax_ts_resume); |
| 276 | 289 | ||
| 290 | static struct of_device_id egalax_ts_dt_ids[] = { | ||
| 291 | { .compatible = "eeti,egalax_ts" }, | ||
| 292 | { /* sentinel */ } | ||
| 293 | }; | ||
| 294 | |||
| 277 | static struct i2c_driver egalax_ts_driver = { | 295 | static struct i2c_driver egalax_ts_driver = { |
| 278 | .driver = { | 296 | .driver = { |
| 279 | .name = "egalax_ts", | 297 | .name = "egalax_ts", |
| 280 | .owner = THIS_MODULE, | 298 | .owner = THIS_MODULE, |
| 281 | .pm = &egalax_ts_pm_ops, | 299 | .pm = &egalax_ts_pm_ops, |
| 300 | .of_match_table = of_match_ptr(egalax_ts_dt_ids), | ||
| 282 | }, | 301 | }, |
| 283 | .id_table = egalax_ts_id, | 302 | .id_table = egalax_ts_id, |
| 284 | .probe = egalax_ts_probe, | 303 | .probe = egalax_ts_probe, |
diff --git a/drivers/input/touchscreen/tsc40.c b/drivers/input/touchscreen/tsc40.c index 63209aaa55f0..eb96f168fb9d 100644 --- a/drivers/input/touchscreen/tsc40.c +++ b/drivers/input/touchscreen/tsc40.c | |||
| @@ -107,7 +107,6 @@ static int tsc_connect(struct serio *serio, struct serio_driver *drv) | |||
| 107 | __set_bit(BTN_TOUCH, input_dev->keybit); | 107 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 108 | input_set_abs_params(ptsc->dev, ABS_X, 0, 0x3ff, 0, 0); | 108 | input_set_abs_params(ptsc->dev, ABS_X, 0, 0x3ff, 0, 0); |
| 109 | input_set_abs_params(ptsc->dev, ABS_Y, 0, 0x3ff, 0, 0); | 109 | input_set_abs_params(ptsc->dev, ABS_Y, 0, 0x3ff, 0, 0); |
| 110 | input_set_abs_params(ptsc->dev, ABS_PRESSURE, 0, 0, 0, 0); | ||
| 111 | 110 | ||
| 112 | serio_set_drvdata(serio, ptsc); | 111 | serio_set_drvdata(serio, ptsc); |
| 113 | 112 | ||
