aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.c8
-rw-r--r--drivers/media/video/gspca/m5602/m5602_ov9650.h59
2 files changed, 32 insertions, 35 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.c b/drivers/media/video/gspca/m5602/m5602_ov9650.c
index 2abb626c1c72..c908a8d6970a 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -139,7 +139,6 @@ int ov9650_init(struct sd *sd)
139 data = 0x30; 139 data = 0x30;
140 err = m5602_write_sensor(sd, OV9650_MVFP, &data, 1); 140 err = m5602_write_sensor(sd, OV9650_MVFP, &data, 1);
141 } 141 }
142
143 return err; 142 return err;
144} 143}
145 144
@@ -148,6 +147,13 @@ int ov9650_start(struct sd *sd)
148 int i, err = 0; 147 int i, err = 0;
149 struct cam *cam = &sd->gspca_dev.cam; 148 struct cam *cam = &sd->gspca_dev.cam;
150 149
150 for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
151 u8 data = res_init_ov9650[i][1];
152 err = m5602_write_bridge(sd, res_init_ov9650[i][0], data);
153 }
154 if (err < 0)
155 return err;
156
151 switch (cam->cam_mode[sd->gspca_dev.curr_mode].width) 157 switch (cam->cam_mode[sd->gspca_dev.curr_mode].width)
152 { 158 {
153 case 640: 159 case 640:
diff --git a/drivers/media/video/gspca/m5602/m5602_ov9650.h b/drivers/media/video/gspca/m5602/m5602_ov9650.h
index 9d01bc2596aa..f4b33b8e8dae 100644
--- a/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -458,21 +458,20 @@ static const unsigned char power_down_ov9650[][3] =
458 {BRIDGE, M5602_XB_GPIO_EN_L, 0x06}, 458 {BRIDGE, M5602_XB_GPIO_EN_L, 0x06},
459 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x02}, 459 {BRIDGE, M5602_XB_GPIO_DAT_H, 0x02},
460 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04}, 460 {BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04},
461 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0} 461 {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
462}; 462};
463 463
464static const unsigned char VGA_ov9650[][3] = 464static const unsigned char res_init_ov9650[][2] =
465{ 465{
466 {SENSOR, OV9650_COM7, OV9650_VGA_SELECT | 466 {M5602_XB_LINE_OF_FRAME_H, 0x82},
467 OV9650_RGB_SELECT | 467 {M5602_XB_LINE_OF_FRAME_L, 0x00},
468 OV9650_RAW_RGB_SELECT}, 468 {M5602_XB_PIX_OF_LINE_H, 0x82},
469 469 {M5602_XB_PIX_OF_LINE_L, 0x00},
470 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82}, 470 {M5602_XB_SIG_INI, 0x01}
471 {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00}, 471};
472 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
473 {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
474 {BRIDGE, M5602_XB_SIG_INI, 0x01},
475 472
473static const unsigned char VGA_ov9650[][3] =
474{
476 /* Moves the view window in a vertical orientation */ 475 /* Moves the view window in a vertical orientation */
477 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, 476 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
478 {BRIDGE, M5602_XB_VSYNC_PARA, 0x09}, 477 {BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
@@ -484,21 +483,15 @@ static const unsigned char VGA_ov9650[][3] =
484 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00}, 483 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
485 {BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */ 484 {BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */
486 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02}, /* 640 + 98 */ 485 {BRIDGE, M5602_XB_HSYNC_PARA, 0x02}, /* 640 + 98 */
487 {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2} 486 {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2},
488};
489 487
490static const unsigned char CIF_ov9650[][3] = 488 {SENSOR, OV9650_COM7, OV9650_VGA_SELECT |
491{
492 {SENSOR, OV9650_COM7, OV9650_CIF_SELECT |
493 OV9650_RGB_SELECT | 489 OV9650_RGB_SELECT |
494 OV9650_RAW_RGB_SELECT}, 490 OV9650_RAW_RGB_SELECT},
491};
495 492
496 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82}, 493static const unsigned char CIF_ov9650[][3] =
497 {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00}, 494{
498 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
499 {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
500 {BRIDGE, M5602_XB_SIG_INI, 0x01},
501
502 /* Moves the view window in a vertical orientation */ 495 /* Moves the view window in a vertical orientation */
503 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, 496 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
504 {BRIDGE, M5602_XB_VSYNC_PARA, 0x09}, 497 {BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
@@ -510,21 +503,15 @@ static const unsigned char CIF_ov9650[][3] =
510 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00}, 503 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
511 {BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */ 504 {BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */
512 {BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 352 + 98 */ 505 {BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 352 + 98 */
513 {BRIDGE, M5602_XB_HSYNC_PARA, 0xc2} 506 {BRIDGE, M5602_XB_HSYNC_PARA, 0xc2},
514};
515 507
516static const unsigned char QVGA_ov9650[][3] = 508 {SENSOR, OV9650_COM7, OV9650_CIF_SELECT |
517{
518 {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT |
519 OV9650_RGB_SELECT | 509 OV9650_RGB_SELECT |
520 OV9650_RAW_RGB_SELECT}, 510 OV9650_RAW_RGB_SELECT},
511};
521 512
522 {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82}, 513static const unsigned char QVGA_ov9650[][3] =
523 {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00}, 514{
524 {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
525 {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
526 {BRIDGE, M5602_XB_SIG_INI, 0x01},
527
528 /* Moves the view window in a vertical orientation */ 515 /* Moves the view window in a vertical orientation */
529 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00}, 516 {BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
530 {BRIDGE, M5602_XB_VSYNC_PARA, 0x08}, 517 {BRIDGE, M5602_XB_VSYNC_PARA, 0x08},
@@ -536,7 +523,11 @@ static const unsigned char QVGA_ov9650[][3] =
536 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00}, 523 {BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
537 {BRIDGE, M5602_XB_HSYNC_PARA, 0x31}, /* 50 */ 524 {BRIDGE, M5602_XB_HSYNC_PARA, 0x31}, /* 50 */
538 {BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 320 + 50 */ 525 {BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 320 + 50 */
539 {BRIDGE, M5602_XB_HSYNC_PARA, 0x71} 526 {BRIDGE, M5602_XB_HSYNC_PARA, 0x71},
527
528 {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT |
529 OV9650_RGB_SELECT |
530 OV9650_RAW_RGB_SELECT},
540}; 531};
541 532
542#endif 533#endif