From: Shuah Khan Date: Sat, 22 Feb 2014 00:50:17 +0000 (-0300) Subject: upstream: [media] em28xx-video: implement em28xx_ops: suspend/resume hooks X-Git-Tag: submit/tizen/20141121.110247~1416 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28949fc0404ccb1f1944b0190f79e0f00e70e069;p=platform%2Fkernel%2Flinux-3.10.git upstream: [media] em28xx-video: implement em28xx_ops: suspend/resume hooks Implement em28xx_ops: suspend/resume hooks. em28xx usb driver will invoke em28xx_ops: suspend and resume hooks for all its extensions from its suspend() and resume() interfaces. Signed-off-by: Shuah Khan Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 8894850..2e5ab61 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -1937,6 +1937,32 @@ static int em28xx_v4l2_fini(struct em28xx *dev) return 0; } +static int em28xx_v4l2_suspend(struct em28xx *dev) +{ + if (dev->is_audio_only) + return 0; + + if (!dev->has_video) + return 0; + + em28xx_info("Suspending video extension"); + em28xx_stop_urbs(dev); + return 0; +} + +static int em28xx_v4l2_resume(struct em28xx *dev) +{ + if (dev->is_audio_only) + return 0; + + if (!dev->has_video) + return 0; + + em28xx_info("Resuming video extension"); + /* what do we do here */ + return 0; +} + /* * em28xx_v4l2_close() * stops streaming and deallocates all resources allocated by the v4l2 @@ -2546,6 +2572,8 @@ static struct em28xx_ops v4l2_ops = { .name = "Em28xx v4l2 Extension", .init = em28xx_v4l2_init, .fini = em28xx_v4l2_fini, + .suspend = em28xx_v4l2_suspend, + .resume = em28xx_v4l2_resume, }; static int __init em28xx_video_register(void)