summaryrefslogtreecommitdiff
path: root/drivers/media/video/em28xx/em28xx-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-17 21:37:31 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 14:09:40 -0300
commitee6e3a865a469c78daa93a1e6cdbaca3a102f9c8 (patch)
tree43de64b3158e8ca9d4d1f580a985478b30d106fe /drivers/media/video/em28xx/em28xx-core.c
parentacaa4b609fbab25e09459cd8e842e292b27f5ecb (diff)
V4L/DVB (7595): Improve generic support for setting gpio values
em28xx based devices with xc3028 may require some specific gpio values. This patch adds a generic handling for such values. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index 97635abb916e..841c7c2c91b3 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -314,14 +314,36 @@ int em28xx_colorlevels_set_default(struct em28xx *dev)
int em28xx_capture_start(struct em28xx *dev, int start)
{
- int ret;
+ int rc;
/* FIXME: which is the best order? */
/* video registers are sampled by VREF */
- if ((ret = em28xx_write_reg_bits(dev, USBSUSP_REG, start ? 0x10 : 0x00,
- 0x10)) < 0)
- return ret;
+ rc = em28xx_write_reg_bits(dev, USBSUSP_REG,
+ start ? 0x10 : 0x00, 0x10);
+ if (rc < 0)
+ return rc;
+
+ if (!start) {
+ /* disable video capture */
+ rc = em28xx_write_regs(dev, VINENABLE_REG, "\x27", 1);
+ if (rc < 0)
+ return rc;
+ }
+
/* enable video capture */
- return em28xx_write_regs(dev, VINENABLE_REG, start ? "\x67" : "\x27", 1);
+ rc = em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1);
+ if (rc < 0)
+ return rc;
+ if (dev->mode == EM28XX_ANALOG_MODE)
+ rc = em28xx_write_regs(dev, VINENABLE_REG,"\x67", 1);
+ else
+ rc = em28xx_write_regs(dev, VINENABLE_REG,"\x37", 1);
+
+ if (rc < 0)
+ return rc;
+
+ msleep (6);
+
+ return rc;
}
int em28xx_outfmt_set_yuv422(struct em28xx *dev)