summaryrefslogtreecommitdiff
path: root/linux/drivers
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-14 12:33:25 -0300
commitf4a61c7eab17e012ce6341745b57b329d9feda98 (patch)
tree852bfe1af7b90d0ae1a48f9eab8512db284a7814 /linux/drivers
parent0edfef5c337eb0bd9d0146246fae01a308faea4f (diff)
downloadmediapointer-dvb-s2-f4a61c7eab17e012ce6341745b57b329d9feda98.tar.gz
mediapointer-dvb-s2-f4a61c7eab17e012ce6341745b57b329d9feda98.tar.bz2
em28xx: adjust vinmode/vinctl based on the stream input format
From: Mauro Carvalho Chehab <mchehab@redhat.com> 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 'linux/drivers')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-cards.c11
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-core.c17
-rw-r--r--linux/drivers/media/video/em28xx/em28xx.h3
3 files changed, 17 insertions, 14 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c
index 75032271d..b40a01e91 100644
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c
@@ -1806,6 +1806,11 @@ static int em28xx_hint_sensor(struct em28xx *dev)
dev->sensor_xres = 640;
dev->sensor_yres = 480;
dev->sensor_xtal = 6300000;
+
+ /* probably means GRGB 16 bit bayer */
+ dev->vinmode = 0x0d;
+ dev->vinctl = 0x00;
+
break;
default:
printk("Unknown Micron Sensor 0x%04x\n", be16_to_cpu(version));
@@ -2531,6 +2536,12 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
}
/*
+ * Default format, used for tvp5150 or saa711x output formats
+ */
+ dev->vinmode = 0x10;
+ dev->vinctl = 0x11;
+
+ /*
* If the device can be a webcam, seek for a sensor.
* If sensor is not found, then it isn't a webcam.
*/
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c
index 22481e5dd..f24af40df 100644
--- a/linux/drivers/media/video/em28xx/em28xx-core.c
+++ b/linux/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,
diff --git a/linux/drivers/media/video/em28xx/em28xx.h b/linux/drivers/media/video/em28xx/em28xx.h
index 26011bf37..783799324 100644
--- a/linux/drivers/media/video/em28xx/em28xx.h
+++ b/linux/drivers/media/video/em28xx/em28xx.h
@@ -492,6 +492,9 @@ struct em28xx {
int sensor_xres, sensor_yres;
int sensor_xtal;
+ /* Vinmode/Vinctl used at the driver */
+ int vinmode, vinctl;
+
unsigned int stream_on:1; /* Locks streams */
unsigned int has_audio_class:1;
unsigned int has_alsa_audio:1;