diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-17 20:48:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:42 -0400 |
commit | c67ec53f8f4e90ebd482789e2f6d121f41a0bd90 (patch) | |
tree | 7c5c242cb50e8b1bfdeab4157370c7dbfda34bf9 /drivers/media/video/em28xx/em28xx-video.c | |
parent | 82ac4f876505615ba9dc6a73cd9a584bad8fe23f (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-video.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index fb533fda219..4ffd064c402 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -461,7 +461,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, | |||
461 | if (urb_init) { | 461 | if (urb_init) { |
462 | rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, | 462 | rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, |
463 | EM28XX_NUM_BUFS, dev->max_pkt_size, | 463 | EM28XX_NUM_BUFS, dev->max_pkt_size, |
464 | em28xx_isoc_copy, EM28XX_ANALOG_CAPTURE); | 464 | em28xx_isoc_copy); |
465 | if (rc < 0) | 465 | if (rc < 0) |
466 | goto fail; | 466 | goto fail; |
467 | } | 467 | } |
@@ -1534,8 +1534,8 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) | |||
1534 | em28xx_videodbg("open minor=%d type=%s users=%d\n", | 1534 | em28xx_videodbg("open minor=%d type=%s users=%d\n", |
1535 | minor, v4l2_type_names[fh_type], dev->users); | 1535 | minor, v4l2_type_names[fh_type], dev->users); |
1536 | 1536 | ||
1537 | fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); | ||
1538 | 1537 | ||
1538 | fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); | ||
1539 | if (!fh) { | 1539 | if (!fh) { |
1540 | em28xx_errdev("em28xx-video.c: Out of memory?!\n"); | 1540 | em28xx_errdev("em28xx-video.c: Out of memory?!\n"); |
1541 | return -ENOMEM; | 1541 | return -ENOMEM; |
@@ -1552,9 +1552,15 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) | |||
1552 | dev->hscale = 0; | 1552 | dev->hscale = 0; |
1553 | dev->vscale = 0; | 1553 | dev->vscale = 0; |
1554 | 1554 | ||
1555 | em28xx_set_mode(dev, EM28XX_ANALOG_MODE); | ||
1555 | em28xx_set_alternate(dev); | 1556 | em28xx_set_alternate(dev); |
1556 | em28xx_resolution_set(dev); | 1557 | em28xx_resolution_set(dev); |
1557 | 1558 | ||
1559 | /* Needed, since GPIO might have disabled power of | ||
1560 | some i2c device | ||
1561 | */ | ||
1562 | em28xx_config_i2c(dev); | ||
1563 | |||
1558 | } | 1564 | } |
1559 | if (fh->radio) { | 1565 | if (fh->radio) { |
1560 | em28xx_videodbg("video_open: setting radio device\n"); | 1566 | em28xx_videodbg("video_open: setting radio device\n"); |
@@ -1568,6 +1574,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) | |||
1568 | sizeof(struct em28xx_buffer), fh); | 1574 | sizeof(struct em28xx_buffer), fh); |
1569 | 1575 | ||
1570 | mutex_unlock(&dev->lock); | 1576 | mutex_unlock(&dev->lock); |
1577 | |||
1571 | return errCode; | 1578 | return errCode; |
1572 | } | 1579 | } |
1573 | 1580 | ||
@@ -1647,6 +1654,7 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp) | |||
1647 | 1654 | ||
1648 | /* do this before setting alternate! */ | 1655 | /* do this before setting alternate! */ |
1649 | em28xx_uninit_isoc(dev); | 1656 | em28xx_uninit_isoc(dev); |
1657 | em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED); | ||
1650 | 1658 | ||
1651 | /* set alternate 0 */ | 1659 | /* set alternate 0 */ |
1652 | dev->alt = 0; | 1660 | dev->alt = 0; |