提交 cd701c89 编写于 作者: S Shuah Khan 提交者: Mauro Carvalho Chehab

[media] em28xx: implement em28xx_usb_driver suspend, resume, reset_resume hooks

Implement em28xx_usb_driver suspend, resume, and reset_resume hooks.
These hooks will invoke em28xx core em28xx_suspend_extension() and
em28xx_resume_extension() to suspend and resume registered extensions.

Approach:
Add power management support to em28xx usb driver. This driver works in
conjunction with extensions for each of the functions on the USB device
for video/audio/dvb/remote functionality that is present on media USB
devices it supports. During suspend and resume each of these extensions
will have to do their part in suspending the components they control.

Adding suspend and resume hooks to the existing struct em28xx_ops will
enable the extensions the ability to implement suspend and resume hooks
to be called from em28xx driver. The overall approach is as follows:

-- add suspend and resume hooks to em28xx_ops
-- add suspend and resume routines to em28xx-core to invoke suspend
   and resume hooks for all registered extensions.
-- change em28xx dvb, audio, input, and video extensions to implement
   em28xx_ops: suspend and resume hooks. These hooks do what is necessary
   to suspend and resume the devices they control.
Signed-off-by: NShuah Khan <shuah.kh@samsung.com>
Signed-off-by: NMauro Carvalho Chehab <m.chehab@samsung.com>
上级 a61f6811
......@@ -3393,10 +3393,36 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
}
}
static int em28xx_usb_suspend(struct usb_interface *interface,
pm_message_t message)
{
struct em28xx *dev;
dev = usb_get_intfdata(interface);
if (!dev)
return 0;
em28xx_suspend_extension(dev);
return 0;
}
static int em28xx_usb_resume(struct usb_interface *interface)
{
struct em28xx *dev;
dev = usb_get_intfdata(interface);
if (!dev)
return 0;
em28xx_resume_extension(dev);
return 0;
}
static struct usb_driver em28xx_usb_driver = {
.name = "em28xx",
.probe = em28xx_usb_probe,
.disconnect = em28xx_usb_disconnect,
.suspend = em28xx_usb_suspend,
.resume = em28xx_usb_resume,
.reset_resume = em28xx_usb_resume,
.id_table = em28xx_id_table,
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册