diff options
author | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-08-09 10:47:10 -0300 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:27 +0900 |
commit | 9824c6f9a3e41b85cb967e8149f98d7d961ca398 (patch) | |
tree | 475abb0508b74f712fa89fd4fbdbb4e6d6aa3c9c /drivers/media/usb | |
parent | eb7584dc042b7a82733d577ad5d9245e2a0fcf5a (diff) | |
download | linux-3.10-9824c6f9a3e41b85cb967e8149f98d7d961ca398.tar.gz linux-3.10-9824c6f9a3e41b85cb967e8149f98d7d961ca398.tar.bz2 linux-3.10-9824c6f9a3e41b85cb967e8149f98d7d961ca398.zip |
[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.
Change-Id: I5766af53a9d684200c1a79d54eea14bc7786bfc3
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/au0828/au0828-core.c | 2 | ||||
-rwxr-xr-x | drivers/media/usb/au0828/au0828-dvb.c | 31 | ||||
-rw-r--r-- | drivers/media/usb/au0828/au0828.h | 2 |
3 files changed, 34 insertions, 1 deletions
diff --git a/drivers/media/usb/au0828/au0828-core.c b/drivers/media/usb/au0828/au0828-core.c index 87340a8af7d..26ec50539dc 100644 --- a/drivers/media/usb/au0828/au0828-core.c +++ b/drivers/media/usb/au0828/au0828-core.c @@ -290,6 +290,7 @@ static int au0828_suspend(struct usb_interface *interface, return 0; au0828_rc_suspend(dev); + au0828_dvb_suspend(dev); /* FIXME: should suspend also ATV/DTV */ @@ -309,6 +310,7 @@ static int au0828_resume(struct usb_interface *interface) au0828_gpio_setup(dev); au0828_rc_resume(dev); + au0828_dvb_resume(dev); /* FIXME: should resume also ATV/DTV */ diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c index d8b5d948027..7b6e71065aa 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); + } +} diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index fd0916e2032..d3223435309 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -316,6 +316,8 @@ void au0828_analog_unregister(struct au0828_dev *dev); /* au0828-dvb.c */ extern int au0828_dvb_register(struct au0828_dev *dev); extern void au0828_dvb_unregister(struct au0828_dev *dev); +void au0828_dvb_suspend(struct au0828_dev *dev); +void au0828_dvb_resume(struct au0828_dev *dev); /* au0828-vbi.c */ extern struct videobuf_queue_ops au0828_vbi_qops; |