linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <shuah.kh@samsung.com>
To: m.chehab@samsung.com, ttmesterr@gmail.com,
	dheitmueller@kernellabs.com, cb.xiong@samsung.com,
	yongjun_wei@trendmicro.com.cn
Cc: Shuah Khan <shuah.kh@samsung.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume
Date: Mon, 11 Aug 2014 21:13:55 -0600	[thread overview]
Message-ID: <1407813235-30435-1-git-send-email-shuah.kh@samsung.com> (raw)

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. au0828_dvb_suspend()
calls dvb_frontend_suspend() which in turn invokes tuner ops
sleep followed by fe ops sleep. au0828_dvb_resume() calls
dvb_frontend_resume() which in turn calls fe ops ini follwed
by 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>
---
 drivers/media/usb/au0828/au0828-dvb.c |   37 ++++++++++++++-------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
index 821f86e..50e7c82 100644
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -619,35 +619,30 @@ int au0828_dvb_register(struct au0828_dev *dev)
 
 void au0828_dvb_suspend(struct au0828_dev *dev)
 {
-	struct au0828_dvb *dvb = &dev->dvb;
-
-	if (dvb->frontend && dev->urb_streaming) {
-		pr_info("stopping DVB\n");
+	struct au0828_dvb *dvb;
+	int rc;
 
-		cancel_work_sync(&dev->restart_streaming);
+	if (dev == NULL)
+		return;
 
-		/* Stop transport */
-		mutex_lock(&dvb->lock);
-		stop_urb_transfer(dev);
-		au0828_stop_transport(dev, 1);
-		mutex_unlock(&dvb->lock);
-		dev->need_urb_start = 1;
+	dvb = &dev->dvb;
+	if (dvb->frontend) {
+		rc = dvb_frontend_suspend(dvb->frontend);
+		pr_info("au0828_dvb_suspend(): Suspending DVB fe %d\n", rc);
 	}
 }
 
 void au0828_dvb_resume(struct au0828_dev *dev)
 {
-	struct au0828_dvb *dvb = &dev->dvb;
-
-	if (dvb->frontend && dev->need_urb_start) {
-		pr_info("resuming DVB\n");
+	struct au0828_dvb *dvb;
+	int rc;
 
-		au0828_set_frontend(dvb->frontend);
+	if (dev == NULL)
+		return;
 
-		/* Start transport */
-		mutex_lock(&dvb->lock);
-		au0828_start_transport(dev);
-		start_urb_transfer(dev);
-		mutex_unlock(&dvb->lock);
+	dvb = &dev->dvb;
+	if (dvb->frontend) {
+		rc = dvb_frontend_resume(dvb->frontend);
+		pr_info("au0828_dvb_resume(): Resuming DVB fe %d\n", rc);
 	}
 }
-- 
1.7.10.4


             reply	other threads:[~2014-08-12  3:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12  3:13 Shuah Khan [this message]
2014-08-12 11:36 ` [PATCH] media: fix au0828 dvb suspend/resume to call dvb_frontend_suspend/resume Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407813235-30435-1-git-send-email-shuah.kh@samsung.com \
    --to=shuah.kh@samsung.com \
    --cc=cb.xiong@samsung.com \
    --cc=dheitmueller@kernellabs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=ttmesterr@gmail.com \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).