diff options
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.c | 13 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_ov9650.h | 39 |
2 files changed, 51 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c index 98c979dbbe3..2abb626c1c7 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.c +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c | |||
@@ -163,6 +163,19 @@ int ov9650_start(struct sd *sd) | |||
163 | } | 163 | } |
164 | break; | 164 | break; |
165 | 165 | ||
166 | case 352: | ||
167 | PDEBUG(D_V4L2, "Configuring camera for CIF mode"); | ||
168 | |||
169 | for (i = 0; i < ARRAY_SIZE(CIF_ov9650) && !err; i++) { | ||
170 | u8 data = CIF_ov9650[i][2]; | ||
171 | if (CIF_ov9650[i][0] == SENSOR) | ||
172 | err = m5602_write_sensor(sd, | ||
173 | CIF_ov9650[i][1], &data, 1); | ||
174 | else | ||
175 | err = m5602_write_bridge(sd, CIF_ov9650[i][1], data); | ||
176 | } | ||
177 | break; | ||
178 | |||
166 | case 320: | 179 | case 320: |
167 | PDEBUG(D_V4L2, "Configuring camera for QVGA mode"); | 180 | PDEBUG(D_V4L2, "Configuring camera for QVGA mode"); |
168 | 181 | ||
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h index b577017f6e5..9e955691aa6 100644 --- a/drivers/media/video/gspca/m5602/m5602_ov9650.h +++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h | |||
@@ -93,6 +93,7 @@ | |||
93 | 93 | ||
94 | #define OV9650_REGISTER_RESET (1 << 7) | 94 | #define OV9650_REGISTER_RESET (1 << 7) |
95 | #define OV9650_VGA_SELECT (1 << 6) | 95 | #define OV9650_VGA_SELECT (1 << 6) |
96 | #define OV9650_CIF_SELECT (1 << 5) | ||
96 | #define OV9650_QVGA_SELECT (1 << 4) | 97 | #define OV9650_QVGA_SELECT (1 << 4) |
97 | #define OV9650_RGB_SELECT (1 << 2) | 98 | #define OV9650_RGB_SELECT (1 << 2) |
98 | #define OV9650_RAW_RGB_SELECT (1 << 0) | 99 | #define OV9650_RAW_RGB_SELECT (1 << 0) |
@@ -258,7 +259,7 @@ static struct m5602_sensor ov9650 = { | |||
258 | } | 259 | } |
259 | }, | 260 | }, |
260 | 261 | ||
261 | .nmodes = 2, | 262 | .nmodes = 3, |
262 | .modes = { | 263 | .modes = { |
263 | { | 264 | { |
264 | 320, | 265 | 320, |
@@ -271,6 +272,16 @@ static struct m5602_sensor ov9650 = { | |||
271 | .colorspace = V4L2_COLORSPACE_SRGB, | 272 | .colorspace = V4L2_COLORSPACE_SRGB, |
272 | .priv = 0 | 273 | .priv = 0 |
273 | }, { | 274 | }, { |
275 | 352, | ||
276 | 288, | ||
277 | V4L2_PIX_FMT_SBGGR8, | ||
278 | V4L2_FIELD_NONE, | ||
279 | .sizeimage = | ||
280 | 352 * 288, | ||
281 | .bytesperline = 352, | ||
282 | .colorspace = V4L2_COLORSPACE_SRGB, | ||
283 | .priv = 0 | ||
284 | }, { | ||
274 | 640, | 285 | 640, |
275 | 480, | 286 | 480, |
276 | V4L2_PIX_FMT_SBGGR8, | 287 | V4L2_PIX_FMT_SBGGR8, |
@@ -469,6 +480,32 @@ static const unsigned char VGA_ov9650[][3] = | |||
469 | {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2} | 480 | {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2} |
470 | }; | 481 | }; |
471 | 482 | ||
483 | static const unsigned char CIF_ov9650[][3] = | ||
484 | { | ||
485 | {SENSOR, OV9650_COM7, OV9650_CIF_SELECT | | ||
486 | OV9650_RGB_SELECT | | ||
487 | OV9650_RAW_RGB_SELECT}, | ||
488 | |||
489 | {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82}, | ||
490 | {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00}, | ||
491 | {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82}, | ||
492 | {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00}, | ||
493 | {BRIDGE, M5602_XB_SIG_INI, 0x01}, | ||
494 | |||
495 | /* Moves the view window in a vertical orientation */ | ||
496 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, | ||
497 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x09}, | ||
498 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, | ||
499 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x01}, | ||
500 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x20}, /* 288 */ | ||
501 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, | ||
502 | {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, | ||
503 | {BRIDGE, M5602_XB_HSYNC_PARA, 0x00}, | ||
504 | {BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */ | ||
505 | {BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 352 + 98 */ | ||
506 | {BRIDGE, M5602_XB_HSYNC_PARA, 0xc2} | ||
507 | }; | ||
508 | |||
472 | static const unsigned char QVGA_ov9650[][3] = | 509 | static const unsigned char QVGA_ov9650[][3] = |
473 | { | 510 | { |
474 | {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT | | 511 | {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT | |