summaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 21:48:00 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:09:42 -0300
commitc67ec53f8f4e90ebd482789e2f6d121f41a0bd90 (patch)
tree7c5c242cb50e8b1bfdeab4157370c7dbfda34bf9 /drivers/media/video/em28xx/em28xx-dvb.c
parent82ac4f876505615ba9dc6a73cd9a584bad8fe23f (diff)
V4L/DVB (7615): em28xx: Provide the proper support for switching between analog/digital
Before this patch, HVR900/HVR950 were incorreclty going back to analog. The result is that only digital were working. This patch provides the proper setup for analog/digital and tuner callback. It also properly resets analog into a sane state at open(). Thanks to Steven Toth <stoth@linuxtv.org> and Michael Krufky <mkrufky@linuxtv.org> for helping to set the proper parameters to GPO/GPIO em2883 ports. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-dvb.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 39581d976e01..2e9ec626b609 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -137,14 +137,17 @@ static inline int dvb_isoc_copy(struct em28xx *dev, struct urb *urb)
static int start_streaming(struct em28xx_dvb *dvb)
{
+ int rc;
struct em28xx *dev = dvb->adapter.priv;
usb_set_interface(dev->udev, 0, 1);
- dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1);
+ rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
+ if (rc < 0)
+ return rc;
return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS,
EM28XX_DVB_NUM_BUFS, EM28XX_DVB_MAX_PACKETSIZE,
- dvb_isoc_copy, EM28XX_DIGITAL_CAPTURE);
+ dvb_isoc_copy);
}
static int stop_streaming(struct em28xx_dvb *dvb)
@@ -152,6 +155,9 @@ static int stop_streaming(struct em28xx_dvb *dvb)
struct em28xx *dev = dvb->adapter.priv;
em28xx_uninit_isoc(dev);
+
+ em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
+
return 0;
}
@@ -368,13 +374,10 @@ static int dvb_init(struct em28xx *dev)
}
dev->dvb = dvb;
+ em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
/* init frontend */
switch (dev->model) {
case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950:
- /* Enable lgdt330x */
- dev->mode = EM28XX_DIGITAL_MODE;
- em28xx_tuner_callback(dev, XC2028_TUNER_RESET, 0);
-
dvb->frontend = dvb_attach(lgdt330x_attach,
&em2880_lgdt3303_dev,
&dev->i2c_adap);
@@ -384,9 +387,6 @@ static int dvb_init(struct em28xx *dev)
}
break;
case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
- /* Enable zl10353 */
- dev->mode = EM28XX_DIGITAL_MODE;
- em28xx_tuner_callback(dev, XC2028_TUNER_RESET, 0);
dvb->frontend = dvb_attach(zl10353_attach,
&em28xx_zl10353_with_xc3028,
&dev->i2c_adap);
@@ -415,10 +415,12 @@ static int dvb_init(struct em28xx *dev)
if (result < 0)
goto out_free;
+ em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
printk(KERN_INFO "Successfully loaded em28xx-dvb\n");
return 0;
out_free:
+ em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
kfree(dvb);
dev->dvb = NULL;
return result;