aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorShuah Khan <shuah.kh@samsung.com>2014-02-21 19:50:18 -0500
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-03 04:46:48 -0500
commitcd701c89751d5c63230f47da9a78cdbb39384fdc (patch)
treeafc38e280bb23b1f9d9667115e2b3484fad4ed75 /drivers/media/usb
parenta61f68119af399b2911e9881abd5bd123f886611 (diff)
[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: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index eb39903e0001..1752e7ef6027 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3393,10 +3393,36 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
3393 } 3393 }
3394} 3394}
3395 3395
3396static int em28xx_usb_suspend(struct usb_interface *interface,
3397 pm_message_t message)
3398{
3399 struct em28xx *dev;
3400
3401 dev = usb_get_intfdata(interface);
3402 if (!dev)
3403 return 0;
3404 em28xx_suspend_extension(dev);
3405 return 0;
3406}
3407
3408static int em28xx_usb_resume(struct usb_interface *interface)
3409{
3410 struct em28xx *dev;
3411
3412 dev = usb_get_intfdata(interface);
3413 if (!dev)
3414 return 0;
3415 em28xx_resume_extension(dev);
3416 return 0;
3417}
3418
3396static struct usb_driver em28xx_usb_driver = { 3419static struct usb_driver em28xx_usb_driver = {
3397 .name = "em28xx", 3420 .name = "em28xx",
3398 .probe = em28xx_usb_probe, 3421 .probe = em28xx_usb_probe,
3399 .disconnect = em28xx_usb_disconnect, 3422 .disconnect = em28xx_usb_disconnect,
3423 .suspend = em28xx_usb_suspend,
3424 .resume = em28xx_usb_resume,
3425 .reset_resume = em28xx_usb_resume,
3400 .id_table = em28xx_id_table, 3426 .id_table = em28xx_id_table,
3401}; 3427};
3402 3428