aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-dvb.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 20:48:00 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:09:42 -0400
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)
137 137
138static int start_streaming(struct em28xx_dvb *dvb) 138static int start_streaming(struct em28xx_dvb *dvb)
139{ 139{
140 int rc;
140 struct em28xx *dev = dvb->adapter.priv; 141 struct em28xx *dev = dvb->adapter.priv;
141 142
142 usb_set_interface(dev->udev, 0, 1); 143 usb_set_interface(dev->udev, 0, 1);
143 dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); 144 rc = em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
145 if (rc < 0)
146 return rc;
144 147
145 return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS, 148 return em28xx_init_isoc(dev, EM28XX_DVB_MAX_PACKETS,
146 EM28XX_DVB_NUM_BUFS, EM28XX_DVB_MAX_PACKETSIZE, 149 EM28XX_DVB_NUM_BUFS, EM28XX_DVB_MAX_PACKETSIZE,
147 dvb_isoc_copy, EM28XX_DIGITAL_CAPTURE); 150 dvb_isoc_copy);
148} 151}
149 152
150static int stop_streaming(struct em28xx_dvb *dvb) 153static int stop_streaming(struct em28xx_dvb *dvb)
@@ -152,6 +155,9 @@ static int stop_streaming(struct em28xx_dvb *dvb)
152 struct em28xx *dev = dvb->adapter.priv; 155 struct em28xx *dev = dvb->adapter.priv;
153 156
154 em28xx_uninit_isoc(dev); 157 em28xx_uninit_isoc(dev);
158
159 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
160
155 return 0; 161 return 0;
156} 162}
157 163
@@ -368,13 +374,10 @@ static int dvb_init(struct em28xx *dev)
368 } 374 }
369 dev->dvb = dvb; 375 dev->dvb = dvb;
370 376
377 em28xx_set_mode(dev, EM28XX_DIGITAL_MODE);
371 /* init frontend */ 378 /* init frontend */
372 switch (dev->model) { 379 switch (dev->model) {
373 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950: 380 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_950:
374 /* Enable lgdt330x */
375 dev->mode = EM28XX_DIGITAL_MODE;
376 em28xx_tuner_callback(dev, XC2028_TUNER_RESET, 0);
377
378 dvb->frontend = dvb_attach(lgdt330x_attach, 381 dvb->frontend = dvb_attach(lgdt330x_attach,
379 &em2880_lgdt3303_dev, 382 &em2880_lgdt3303_dev,
380 &dev->i2c_adap); 383 &dev->i2c_adap);
@@ -384,9 +387,6 @@ static int dvb_init(struct em28xx *dev)
384 } 387 }
385 break; 388 break;
386 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900: 389 case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900:
387 /* Enable zl10353 */
388 dev->mode = EM28XX_DIGITAL_MODE;
389 em28xx_tuner_callback(dev, XC2028_TUNER_RESET, 0);
390 dvb->frontend = dvb_attach(zl10353_attach, 390 dvb->frontend = dvb_attach(zl10353_attach,
391 &em28xx_zl10353_with_xc3028, 391 &em28xx_zl10353_with_xc3028,
392 &dev->i2c_adap); 392 &dev->i2c_adap);
@@ -415,10 +415,12 @@ static int dvb_init(struct em28xx *dev)
415 if (result < 0) 415 if (result < 0)
416 goto out_free; 416 goto out_free;
417 417
418 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
418 printk(KERN_INFO "Successfully loaded em28xx-dvb\n"); 419 printk(KERN_INFO "Successfully loaded em28xx-dvb\n");
419 return 0; 420 return 0;
420 421
421out_free: 422out_free:
423 em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED);
422 kfree(dvb); 424 kfree(dvb);
423 dev->dvb = NULL; 425 dev->dvb = NULL;
424 return result; 426 return result;