aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-core.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-14 12:33:25 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 14:03:26 -0300
commit579d315218e8a3f696e375c5f6917da6488bec8a (patch)
treec72d128308c801311cdf79638cbfbe453824411a /drivers/media/video/em28xx/em28xx-core.c
parentd36bb4e77257ed0df86deca3f69794f037f68c7d (diff)
downloadkernel_samsung_smdk4412-579d315218e8a3f696e375c5f6917da6488bec8a.zip
kernel_samsung_smdk4412-579d315218e8a3f696e375c5f6917da6488bec8a.tar.gz
kernel_samsung_smdk4412-579d315218e8a3f696e375c5f6917da6488bec8a.tar.bz2
V4L/DVB (12244): em28xx: adjust vinmode/vinctl based on the stream input format
Depending on the video input format, vinmode/vinctl needs adjustments. For TV, this is not relevant, since the supported decoders output data at the same format. However, webcam sensors may have different formats, so, this needs to be adjusted based on the device. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-core.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-core.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c
index c7fcce7..5b78e19 100644
--- a/drivers/media/video/em28xx/em28xx-core.c
+++ b/drivers/media/video/em28xx/em28xx-core.c
@@ -648,28 +648,17 @@ int em28xx_capture_start(struct em28xx *dev, int start)
int em28xx_set_outfmt(struct em28xx *dev)
{
int ret;
- int vinmode, vinctl, outfmt;
-
- outfmt = dev->format->reg;
-
- if (dev->board.is_webcam) {
- vinmode = 0x0d;
- vinctl = 0x00;
- } else {
- vinmode = 0x10;
- vinctl = 0x11;
- }
ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT,
- outfmt | 0x20, 0xff);
+ dev->format->reg | 0x20, 0xff);
if (ret < 0)
return ret;
- ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, vinmode);
+ ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, dev->vinmode);
if (ret < 0)
return ret;
- return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, vinctl);
+ return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, dev->vinctl);
}
static int em28xx_accumulator_set(struct em28xx *dev, u8 xmin, u8 xmax,