From 7931e1c6f8007d5fef8a0bb2dc71bd97315eeae9 Mon Sep 17 00:00:00 2001 From: Matthew Dharm Date: Sun, 4 Dec 2005 21:56:51 -0800 Subject: [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 Signed-off-by: Nick Sillik Signed-off-by: Matthew Dharm Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/usb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/usb/storage/usb.c') diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 356f471ba83..ca02ae97be8 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); -- cgit v1.2.3