diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-17 18:48:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-17 18:48:00 -0300 |
commit | 5253757b29d1cd54ddd9d2f874794c907430acc8 (patch) | |
tree | ddfdf79aec8343055eb239e07b3e4a23e03f8437 /linux/drivers/media/video/em28xx/em28xx-video.c | |
parent | acc7837ba9c6b89823348b699aae4e995cdb45fc (diff) | |
download | mediapointer-dvb-s2-5253757b29d1cd54ddd9d2f874794c907430acc8.tar.gz mediapointer-dvb-s2-5253757b29d1cd54ddd9d2f874794c907430acc8.tar.bz2 |
em28xx: Provide the proper support for switching between analog/digital
From: Mauro Carvalho Chehab <mchehab@infradead.org>
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 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 6f484ffb0..e0609ba63 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -485,7 +485,7 @@ buffer_prepare(struct videobuf_queue *vq, struct videobuf_buffer *vb, if (urb_init) { rc = em28xx_init_isoc(dev, EM28XX_NUM_PACKETS, EM28XX_NUM_BUFS, dev->max_pkt_size, - em28xx_isoc_copy, EM28XX_ANALOG_CAPTURE); + em28xx_isoc_copy); if (rc < 0) goto fail; } @@ -1597,8 +1597,15 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) em28xx_videodbg("open minor=%d type=%s users=%d\n", minor, v4l2_type_names[fh_type], dev->users); - fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); +#if 0 + errCode = em28xx_set_mode(dev, EM28XX_ANALOG_MODE); + if (errCode < 0) { + em28xx_errdev("Device locked on digital mode. Can't open analog\n"); + return -EBUSY; + } +#endif + fh = kzalloc(sizeof(struct em28xx_fh), GFP_KERNEL); if (!fh) { em28xx_errdev("em28xx-video.c: Out of memory?!\n"); return -ENOMEM; @@ -1615,9 +1622,15 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) dev->hscale = 0; dev->vscale = 0; + em28xx_set_mode(dev, EM28XX_ANALOG_MODE); em28xx_set_alternate(dev); em28xx_resolution_set(dev); + /* Needed, since GPIO might have disabled power of + some i2c device + */ + em28xx_config_i2c(dev); + #if 0 /* device needs to be initialized before isoc transfer */ video_mux(dev, 0); @@ -1638,6 +1651,7 @@ static int em28xx_v4l2_open(struct inode *inode, struct file *filp) sizeof(struct em28xx_buffer), fh); mutex_unlock(&dev->lock); + return errCode; } @@ -1717,6 +1731,7 @@ static int em28xx_v4l2_close(struct inode *inode, struct file *filp) /* do this before setting alternate! */ em28xx_uninit_isoc(dev); + em28xx_set_mode(dev, EM28XX_MODE_UNDEFINED); /* set alternate 0 */ dev->alt = 0; |