diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-20 09:06:37 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 09:39:20 -0200 |
commit | bddcf63313c6a4a85f94db092f45e31f530da691 (patch) | |
tree | 10fa9a1bd5395717cf789dd75dfcad920dd1e0fb /drivers/media/video/em28xx/em28xx-core.c | |
parent | 381aaba91de9659ccb8c061d6b7248e606903374 (diff) |
V4L/DVB (9927): em28xx: use a more standard way to specify video formats
This patch uses the same code for enumberating video formats that are
present on cx88, bttv and saa7134 drivers.
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.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index f515f879125..c647dcb20a5 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -621,10 +621,19 @@ int em28xx_capture_start(struct em28xx *dev, int start) return rc; } -int em28xx_outfmt_set_yuv422(struct em28xx *dev) +int em28xx_set_outfmt(struct em28xx *dev) { - em28xx_write_reg(dev, EM28XX_R27_OUTFMT, 0x34); - em28xx_write_reg(dev, EM28XX_R10_VINMODE, 0x10); + int ret; + + ret = em28xx_write_reg_bits(dev, EM28XX_R27_OUTFMT, + dev->format->reg | 0x20, 0x3f); + if (ret < 0) + return ret; + + ret = em28xx_write_reg(dev, EM28XX_R10_VINMODE, 0x10); + if (ret < 0) + return ret; + return em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x11); } @@ -686,7 +695,7 @@ int em28xx_resolution_set(struct em28xx *dev) width = norm_maxw(dev); height = norm_maxh(dev) >> 1; - em28xx_outfmt_set_yuv422(dev); + em28xx_set_outfmt(dev); em28xx_accumulator_set(dev, 1, (width - 4) >> 2, 1, (height - 4) >> 2); em28xx_capture_area_set(dev, 0, 0, width >> 2, height >> 2); return em28xx_scaler_set(dev, dev->hscale, dev->vscale); |