aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShuah Khan <shuah.kh@samsung.com>2014-08-13 14:52:39 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-21 16:25:38 -0400
commit66cae53024c4b73d40b4e78c557a73e082522aed (patch)
treeef5d87e4e74e497357261d65730176ba6bb045f2
parent662c97cf8f9e9d67d45d0a9f0c1565a1ede364c2 (diff)
[media] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume
au0828 doesn't resume correctly and TV tuning fails with xc_set_signal_source(0) failed message. Change au0828 dvb suspend and resume interfaces to suspend and resume frontend during suspend and resume respectively. dvb_frontend_suspend() suspends tuner and fe using tuner and fe ops. dvb_frontend_resume() resumes fe and tuner using fe and tuner ops ini before waking up the frontend. With this change HVR950Q suspend and resume work when system gets suspended when digital function is tuned to a channel and with active TV stream, and after resume it went right back to active TV stream. Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/au0828/au0828-dvb.c47
1 files changed, 26 insertions, 21 deletions
diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
index 821f86e92cde..4bd9d687d2d6 100644
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -620,34 +620,39 @@ int au0828_dvb_register(struct au0828_dev *dev)
620void au0828_dvb_suspend(struct au0828_dev *dev) 620void au0828_dvb_suspend(struct au0828_dev *dev)
621{ 621{
622 struct au0828_dvb *dvb = &dev->dvb; 622 struct au0828_dvb *dvb = &dev->dvb;
623 int rc;
623 624
624 if (dvb->frontend && dev->urb_streaming) { 625 if (dvb->frontend) {
625 pr_info("stopping DVB\n"); 626 if (dev->urb_streaming) {
626 627 cancel_work_sync(&dev->restart_streaming);
627 cancel_work_sync(&dev->restart_streaming); 628 /* Stop transport */
628 629 mutex_lock(&dvb->lock);
629 /* Stop transport */ 630 stop_urb_transfer(dev);
630 mutex_lock(&dvb->lock); 631 au0828_stop_transport(dev, 1);
631 stop_urb_transfer(dev); 632 mutex_unlock(&dvb->lock);
632 au0828_stop_transport(dev, 1); 633 dev->need_urb_start = 1;
633 mutex_unlock(&dvb->lock); 634 }
634 dev->need_urb_start = 1; 635 /* suspend frontend - does tuner and fe to sleep */
636 rc = dvb_frontend_suspend(dvb->frontend);
637 pr_info("au0828_dvb_suspend(): Suspending DVB fe %d\n", rc);
635 } 638 }
636} 639}
637 640
638void au0828_dvb_resume(struct au0828_dev *dev) 641void au0828_dvb_resume(struct au0828_dev *dev)
639{ 642{
640 struct au0828_dvb *dvb = &dev->dvb; 643 struct au0828_dvb *dvb = &dev->dvb;
644 int rc;
641 645
642 if (dvb->frontend && dev->need_urb_start) { 646 if (dvb->frontend) {
643 pr_info("resuming DVB\n"); 647 /* resume frontend - does fe and tuner init */
644 648 rc = dvb_frontend_resume(dvb->frontend);
645 au0828_set_frontend(dvb->frontend); 649 pr_info("au0828_dvb_resume(): Resuming DVB fe %d\n", rc);
646 650 if (dev->need_urb_start) {
647 /* Start transport */ 651 /* Start transport */
648 mutex_lock(&dvb->lock); 652 mutex_lock(&dvb->lock);
649 au0828_start_transport(dev); 653 au0828_start_transport(dev);
650 start_urb_transfer(dev); 654 start_urb_transfer(dev);
651 mutex_unlock(&dvb->lock); 655 mutex_unlock(&dvb->lock);
656 }
652 } 657 }
653} 658}