Skip to content

Commit 81e97f0

Browse files
committed
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
2 parents 6d90eb7 + d471b6b commit 81e97f0

File tree

5 files changed

+23
-20
lines changed

5 files changed

+23
-20
lines changed

drivers/hid/hid-google-hammer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ static const struct hid_device_id hammer_devices[] = {
124124
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) },
125125
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
126126
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) },
127129
{ }
128130
};
129131
MODULE_DEVICE_TABLE(hid, hammer_devices);

drivers/hid/hid-ids.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,7 @@
452452
#define USB_DEVICE_ID_GOOGLE_TOUCH_ROSE 0x5028
453453
#define USB_DEVICE_ID_GOOGLE_STAFF 0x502b
454454
#define USB_DEVICE_ID_GOOGLE_WAND 0x502d
455+
#define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030
455456

456457
#define USB_VENDOR_ID_GOTOP 0x08f2
457458
#define USB_DEVICE_ID_SUPER_Q2 0x007f

drivers/hid/hid-steam.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static bool steam_is_valve_interface(struct hid_device *hdev)
573573

574574
static int steam_client_ll_parse(struct hid_device *hdev)
575575
{
576-
struct steam_device *steam = hid_get_drvdata(hdev);
576+
struct steam_device *steam = hdev->driver_data;
577577

578578
return hid_parse_report(hdev, steam->hdev->dev_rdesc,
579579
steam->hdev->dev_rsize);
@@ -590,7 +590,7 @@ static void steam_client_ll_stop(struct hid_device *hdev)
590590

591591
static int steam_client_ll_open(struct hid_device *hdev)
592592
{
593-
struct steam_device *steam = hid_get_drvdata(hdev);
593+
struct steam_device *steam = hdev->driver_data;
594594
int ret;
595595

596596
ret = hid_hw_open(steam->hdev);
@@ -605,7 +605,7 @@ static int steam_client_ll_open(struct hid_device *hdev)
605605

606606
static void steam_client_ll_close(struct hid_device *hdev)
607607
{
608-
struct steam_device *steam = hid_get_drvdata(hdev);
608+
struct steam_device *steam = hdev->driver_data;
609609

610610
mutex_lock(&steam->mutex);
611611
steam->client_opened = false;
@@ -623,7 +623,7 @@ static int steam_client_ll_raw_request(struct hid_device *hdev,
623623
size_t count, unsigned char report_type,
624624
int reqtype)
625625
{
626-
struct steam_device *steam = hid_get_drvdata(hdev);
626+
struct steam_device *steam = hdev->driver_data;
627627

628628
return hid_hw_raw_request(steam->hdev, reportnum, buf, count,
629629
report_type, reqtype);
@@ -710,7 +710,7 @@ static int steam_probe(struct hid_device *hdev,
710710
ret = PTR_ERR(steam->client_hdev);
711711
goto client_hdev_fail;
712712
}
713-
hid_set_drvdata(steam->client_hdev, steam);
713+
steam->client_hdev->driver_data = steam;
714714

715715
/*
716716
* With the real steam controller interface, do not connect hidraw.

drivers/hid/intel-ish-hid/ipc/pci-ish.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ static void ish_remove(struct pci_dev *pdev)
205205
kfree(ishtp_dev);
206206
}
207207

208-
#ifdef CONFIG_PM
209-
static struct device *ish_resume_device;
208+
static struct device __maybe_unused *ish_resume_device;
210209

211210
/* 50ms to get resume response */
212211
#define WAIT_FOR_RESUME_ACK_MS 50
@@ -220,7 +219,7 @@ static struct device *ish_resume_device;
220219
* in that case a simple resume message is enough, others we need
221220
* a reset sequence.
222221
*/
223-
static void ish_resume_handler(struct work_struct *work)
222+
static void __maybe_unused ish_resume_handler(struct work_struct *work)
224223
{
225224
struct pci_dev *pdev = to_pci_dev(ish_resume_device);
226225
struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -262,7 +261,7 @@ static void ish_resume_handler(struct work_struct *work)
262261
*
263262
* Return: 0 to the pm core
264263
*/
265-
static int ish_suspend(struct device *device)
264+
static int __maybe_unused ish_suspend(struct device *device)
266265
{
267266
struct pci_dev *pdev = to_pci_dev(device);
268267
struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -288,7 +287,7 @@ static int ish_suspend(struct device *device)
288287
return 0;
289288
}
290289

291-
static DECLARE_WORK(resume_work, ish_resume_handler);
290+
static __maybe_unused DECLARE_WORK(resume_work, ish_resume_handler);
292291
/**
293292
* ish_resume() - ISH resume callback
294293
* @device: device pointer
@@ -297,7 +296,7 @@ static DECLARE_WORK(resume_work, ish_resume_handler);
297296
*
298297
* Return: 0 to the pm core
299298
*/
300-
static int ish_resume(struct device *device)
299+
static int __maybe_unused ish_resume(struct device *device)
301300
{
302301
struct pci_dev *pdev = to_pci_dev(device);
303302
struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -311,21 +310,14 @@ static int ish_resume(struct device *device)
311310
return 0;
312311
}
313312

314-
static const struct dev_pm_ops ish_pm_ops = {
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 */
313+
static SIMPLE_DEV_PM_OPS(ish_pm_ops, ish_suspend, ish_resume);
322314

323315
static struct pci_driver ish_driver = {
324316
.name = KBUILD_MODNAME,
325317
.id_table = ish_pci_tbl,
326318
.probe = ish_probe,
327319
.remove = ish_remove,
328-
.driver.pm = ISHTP_ISH_PM_OPS,
320+
.driver.pm = &ish_pm_ops,
329321
};
330322

331323
module_pci_driver(ish_driver);

drivers/hid/wacom_sys.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ static void wacom_usage_mapping(struct hid_device *hdev,
395395
}
396396
}
397397

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+
398406
switch (usage->hid) {
399407
case HID_GD_X:
400408
features->x_max = field->logical_maximum;

0 commit comments

Comments
 (0)