summaryrefslogtreecommitdiff
path: root/usr/src/dkms_source_tree
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-03-23 09:15:33 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-03-23 09:15:33 +0100
commit1a9735a4ac7796ed432be79f8b2f213e210fa3a4 (patch)
tree76ed02c112917ed450ca666889f1ffaf902e1b1e /usr/src/dkms_source_tree
parent4b3317e685716652126784e6b97b411757a89231 (diff)
Fix suspend/resume on recent modelsv1.1.4
Diffstat (limited to 'usr/src/dkms_source_tree')
-rw-r--r--usr/src/dkms_source_tree/hid-ntrig.c49
1 files changed, 33 insertions, 16 deletions
diff --git a/usr/src/dkms_source_tree/hid-ntrig.c b/usr/src/dkms_source_tree/hid-ntrig.c
index 7f24715..d9e55d3 100644
--- a/usr/src/dkms_source_tree/hid-ntrig.c
+++ b/usr/src/dkms_source_tree/hid-ntrig.c
@@ -105,6 +105,27 @@ static inline void ntrig_set_mode(struct hid_device *hdev, const int mode)
105 usbhid_submit_report(hdev, report, USB_DIR_IN); 105 usbhid_submit_report(hdev, report, USB_DIR_IN);
106} 106}
107 107
108static void ntrig_set_report(struct hid_device *hdev)
109{
110 struct hid_report *report;
111
112 /* This is needed for devices with more recent firmware versions */
113 report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a];
114 if (report) {
115 /* Let the device settle to ensure the wakeup message gets
116 * through */
117 usbhid_wait_io(hdev);
118 usbhid_submit_report(hdev, report, USB_DIR_IN);
119
120 /*
121 * Sanity check: if the current mode is invalid reset it to
122 * something reasonable.
123 */
124 if (ntrig_get_mode(hdev) >= 4)
125 ntrig_set_mode(hdev, 3);
126 }
127}
128
108static void ntrig_report_version(struct hid_device *hdev) 129static void ntrig_report_version(struct hid_device *hdev)
109{ 130{
110 int ret; 131 int ret;
@@ -433,7 +454,6 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
433 struct ntrig_data *nd; 454 struct ntrig_data *nd;
434 struct hid_input *hidinput; 455 struct hid_input *hidinput;
435 struct input_dev *input; 456 struct input_dev *input;
436 struct hid_report *report;
437 457
438 if (id->driver_data & NTRIG_DUPLICATE_USAGES) 458 if (id->driver_data & NTRIG_DUPLICATE_USAGES)
439 hdev->quirks |= HID_QUIRK_MULTI_INPUT; 459 hdev->quirks |= HID_QUIRK_MULTI_INPUT;
@@ -480,21 +500,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id)
480 } 500 }
481 } 501 }
482 502
483 /* This is needed for devices with more recent firmware versions */ 503 ntrig_set_report(hdev);
484 report = hdev->report_enum[HID_FEATURE_REPORT].report_id_hash[0x0a];
485 if (report) {
486 /* Let the device settle to ensure the wakeup message gets
487 * through */
488 usbhid_wait_io(hdev);
489 usbhid_submit_report(hdev, report, USB_DIR_IN);
490
491 /*
492 * Sanity check: if the current mode is invalid reset it to
493 * something reasonable.
494 */
495 if (ntrig_get_mode(hdev) >= 4)
496 ntrig_set_mode(hdev, 3);
497 }
498 504
499 ntrig_report_version(hdev); 505 ntrig_report_version(hdev);
500 506
@@ -504,6 +510,14 @@ err_free:
504 return ret; 510 return ret;
505} 511}
506 512
513#ifdef CONFIG_PM
514static int ntrig_reset_resume(struct hid_device *hdev)
515{
516 ntrig_set_report(hdev);
517 return 0;
518}
519#endif
520
507static void ntrig_remove(struct hid_device *hdev) 521static void ntrig_remove(struct hid_device *hdev)
508{ 522{
509 hid_hw_stop(hdev); 523 hid_hw_stop(hdev);
@@ -534,6 +548,9 @@ static struct hid_driver ntrig_driver = {
534 .input_mapped = ntrig_input_mapped, 548 .input_mapped = ntrig_input_mapped,
535 .usage_table = ntrig_grabbed_usages, 549 .usage_table = ntrig_grabbed_usages,
536 .event = ntrig_event, 550 .event = ntrig_event,
551#ifdef CONFIG_PM
552 .reset_resume = ntrig_reset_resume,
553#endif
537}; 554};
538 555
539static int __init ntrig_init(void) 556static int __init ntrig_init(void)