aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2008-12-27 11:30:10 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:36 -0400
commite31f9dd6624de2250d32b7ca88042b0bc51b3cc5 (patch)
treeb15c1126302497529d8b765d4fdce45f8a9aa86c /drivers/media
parent051781b3a8ea31f1834fddb916607a3088a28f71 (diff)
V4L/DVB (11406): gspca - m5602-ov9650: Add QCIF resolution support
Adds QCIF support for the ov9650 sensor Signed-off-by: Erik Andr?n <erik.andren@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c14
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.h33
2 files changed, 46 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 81e5d1d3bdbc..a50432c6269e 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -194,6 +194,20 @@ int ov9650_start(struct sd *sd)
194 err = m5602_write_bridge(sd, QVGA_ov9650[i][1], data); 194 err = m5602_write_bridge(sd, QVGA_ov9650[i][1], data);
195 } 195 }
196 break; 196 break;
197
198 case 176:
199 PDEBUG(D_V4L2, "Configuring camera for QCIF mode");
200
201 for (i = 0; i < ARRAY_SIZE(QCIF_ov9650) && !err; i++) {
202 u8 data = QCIF_ov9650[i][2];
203 if (QCIF_ov9650[i][0] == SENSOR)
204 err = m5602_write_sensor(sd,
205 QCIF_ov9650[i][1], &data, 1);
206 else
207 err = m5602_write_bridge(sd, QCIF_ov9650[i][1], data);
208 }
209 break;
210
197 } 211 }
198 return err; 212 return err;
199} 213}
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h
index f4b33b8e8dae..92536da9db63 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -96,6 +96,7 @@
96#define OV9650_VGA_SELECT (1 << 6) 96#define OV9650_VGA_SELECT (1 << 6)
97#define OV9650_CIF_SELECT (1 << 5) 97#define OV9650_CIF_SELECT (1 << 5)
98#define OV9650_QVGA_SELECT (1 << 4) 98#define OV9650_QVGA_SELECT (1 << 4)
99#define OV9650_QCIF_SELECT (1 << 3)
99#define OV9650_RGB_SELECT (1 << 2) 100#define OV9650_RGB_SELECT (1 << 2)
100#define OV9650_RAW_RGB_SELECT (1 << 0) 101#define OV9650_RAW_RGB_SELECT (1 << 0)
101 102
@@ -262,9 +263,19 @@ static struct m5602_sensor ov9650 = {
262 } 263 }
263 }, 264 },
264 265
265 .nmodes = 3, 266 .nmodes = 4,
266 .modes = { 267 .modes = {
267 { 268 {
269 176,
270 144,
271 V4L2_PIX_FMT_SBGGR8,
272 V4L2_FIELD_NONE,
273 .sizeimage =
274 176 * 144,
275 .bytesperline = 176,
276 .colorspace = V4L2_COLORSPACE_SRGB,
277 .priv = 0
278 }, {
268 320, 279 320,
269 240, 280 240,
270 V4L2_PIX_FMT_SBGGR8, 281 V4L2_PIX_FMT_SBGGR8,
@@ -530,4 +541,24 @@ static const unsigned char QVGA_ov9650[][3] =
530 OV9650_RAW_RGB_SELECT}, 541 OV9650_RAW_RGB_SELECT},
531}; 542};
532 543
544static const unsigned char QCIF_ov9650[][3] =
545{
546 /* Moves the view window in a vertical orientation */
547 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
548 {BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
549 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
550 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
551 {BRIDGE, M5602_XB_VSYNC_PARA, 0x90}, /* 144 */
552 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
553 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
554 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
555 {BRIDGE, M5602_XB_HSYNC_PARA, 0x31}, /* 48 */
556 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00}, /* 176 + 49 */
557 {BRIDGE, M5602_XB_HSYNC_PARA, 0xe1},
558
559 {SENSOR, OV9650_COM7, OV9650_QCIF_SELECT |
560 OV9650_RGB_SELECT |
561 OV9650_RAW_RGB_SELECT},
562};
563
533#endif 564#endif