diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 03:42:39 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-06-20 03:42:39 -0400 |
| commit | 81e97f01371f4e1701feeafe484665112cd9ddc2 (patch) | |
| tree | 9e45a6841066f55230befe132d4fc3d1f146532d | |
| parent | 6d90eb7ba341b3eb035121eff0b69d370cbc251e (diff) | |
| parent | d471b6b22d37bf9928c6d0202bdaaf76583b8b61 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fixes from Jiri Kosina:
- Wacom 2nd-gen Intuos Pro large Y axis handling fix from Jason Gerecke
- fix for hibernation in Intel ISH driver, from Even Xu
- crash fix for hid-steam driver, from Rodrigo Rivas Costa
- new device ID addition to google-hammer driver
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: wacom: Correct logical maximum Y for 2nd-gen Intuos Pro large
HID: intel_ish-hid: ipc: register more pm callbacks to support hibernation
HID: steam: use hid_device.driver_data instead of hid_set_drvdata()
HID: google: Add support for whiskers
| -rw-r--r-- | drivers/hid/hid-google-hammer.c | 2 | ||||
| -rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
| -rw-r--r-- | drivers/hid/hid-steam.c | 10 | ||||
| -rw-r--r-- | drivers/hid/intel-ish-hid/ipc/pci-ish.c | 22 | ||||
| -rw-r--r-- | drivers/hid/wacom_sys.c | 8 |
5 files changed, 23 insertions, 20 deletions
diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c index 7b8e17b03cb8..6bf4da7ad63a 100644 --- a/drivers/hid/hid-google-hammer.c +++ b/drivers/hid/hid-google-hammer.c | |||
| @@ -124,6 +124,8 @@ static const struct hid_device_id hammer_devices[] = { | |||
| 124 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) }, | 124 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) }, |
| 125 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | 125 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| 126 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WAND) }, | 126 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WAND) }, |
| 127 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | ||
| 128 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WHISKERS) }, | ||
| 127 | { } | 129 | { } |
| 128 | }; | 130 | }; |
| 129 | MODULE_DEVICE_TABLE(hid, hammer_devices); | 131 | MODULE_DEVICE_TABLE(hid, hammer_devices); |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index a85634fe033f..c7981ddd8776 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
| @@ -452,6 +452,7 @@ | |||
| 452 | #define USB_DEVICE_ID_GOOGLE_TOUCH_ROSE 0x5028 | 452 | #define USB_DEVICE_ID_GOOGLE_TOUCH_ROSE 0x5028 |
| 453 | #define USB_DEVICE_ID_GOOGLE_STAFF 0x502b | 453 | #define USB_DEVICE_ID_GOOGLE_STAFF 0x502b |
| 454 | #define USB_DEVICE_ID_GOOGLE_WAND 0x502d | 454 | #define USB_DEVICE_ID_GOOGLE_WAND 0x502d |
| 455 | #define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030 | ||
| 455 | 456 | ||
| 456 | #define USB_VENDOR_ID_GOTOP 0x08f2 | 457 | #define USB_VENDOR_ID_GOTOP 0x08f2 |
| 457 | #define USB_DEVICE_ID_SUPER_Q2 0x007f | 458 | #define USB_DEVICE_ID_SUPER_Q2 0x007f |
diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c index cb86cc834201..0422ec2b13d2 100644 --- a/drivers/hid/hid-steam.c +++ b/drivers/hid/hid-steam.c | |||
| @@ -573,7 +573,7 @@ static bool steam_is_valve_interface(struct hid_device *hdev) | |||
| 573 | 573 | ||
| 574 | static int steam_client_ll_parse(struct hid_device *hdev) | 574 | static int steam_client_ll_parse(struct hid_device *hdev) |
| 575 | { | 575 | { |
| 576 | struct steam_device *steam = hid_get_drvdata(hdev); | 576 | struct steam_device *steam = hdev->driver_data; |
| 577 | 577 | ||
| 578 | return hid_parse_report(hdev, steam->hdev->dev_rdesc, | 578 | return hid_parse_report(hdev, steam->hdev->dev_rdesc, |
| 579 | steam->hdev->dev_rsize); | 579 | steam->hdev->dev_rsize); |
| @@ -590,7 +590,7 @@ static void steam_client_ll_stop(struct hid_device *hdev) | |||
| 590 | 590 | ||
| 591 | static int steam_client_ll_open(struct hid_device *hdev) | 591 | static int steam_client_ll_open(struct hid_device *hdev) |
| 592 | { | 592 | { |
| 593 | struct steam_device *steam = hid_get_drvdata(hdev); | 593 | struct steam_device *steam = hdev->driver_data; |
| 594 | int ret; | 594 | int ret; |
| 595 | 595 | ||
| 596 | ret = hid_hw_open(steam->hdev); | 596 | ret = hid_hw_open(steam->hdev); |
| @@ -605,7 +605,7 @@ static int steam_client_ll_open(struct hid_device *hdev) | |||
| 605 | 605 | ||
| 606 | static void steam_client_ll_close(struct hid_device *hdev) | 606 | static void steam_client_ll_close(struct hid_device *hdev) |
| 607 | { | 607 | { |
| 608 | struct steam_device *steam = hid_get_drvdata(hdev); | 608 | struct steam_device *steam = hdev->driver_data; |
| 609 | 609 | ||
| 610 | mutex_lock(&steam->mutex); | 610 | mutex_lock(&steam->mutex); |
| 611 | steam->client_opened = false; | 611 | steam->client_opened = false; |
| @@ -623,7 +623,7 @@ static int steam_client_ll_raw_request(struct hid_device *hdev, | |||
| 623 | size_t count, unsigned char report_type, | 623 | size_t count, unsigned char report_type, |
| 624 | int reqtype) | 624 | int reqtype) |
| 625 | { | 625 | { |
| 626 | struct steam_device *steam = hid_get_drvdata(hdev); | 626 | struct steam_device *steam = hdev->driver_data; |
| 627 | 627 | ||
| 628 | return hid_hw_raw_request(steam->hdev, reportnum, buf, count, | 628 | return hid_hw_raw_request(steam->hdev, reportnum, buf, count, |
| 629 | report_type, reqtype); | 629 | report_type, reqtype); |
| @@ -710,7 +710,7 @@ static int steam_probe(struct hid_device *hdev, | |||
| 710 | ret = PTR_ERR(steam->client_hdev); | 710 | ret = PTR_ERR(steam->client_hdev); |
| 711 | goto client_hdev_fail; | 711 | goto client_hdev_fail; |
| 712 | } | 712 | } |
| 713 | hid_set_drvdata(steam->client_hdev, steam); | 713 | steam->client_hdev->driver_data = steam; |
| 714 | 714 | ||
| 715 | /* | 715 | /* |
| 716 | * With the real steam controller interface, do not connect hidraw. | 716 | * With the real steam controller interface, do not connect hidraw. |
diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c index 582e449be9fe..a2c53ea3b5ed 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c | |||
| @@ -205,8 +205,7 @@ static void ish_remove(struct pci_dev *pdev) | |||
| 205 | kfree(ishtp_dev); | 205 | kfree(ishtp_dev); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | #ifdef CONFIG_PM | 208 | static struct device __maybe_unused *ish_resume_device; |
| 209 | static struct device *ish_resume_device; | ||
| 210 | 209 | ||
| 211 | /* 50ms to get resume response */ | 210 | /* 50ms to get resume response */ |
| 212 | #define WAIT_FOR_RESUME_ACK_MS 50 | 211 | #define WAIT_FOR_RESUME_ACK_MS 50 |
| @@ -220,7 +219,7 @@ static struct device *ish_resume_device; | |||
| 220 | * in that case a simple resume message is enough, others we need | 219 | * in that case a simple resume message is enough, others we need |
| 221 | * a reset sequence. | 220 | * a reset sequence. |
| 222 | */ | 221 | */ |
| 223 | static void ish_resume_handler(struct work_struct *work) | 222 | static void __maybe_unused ish_resume_handler(struct work_struct *work) |
| 224 | { | 223 | { |
| 225 | struct pci_dev *pdev = to_pci_dev(ish_resume_device); | 224 | struct pci_dev *pdev = to_pci_dev(ish_resume_device); |
| 226 | struct ishtp_device *dev = pci_get_drvdata(pdev); | 225 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -262,7 +261,7 @@ static void ish_resume_handler(struct work_struct *work) | |||
| 262 | * | 261 | * |
| 263 | * Return: 0 to the pm core | 262 | * Return: 0 to the pm core |
| 264 | */ | 263 | */ |
| 265 | static int ish_suspend(struct device *device) | 264 | static int __maybe_unused ish_suspend(struct device *device) |
| 266 | { | 265 | { |
| 267 | struct pci_dev *pdev = to_pci_dev(device); | 266 | struct pci_dev *pdev = to_pci_dev(device); |
| 268 | struct ishtp_device *dev = pci_get_drvdata(pdev); | 267 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -288,7 +287,7 @@ static int ish_suspend(struct device *device) | |||
| 288 | return 0; | 287 | return 0; |
| 289 | } | 288 | } |
| 290 | 289 | ||
| 291 | static DECLARE_WORK(resume_work, ish_resume_handler); | 290 | static __maybe_unused DECLARE_WORK(resume_work, ish_resume_handler); |
| 292 | /** | 291 | /** |
| 293 | * ish_resume() - ISH resume callback | 292 | * ish_resume() - ISH resume callback |
| 294 | * @device: device pointer | 293 | * @device: device pointer |
| @@ -297,7 +296,7 @@ static DECLARE_WORK(resume_work, ish_resume_handler); | |||
| 297 | * | 296 | * |
| 298 | * Return: 0 to the pm core | 297 | * Return: 0 to the pm core |
| 299 | */ | 298 | */ |
| 300 | static int ish_resume(struct device *device) | 299 | static int __maybe_unused ish_resume(struct device *device) |
| 301 | { | 300 | { |
| 302 | struct pci_dev *pdev = to_pci_dev(device); | 301 | struct pci_dev *pdev = to_pci_dev(device); |
| 303 | struct ishtp_device *dev = pci_get_drvdata(pdev); | 302 | struct ishtp_device *dev = pci_get_drvdata(pdev); |
| @@ -311,21 +310,14 @@ static int ish_resume(struct device *device) | |||
| 311 | return 0; | 310 | return 0; |
| 312 | } | 311 | } |
| 313 | 312 | ||
| 314 | static const struct dev_pm_ops ish_pm_ops = { | 313 | static SIMPLE_DEV_PM_OPS(ish_pm_ops, ish_suspend, ish_resume); |
| 315 | .suspend = ish_suspend, | ||
| 316 | .resume = ish_resume, | ||
| 317 | }; | ||
| 318 | #define ISHTP_ISH_PM_OPS (&ish_pm_ops) | ||
| 319 | #else | ||
| 320 | #define ISHTP_ISH_PM_OPS NULL | ||
| 321 | #endif /* CONFIG_PM */ | ||
| 322 | 314 | ||
| 323 | static struct pci_driver ish_driver = { | 315 | static struct pci_driver ish_driver = { |
| 324 | .name = KBUILD_MODNAME, | 316 | .name = KBUILD_MODNAME, |
| 325 | .id_table = ish_pci_tbl, | 317 | .id_table = ish_pci_tbl, |
| 326 | .probe = ish_probe, | 318 | .probe = ish_probe, |
| 327 | .remove = ish_remove, | 319 | .remove = ish_remove, |
| 328 | .driver.pm = ISHTP_ISH_PM_OPS, | 320 | .driver.pm = &ish_pm_ops, |
| 329 | }; | 321 | }; |
| 330 | 322 | ||
| 331 | module_pci_driver(ish_driver); | 323 | module_pci_driver(ish_driver); |
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index c101369b51de..d6797535fff9 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
| @@ -395,6 +395,14 @@ static void wacom_usage_mapping(struct hid_device *hdev, | |||
| 395 | } | 395 | } |
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | /* 2nd-generation Intuos Pro Large has incorrect Y maximum */ | ||
| 399 | if (hdev->vendor == USB_VENDOR_ID_WACOM && | ||
| 400 | hdev->product == 0x0358 && | ||
| 401 | WACOM_PEN_FIELD(field) && | ||
| 402 | wacom_equivalent_usage(usage->hid) == HID_GD_Y) { | ||
| 403 | field->logical_maximum = 43200; | ||
| 404 | } | ||
| 405 | |||
| 398 | switch (usage->hid) { | 406 | switch (usage->hid) { |
| 399 | case HID_GD_X: | 407 | case HID_GD_X: |
| 400 | features->x_max = field->logical_maximum; | ||
