diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-05-03 17:25:35 +0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-05-03 17:25:35 +0400 |
commit | d6d53cbc6b10d28646fb6184d1069f336ec76dc4 (patch) | |
tree | 1c844b3ce8bd430becbbb74875898b08d9f89bb5 /drivers/hid/usbhid/hid-core.c | |
parent | 0b5adf92ec793c665b0de63ac146d190a921c391 (diff) | |
parent | 6a740aa4f47b9f29bad5292cf51f008f3edad9b1 (diff) | |
download | linux-d6d53cbc6b10d28646fb6184d1069f336ec76dc4.tar.xz |
Merge branch 'hid-suspend' into picolcd
Diffstat (limited to 'drivers/hid/usbhid/hid-core.c')
-rw-r--r-- | drivers/hid/usbhid/hid-core.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 3e7909b0f129..17eb3ec3fbb8 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -1291,6 +1291,11 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) { set_bit(HID_REPORTED_IDLE, &usbhid->iofl); spin_unlock_irq(&usbhid->lock); + if (hid->driver && hid->driver->suspend) { + status = hid->driver->suspend(hid, message); + if (status < 0) + return status; + } } else { usbhid_mark_busy(usbhid); spin_unlock_irq(&usbhid->lock); @@ -1298,6 +1303,11 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) } } else { + if (hid->driver && hid->driver->suspend) { + status = hid->driver->suspend(hid, message); + if (status < 0) + return status; + } spin_lock_irq(&usbhid->lock); set_bit(HID_REPORTED_IDLE, &usbhid->iofl); spin_unlock_irq(&usbhid->lock); @@ -1352,6 +1362,11 @@ static int hid_resume(struct usb_interface *intf) hid_io_error(hid); usbhid_restart_queues(usbhid); + if (status >= 0 && hid->driver && hid->driver->resume) { + int ret = hid->driver->resume(hid); + if (ret < 0) + status = ret; + } dev_dbg(&intf->dev, "resume status %d\n", status); return 0; } @@ -1360,9 +1375,16 @@ static int hid_reset_resume(struct usb_interface *intf) { struct hid_device *hid = usb_get_intfdata(intf); struct usbhid_device *usbhid = hid->driver_data; + int status; clear_bit(HID_REPORTED_IDLE, &usbhid->iofl); - return hid_post_reset(intf); + status = hid_post_reset(intf); + if (status >= 0 && hid->driver && hid->driver->reset_resume) { + int ret = hid->driver->reset_resume(hid); + if (ret < 0) + status = ret; + } + return status; } #endif /* CONFIG_PM */ |