V4L/DVB (11543): gspca - m5602-mt9m111: Setup VGA resolution

Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Erik Andr?n 2009-01-20 04:13:34 -03:00 committed by Mauro Carvalho Chehab
parent e7ae60f73e
commit f676bb3971
2 changed files with 9 additions and 8 deletions

View File

@ -270,8 +270,9 @@ int mt9m111_start(struct sd *sd)
int i, err = 0;
u8 data[2];
struct cam *cam = &sd->gspca_dev.cam;
s32 *sensor_settings = sd->sensor_priv;
int width = cam->cam_mode[sd->gspca_dev.curr_mode].width;
int width = cam->cam_mode[sd->gspca_dev.curr_mode].width - 1;
int height = cam->cam_mode[sd->gspca_dev.curr_mode].height;
for (i = 0; i < ARRAY_SIZE(start_mt9m111) && !err; i++) {
@ -331,6 +332,13 @@ int mt9m111_start(struct sd *sd)
switch (width) {
case 640:
PDEBUG(D_V4L2, "Configuring camera for VGA mode");
data[0] = MT9M111_RMB_OVER_SIZED;
data[1] = MT9M111_RMB_ROW_SKIP_2X |
MT9M111_RMB_COLUMN_SKIP_2X |
(sensor_settings[VFLIP_IDX] << 0) |
(sensor_settings[HFLIP_IDX] << 1);
err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2);
break;
}
return err;

View File

@ -86,7 +86,6 @@
#define MT9M111_RMB_ROW_SKIP_2X (1 << 2)
#define MT9M111_RMB_COLUMN_SKIP_2X (1 << 3)
#define MT9M111_COLOR_MATRIX_BYPASS (1 << 4)
#define MT9M111_SEL_CONTEXT_B (1 << 3)
@ -250,12 +249,6 @@ static const unsigned char init_mt9m111[][4] =
{SENSOR, MT9M111_SC_VBLANK_CONTEXT_B, 0x00, 0x11}, /* 17 */
{SENSOR, MT9M111_SC_HBLANK_CONTEXT_A, 0x01, 0x60}, /* 352 */
{SENSOR, MT9M111_SC_VBLANK_CONTEXT_A, 0x00, 0x11}, /* 17 */
{SENSOR, MT9M111_SC_R_MODE_CONTEXT_B,
MT9M111_RMB_OVER_SIZED,
MT9M111_RMB_MIRROR_ROWS |
MT9M111_RMB_MIRROR_COLS |
MT9M111_RMB_ROW_SKIP_2X |
MT9M111_RMB_COLUMN_SKIP_2X},
{SENSOR, MT9M111_SC_R_MODE_CONTEXT_A, 0x01, 0x0f}, /* 271 */
{SENSOR, 0x30, 0x04, 0x00},
/* Set number of blank rows chosen to 400 */