summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/gspca/m5602
diff options
context:
space:
mode:
authorErik Andr?n <erik.andren@gmail.com>2009-01-20 08:13:34 +0100
committerErik Andr?n <erik.andren@gmail.com>2009-01-20 08:13:34 +0100
commit9ae69affd3d0f322a1aeb125b84858d358386160 (patch)
tree78cf3626e9f951ca359ef14acc5400783577b604 /linux/drivers/media/video/gspca/m5602
parenteec79ab73da9af8887bf32700d43e196c74e2ddc (diff)
downloadmediapointer-dvb-s2-9ae69affd3d0f322a1aeb125b84858d358386160.tar.gz
mediapointer-dvb-s2-9ae69affd3d0f322a1aeb125b84858d358386160.tar.bz2
gspca - m5602-mt9m111: Setup VGA resolution
From: Erik Andr?n <erik.andren@gmail.com> Priority: normal Signed-off-by: Erik Andr?n <erik.andren@gmail.com>
Diffstat (limited to 'linux/drivers/media/video/gspca/m5602')
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c10
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h7
2 files changed, 9 insertions, 8 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
index 7986ef074..e7399f3d1 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.c
@@ -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;
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h
index 7c8c700ba..668422676 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h
+++ b/linux/drivers/media/video/gspca/m5602/m5602_mt9m111.h
@@ -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 */