diff options
author | Erik Andr?n <erik.andren@gmail.com> | 2009-01-20 02:13:34 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:35 -0400 |
commit | f676bb3971b3a77c1936a8507db485af2a3f2d2a (patch) | |
tree | 3cb786397e3dccd203860f172160c0ea9bb28eae /drivers/media/video/gspca/m5602 | |
parent | e7ae60f73eebd16cc13e616b096e8b1488915d96 (diff) |
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>
Diffstat (limited to 'drivers/media/video/gspca/m5602')
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_mt9m111.c | 10 | ||||
-rw-r--r-- | drivers/media/video/gspca/m5602/m5602_mt9m111.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/drivers/media/video/gspca/m5602/m5602_mt9m111.c index 7986ef074c55..e7399f3d10a2 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.c +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.c | |||
@@ -270,8 +270,9 @@ int mt9m111_start(struct sd *sd) | |||
270 | int i, err = 0; | 270 | int i, err = 0; |
271 | u8 data[2]; | 271 | u8 data[2]; |
272 | struct cam *cam = &sd->gspca_dev.cam; | 272 | struct cam *cam = &sd->gspca_dev.cam; |
273 | s32 *sensor_settings = sd->sensor_priv; | ||
273 | 274 | ||
274 | int width = cam->cam_mode[sd->gspca_dev.curr_mode].width; | 275 | int width = cam->cam_mode[sd->gspca_dev.curr_mode].width - 1; |
275 | int height = cam->cam_mode[sd->gspca_dev.curr_mode].height; | 276 | int height = cam->cam_mode[sd->gspca_dev.curr_mode].height; |
276 | 277 | ||
277 | for (i = 0; i < ARRAY_SIZE(start_mt9m111) && !err; i++) { | 278 | for (i = 0; i < ARRAY_SIZE(start_mt9m111) && !err; i++) { |
@@ -331,6 +332,13 @@ int mt9m111_start(struct sd *sd) | |||
331 | switch (width) { | 332 | switch (width) { |
332 | case 640: | 333 | case 640: |
333 | PDEBUG(D_V4L2, "Configuring camera for VGA mode"); | 334 | PDEBUG(D_V4L2, "Configuring camera for VGA mode"); |
335 | data[0] = MT9M111_RMB_OVER_SIZED; | ||
336 | data[1] = MT9M111_RMB_ROW_SKIP_2X | | ||
337 | MT9M111_RMB_COLUMN_SKIP_2X | | ||
338 | (sensor_settings[VFLIP_IDX] << 0) | | ||
339 | (sensor_settings[HFLIP_IDX] << 1); | ||
340 | |||
341 | err = m5602_write_sensor(sd, MT9M111_SC_R_MODE_CONTEXT_B, data, 2); | ||
334 | break; | 342 | break; |
335 | } | 343 | } |
336 | return err; | 344 | return err; |
diff --git a/drivers/media/video/gspca/m5602/m5602_mt9m111.h b/drivers/media/video/gspca/m5602/m5602_mt9m111.h index 7c8c700bab95..668422676aa6 100644 --- a/drivers/media/video/gspca/m5602/m5602_mt9m111.h +++ b/drivers/media/video/gspca/m5602/m5602_mt9m111.h | |||
@@ -86,7 +86,6 @@ | |||
86 | #define MT9M111_RMB_ROW_SKIP_2X (1 << 2) | 86 | #define MT9M111_RMB_ROW_SKIP_2X (1 << 2) |
87 | #define MT9M111_RMB_COLUMN_SKIP_2X (1 << 3) | 87 | #define MT9M111_RMB_COLUMN_SKIP_2X (1 << 3) |
88 | 88 | ||
89 | |||
90 | #define MT9M111_COLOR_MATRIX_BYPASS (1 << 4) | 89 | #define MT9M111_COLOR_MATRIX_BYPASS (1 << 4) |
91 | #define MT9M111_SEL_CONTEXT_B (1 << 3) | 90 | #define MT9M111_SEL_CONTEXT_B (1 << 3) |
92 | 91 | ||
@@ -250,12 +249,6 @@ static const unsigned char init_mt9m111[][4] = | |||
250 | {SENSOR, MT9M111_SC_VBLANK_CONTEXT_B, 0x00, 0x11}, /* 17 */ | 249 | {SENSOR, MT9M111_SC_VBLANK_CONTEXT_B, 0x00, 0x11}, /* 17 */ |
251 | {SENSOR, MT9M111_SC_HBLANK_CONTEXT_A, 0x01, 0x60}, /* 352 */ | 250 | {SENSOR, MT9M111_SC_HBLANK_CONTEXT_A, 0x01, 0x60}, /* 352 */ |
252 | {SENSOR, MT9M111_SC_VBLANK_CONTEXT_A, 0x00, 0x11}, /* 17 */ | 251 | {SENSOR, MT9M111_SC_VBLANK_CONTEXT_A, 0x00, 0x11}, /* 17 */ |
253 | {SENSOR, MT9M111_SC_R_MODE_CONTEXT_B, | ||
254 | MT9M111_RMB_OVER_SIZED, | ||
255 | MT9M111_RMB_MIRROR_ROWS | | ||
256 | MT9M111_RMB_MIRROR_COLS | | ||
257 | MT9M111_RMB_ROW_SKIP_2X | | ||
258 | MT9M111_RMB_COLUMN_SKIP_2X}, | ||
259 | {SENSOR, MT9M111_SC_R_MODE_CONTEXT_A, 0x01, 0x0f}, /* 271 */ | 252 | {SENSOR, MT9M111_SC_R_MODE_CONTEXT_A, 0x01, 0x0f}, /* 271 */ |
260 | {SENSOR, 0x30, 0x04, 0x00}, | 253 | {SENSOR, 0x30, 0x04, 0x00}, |
261 | /* Set number of blank rows chosen to 400 */ | 254 | /* Set number of blank rows chosen to 400 */ |