aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 21:49:20 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:09:42 -0300
commite3569abc1c51d24f9c64b214f85477e490b156e3 (patch)
tree21f3796a528d99911514fab2d291f5ac96b543fb /drivers/media/video/em28xx
parentc67ec53f8f4e90ebd482789e2f6d121f41a0bd90 (diff)
V4L/DVB (7616): em28xx-dvb: Properly selects digital mode at the right place
The driver should be switched to digital mode, when trying to access the frontend or when streaming. This patch provides the correct code to support this feature. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 2e9ec626b60..7df81575b7f 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -201,6 +201,18 @@ static int stop_feed(struct dvb_demux_feed *feed)
}
+
+/* ------------------------------------------------------------------ */
+static int em28xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire)
+{
+ struct em28xx *dev = fe->dvb->priv;
+
+ if (acquire)
+ return em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
+ else
+ return em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
+}
+
/* ------------------------------------------------------------------ */
static struct lgdt330x_config em2880_lgdt3303_dev = {
@@ -268,6 +280,10 @@ int register_dvb(struct em28xx_dvb *dvb,
dev->name, result);
goto fail_adapter;
}
+
+ /* Ensure all frontends negotiate bus access */
+ dvb->frontend->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl;
+
dvb->adapter.priv = dev;
/* register frontend */
@@ -287,6 +303,7 @@ int register_dvb(struct em28xx_dvb *dvb,
dvb->demux.feednum = 256;
dvb->demux.start_feed = start_feed;
dvb->demux.stop_feed = stop_feed;
+
result = dvb_dmx_init(&dvb->demux);
if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n",