aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2009-01-15 14:18:36 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:20:34 -0300
commit931a1c8dbf71d851d9d4e4dbdedc192bcc9e98c1 (patch)
treee34f703fe2670840073f3bc3f3a624da5c00e3ea /drivers
parent9536a57e7783c627b2bb83f78a99f5c6dcf5d505 (diff)
V4L/DVB (11535): gspca - m5602-po1030: Add experimental QVGA support
Adds experimental support for QVGA. This is code is compile tested only. Signed-off-by: Erik Andr?n <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.c42
-rw-r--r--drivers/media/video/gspca/m5602/m5602_po1030.h2
2 files changed, 44 insertions, 0 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.c b/drivers/media/video/gspca/m5602/m5602_po1030.c
index d75b27221a5..9e9eed89ea6 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.c
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.c
@@ -43,6 +43,15 @@ static int po1030_get_auto_exposure(struct gspca_dev *gspca_dev,
static struct v4l2_pix_format po1030_modes[] = {
{
+ 320,
+ 240,
+ V4L2_PIX_FMT_SBGGR8,
+ V4L2_FIELD_NONE,
+ .sizeimage = 320 * 240,
+ .bytesperline = 320,
+ .colorspace = V4L2_COLORSPACE_SRGB,
+ .priv = 2
+ }, {
640,
480,
V4L2_PIX_FMT_SBGGR8,
@@ -329,7 +338,40 @@ int po1030_start(struct sd *sd)
u8 data;
switch (width) {
+ case 320:
+ data = PO1030_SUBSAMPLING;
+ err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
+ if (err < 0)
+ return err;
+
+ data = ((width + 3) >> 8) & 0xff;
+ err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
+ if (err < 0)
+ return err;
+
+ data = (width + 3) & 0xff;
+ err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_L, &data, 1);
+ if (err < 0)
+ return err;
+
+ data = ((height + 1) >> 8) & 0xff;
+ err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_H, &data, 1);
+ if (err < 0)
+ return err;
+
+ data = (height + 1) & 0xff;
+ err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_L, &data, 1);
+
+ height += 6;
+ width -= 1;
+ break;
+
case 640:
+ data = 0;
+ err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
+ if (err < 0)
+ return err;
+
data = ((width + 7) >> 8) & 0xff;
err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
if (err < 0)
diff --git a/drivers/media/video/gspca/m5602/m5602_po1030.h b/drivers/media/video/gspca/m5602/m5602_po1030.h
index 8ded84d2097..1ea380b2bbe 100644
--- a/drivers/media/video/gspca/m5602/m5602_po1030.h
+++ b/drivers/media/video/gspca/m5602/m5602_po1030.h
@@ -133,6 +133,8 @@
#define PO1030_SENSOR_RESET (1 << 5)
+#define PO1030_SUBSAMPLING (1 << 6)
+
/*****************************************************************************/
#define PO1030_GLOBAL_GAIN_DEFAULT 0x12