aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2009-01-15 12:18:36 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:34 -0400
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,
43 43
44static struct v4l2_pix_format po1030_modes[] = { 44static struct v4l2_pix_format po1030_modes[] = {
45 { 45 {
46 320,
47 240,
48 V4L2_PIX_FMT_SBGGR8,
49 V4L2_FIELD_NONE,
50 .sizeimage = 320 * 240,
51 .bytesperline = 320,
52 .colorspace = V4L2_COLORSPACE_SRGB,
53 .priv = 2
54 }, {
46 640, 55 640,
47 480, 56 480,
48 V4L2_PIX_FMT_SBGGR8, 57 V4L2_PIX_FMT_SBGGR8,
@@ -329,7 +338,40 @@ int po1030_start(struct sd *sd)
329 u8 data; 338 u8 data;
330 339
331 switch (width) { 340 switch (width) {
341 case 320:
342 data = PO1030_SUBSAMPLING;
343 err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
344 if (err < 0)
345 return err;
346
347 data = ((width + 3) >> 8) & 0xff;
348 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
349 if (err < 0)
350 return err;
351
352 data = (width + 3) & 0xff;
353 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_L, &data, 1);
354 if (err < 0)
355 return err;
356
357 data = ((height + 1) >> 8) & 0xff;
358 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_H, &data, 1);
359 if (err < 0)
360 return err;
361
362 data = (height + 1) & 0xff;
363 err = m5602_write_sensor(sd, PO1030_WINDOWHEIGHT_L, &data, 1);
364
365 height += 6;
366 width -= 1;
367 break;
368
332 case 640: 369 case 640:
370 data = 0;
371 err = m5602_write_sensor(sd, PO1030_CONTROL3, &data, 1);
372 if (err < 0)
373 return err;
374
333 data = ((width + 7) >> 8) & 0xff; 375 data = ((width + 7) >> 8) & 0xff;
334 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1); 376 err = m5602_write_sensor(sd, PO1030_WINDOWWIDTH_H, &data, 1);
335 if (err < 0) 377 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 @@
133 133
134#define PO1030_SENSOR_RESET (1 << 5) 134#define PO1030_SENSOR_RESET (1 << 5)
135 135
136#define PO1030_SUBSAMPLING (1 << 6)
137
136/*****************************************************************************/ 138/*****************************************************************************/
137 139
138#define PO1030_GLOBAL_GAIN_DEFAULT 0x12 140#define PO1030_GLOBAL_GAIN_DEFAULT 0x12