aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 20:49:20 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:42 -0400
commite3569abc1c51d24f9c64b214f85477e490b156e3 (patch)
tree21f3796a528d99911514fab2d291f5ac96b543fb
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>
-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 2e9ec626b609..7df81575b7f2 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)
201} 201}
202 202
203 203
204
205/* ------------------------------------------------------------------ */
206static int em28xx_dvb_bus_ctrl(struct dvb_frontend *fe, int acquire)
207{
208 struct em28xx *dev = fe->dvb->priv;
209
210 if (acquire)
211 return em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
212 else
213 return em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
214}
215
204/* ------------------------------------------------------------------ */ 216/* ------------------------------------------------------------------ */
205 217
206static struct lgdt330x_config em2880_lgdt3303_dev = { 218static struct lgdt330x_config em2880_lgdt3303_dev = {
@@ -268,6 +280,10 @@ int register_dvb(struct em28xx_dvb *dvb,
268 dev->name, result); 280 dev->name, result);
269 goto fail_adapter; 281 goto fail_adapter;
270 } 282 }
283
284 /* Ensure all frontends negotiate bus access */
285 dvb->frontend->ops.ts_bus_ctrl = em28xx_dvb_bus_ctrl;
286
271 dvb->adapter.priv = dev; 287 dvb->adapter.priv = dev;
272 288
273 /* register frontend */ 289 /* register frontend */
@@ -287,6 +303,7 @@ int register_dvb(struct em28xx_dvb *dvb,
287 dvb->demux.feednum = 256; 303 dvb->demux.feednum = 256;
288 dvb->demux.start_feed = start_feed; 304 dvb->demux.start_feed = start_feed;
289 dvb->demux.stop_feed = stop_feed; 305 dvb->demux.stop_feed = stop_feed;
306
290 result = dvb_dmx_init(&dvb->demux); 307 result = dvb_dmx_init(&dvb->demux);
291 if (result < 0) { 308 if (result < 0) {
292 printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n", 309 printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n",