diff options
author | Matthew Dharm <mdharm-usb@one-eyed-alien.net> | 2005-12-05 08:56:51 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-05 00:51:41 +0300 |
commit | 7931e1c6f8007d5fef8a0bb2dc71bd97315eeae9 (patch) | |
tree | aa4ace5efa3454324b10f0b4036fc87a3e815bcf /drivers/usb/storage/usb.c | |
parent | b9b09422570e5e35a9f590a1ead63e711aefac8c (diff) | |
download | linux-7931e1c6f8007d5fef8a0bb2dc71bd97315eeae9.tar.xz |
[PATCH] USB Storage: make OneTouch PM-aware
The OneTouch subdriver submits its own interrupt URB for notifications
about button presses. Consequently it needs to know about suspend and
resume events, so it can cancel or restart the URB.
This patch (as593) adds a hook to struct us_data, to be used for
notifying subdrivers about Power Management events, and it implements
the hook in the OneTouch driver.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Nick Sillik <n.sillik@temple.edu>
Signed-off-by: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | drivers/usb/storage/usb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 356f471ba83b..ca02ae97be86 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -188,6 +188,8 @@ static int storage_suspend(struct usb_interface *iface, pm_message_t message) down(&us->dev_semaphore); US_DEBUGP("%s\n", __FUNCTION__); + if (us->suspend_resume_hook) + (us->suspend_resume_hook)(us, US_SUSPEND); iface->dev.power.power_state.event = message.event; /* When runtime PM is working, we'll set a flag to indicate @@ -204,6 +206,8 @@ static int storage_resume(struct usb_interface *iface) down(&us->dev_semaphore); US_DEBUGP("%s\n", __FUNCTION__); + if (us->suspend_resume_hook) + (us->suspend_resume_hook)(us, US_RESUME); iface->dev.power.power_state.event = PM_EVENT_ON; up(&us->dev_semaphore); |