You should look at Patrick Mochel's stuff that shall be getting in the official tree this month hopefully. It does that (among others)
OK, thanks for the update. It was puzzling to see this stuff in such a state ... I've got a few patches for USB PM that are worth putting back in advance of that, but it seems like real testing will need to wait until "next month". (Tomorrow!)
The USB "device" drivers shall just rely on the Device Model
infrastructure to have their suspend/resume callbacks be called at the
appropriate time.
Yes, that's no problem. It looks like:
static int my_suspend(struct device *_intf, u32 state, u32 level) { struct usb_interface *intf; int retval = 0;
intf = to_usb_interface(_intf); switch (level) { ... cases are yet to stabilize ... } return retval; }
... similar for resume()
static struct usb_driver my_driver { .owner = THIS_MODULE, .name = "MyFirstDriver", .probe = my_probe, .disconnect = my_disconnect, .id_table = my_id_table, .driver = { .suspend = my_suspend, .resume = my_resume, }, };
But until the suspend()/resume() callback API stabilizes, it's mostly useful to know that it'll be exactly that simple, and that usbcore doesn't get in the way.
I suspect that USB should do some non-global PM stuff too. Hub ports can be suspended when the devices connected to them are idle for long enough ... that's not something I'd expect system-wide PM policies to address.
- Dave
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel