Skip to content

Commit

Permalink
V4L/DVB (7616): em28xx-dvb: Properly selects digital mode at the righ…
Browse files Browse the repository at this point in the history
…t 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>
  • Loading branch information
Mauro Carvalho Chehab committed Apr 24, 2008
1 parent c67ec53 commit e3569ab
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/media/video/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 */
Expand All @@ -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",
Expand Down

0 comments on commit e3569ab

Please sign in to comment.