summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-08-09 16:22:25 -0300
committerChanho Park <chanho61.park@samsung.com>2014-11-18 12:00:28 +0900
commit6e7b115e561e53d653807a2f497a0fcdbad0f954 (patch)
treeb9608fec94bd811165ee7831c4034aef9a12be8b /drivers
parent02bdb8c8e94ee0724e4cf33ca6d12c6441c26612 (diff)
downloadlinux-3.10-6e7b115e561e53d653807a2f497a0fcdbad0f954.tar.gz
linux-3.10-6e7b115e561e53d653807a2f497a0fcdbad0f954.tar.bz2
linux-3.10-6e7b115e561e53d653807a2f497a0fcdbad0f954.zip
[media] xc5000: fix xc5000 suspend
After xc5000 stops working, it waits for 5 seconds, waiting for a new usage. Only after that it goes to low power mode. If a suspend event happens before that, a work queue will remain active, with causes suspend to crash. Change-Id: I27c8d41754e33c6114d466d076082181241fb7a2 Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/tuners/xc5000.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/media/tuners/xc5000.c b/drivers/media/tuners/xc5000.c
index 233fe7aca5b..07a7acf32eb 100644
--- a/drivers/media/tuners/xc5000.c
+++ b/drivers/media/tuners/xc5000.c
@@ -1229,6 +1229,24 @@ static int xc5000_sleep(struct dvb_frontend *fe)
return 0;
}
+static int xc5000_suspend(struct dvb_frontend *fe)
+{
+ struct xc5000_priv *priv = fe->tuner_priv;
+ int ret;
+
+ dprintk(1, "%s()\n", __func__);
+
+ cancel_delayed_work(&priv->timer_sleep);
+
+ ret = xc5000_tuner_reset(fe);
+ if (ret != 0)
+ printk(KERN_ERR
+ "xc5000: %s() unable to shutdown tuner\n",
+ __func__);
+
+ return 0;
+}
+
static int xc5000_init(struct dvb_frontend *fe)
{
struct xc5000_priv *priv = fe->tuner_priv;
@@ -1293,6 +1311,7 @@ static const struct dvb_tuner_ops xc5000_tuner_ops = {
.release = xc5000_release,
.init = xc5000_init,
.sleep = xc5000_sleep,
+ .suspend = xc5000_suspend,
.set_config = xc5000_set_config,
.set_params = xc5000_set_params,