[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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b9b0942257
commit
7931e1c6f8
@ -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);
|
||||
|
Reference in New Issue
Block a user