summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/au0828/au0828-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-09 21:47:13 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-21 15:25:07 -0500
commitb799de75e032c4d27788af9b4df3ab25858f87a8 (patch)
treee7b2a3ec2f3a348a4d19480fa645aabad7f43f84 /drivers/media/usb/au0828/au0828-dvb.c
parentfa500461db5af83fce7b1bd45e4925efadbebd90 (diff)
downloadlinux-b799de75e032c4d27788af9b4df3ab25858f87a8.tar.bz2
[media] au0828: Add suspend code for DVB
The scheduled work should be cancelled during suspend. At resume time, we need to set the frontend again. So, add such logic to the driver. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/au0828/au0828-dvb.c')
-rwxr-xr-x[-rw-r--r--]drivers/media/usb/au0828/au0828-dvb.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
index d8b5d9480279..7b6e71065aa4 100644..100755
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -23,7 +23,6 @@
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/device.h>
-#include <linux/suspend.h>
#include <media/v4l2-common.h>
#include <media/tuner.h>
@@ -618,3 +617,33 @@ int au0828_dvb_register(struct au0828_dev *dev)
return 0;
}
+
+void au0828_dvb_suspend(struct au0828_dev *dev)
+{
+ struct au0828_dvb *dvb = &dev->dvb;
+
+ if (dvb && dev->urb_streaming) {
+ cancel_work_sync(&dev->restart_streaming);
+
+ /* Stop transport */
+ mutex_lock(&dvb->lock);
+ stop_urb_transfer(dev);
+ au0828_stop_transport(dev, 1);
+ mutex_unlock(&dvb->lock);
+ }
+}
+
+void au0828_dvb_resume(struct au0828_dev *dev)
+{
+ struct au0828_dvb *dvb = &dev->dvb;
+
+ if (dvb && dev->urb_streaming) {
+ au0828_set_frontend(dvb->frontend);
+
+ /* Start transport */
+ mutex_lock(&dvb->lock);
+ au0828_start_transport(dev);
+ start_urb_transfer(dev);
+ mutex_unlock(&dvb->lock);
+ }
+}