summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Andrén <erik.andren@gmail.com>2008-12-23 22:06:37 +0100
committerErik Andrén <erik.andren@gmail.com>2008-12-23 22:06:37 +0100
commitcbd16cf5e7e4aae60ca283ad27bafae1fcb21102 (patch)
tree3e8b7782b0b3053aac67bfc2139f6b672a57e2e6
parent9a93d80c962c9118675ff97cdc3244b8a1749f3d (diff)
downloadmediapointer-dvb-s2-cbd16cf5e7e4aae60ca283ad27bafae1fcb21102.tar.gz
mediapointer-dvb-s2-cbd16cf5e7e4aae60ca283ad27bafae1fcb21102.tar.bz2
Rework parts of the resolution initialization
From: Erik Andrén <erik.andren@gmail.com> Priority: normal Signed-off-by: Erik Andrén <erik.andren@gmail.com>
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_ov9650.c8
-rw-r--r--linux/drivers/media/video/gspca/m5602/m5602_ov9650.h59
2 files changed, 32 insertions, 35 deletions
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_ov9650.c b/linux/drivers/media/video/gspca/m5602/m5602_ov9650.c
index f2fa24174..dde5075ed 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_ov9650.c
+++ b/linux/drivers/media/video/gspca/m5602/m5602_ov9650.c
@@ -141,7 +141,6 @@ int ov9650_init(struct sd *sd)
data = 0x30;
err = m5602_write_sensor(sd, OV9650_MVFP, &data, 1);
}
-
return err;
}
@@ -150,6 +149,13 @@ int ov9650_start(struct sd *sd)
int i, err = 0;
struct cam *cam = &sd->gspca_dev.cam;
+ for (i = 0; i < ARRAY_SIZE(res_init_ov9650) && !err; i++) {
+ u8 data = res_init_ov9650[i][1];
+ err = m5602_write_bridge(sd, res_init_ov9650[i][0], data);
+ }
+ if (err < 0)
+ return err;
+
switch (cam->cam_mode[sd->gspca_dev.curr_mode].width)
{
case 640:
diff --git a/linux/drivers/media/video/gspca/m5602/m5602_ov9650.h b/linux/drivers/media/video/gspca/m5602/m5602_ov9650.h
index 9d01bc259..f4b33b8e8 100644
--- a/linux/drivers/media/video/gspca/m5602/m5602_ov9650.h
+++ b/linux/drivers/media/video/gspca/m5602/m5602_ov9650.h
@@ -458,21 +458,20 @@ static const unsigned char power_down_ov9650[][3] =
{BRIDGE, M5602_XB_GPIO_EN_L, 0x06},
{BRIDGE, M5602_XB_GPIO_DAT_H, 0x02},
{BRIDGE, M5602_XB_SEN_CLK_DIV, 0x04},
- {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}
+ {BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0},
};
-static const unsigned char VGA_ov9650[][3] =
+static const unsigned char res_init_ov9650[][2] =
{
- {SENSOR, OV9650_COM7, OV9650_VGA_SELECT |
- OV9650_RGB_SELECT |
- OV9650_RAW_RGB_SELECT},
-
- {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82},
- {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00},
- {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
- {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
- {BRIDGE, M5602_XB_SIG_INI, 0x01},
+ {M5602_XB_LINE_OF_FRAME_H, 0x82},
+ {M5602_XB_LINE_OF_FRAME_L, 0x00},
+ {M5602_XB_PIX_OF_LINE_H, 0x82},
+ {M5602_XB_PIX_OF_LINE_L, 0x00},
+ {M5602_XB_SIG_INI, 0x01}
+};
+static const unsigned char VGA_ov9650[][3] =
+{
/* Moves the view window in a vertical orientation */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
@@ -484,21 +483,15 @@ static const unsigned char VGA_ov9650[][3] =
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02}, /* 640 + 98 */
- {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2}
-};
+ {BRIDGE, M5602_XB_HSYNC_PARA, 0xe2},
-static const unsigned char CIF_ov9650[][3] =
-{
- {SENSOR, OV9650_COM7, OV9650_CIF_SELECT |
+ {SENSOR, OV9650_COM7, OV9650_VGA_SELECT |
OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT},
+};
- {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82},
- {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00},
- {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
- {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
- {BRIDGE, M5602_XB_SIG_INI, 0x01},
-
+static const unsigned char CIF_ov9650[][3] =
+{
/* Moves the view window in a vertical orientation */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
@@ -510,21 +503,15 @@ static const unsigned char CIF_ov9650[][3] =
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x62}, /* 98 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 352 + 98 */
- {BRIDGE, M5602_XB_HSYNC_PARA, 0xc2}
-};
+ {BRIDGE, M5602_XB_HSYNC_PARA, 0xc2},
-static const unsigned char QVGA_ov9650[][3] =
-{
- {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT |
+ {SENSOR, OV9650_COM7, OV9650_CIF_SELECT |
OV9650_RGB_SELECT |
OV9650_RAW_RGB_SELECT},
+};
- {BRIDGE, M5602_XB_LINE_OF_FRAME_H, 0x82},
- {BRIDGE, M5602_XB_LINE_OF_FRAME_L, 0x00},
- {BRIDGE, M5602_XB_PIX_OF_LINE_H, 0x82},
- {BRIDGE, M5602_XB_PIX_OF_LINE_L, 0x00},
- {BRIDGE, M5602_XB_SIG_INI, 0x01},
-
+static const unsigned char QVGA_ov9650[][3] =
+{
/* Moves the view window in a vertical orientation */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x08},
@@ -536,7 +523,11 @@ static const unsigned char QVGA_ov9650[][3] =
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x31}, /* 50 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0x01}, /* 320 + 50 */
- {BRIDGE, M5602_XB_HSYNC_PARA, 0x71}
+ {BRIDGE, M5602_XB_HSYNC_PARA, 0x71},
+
+ {SENSOR, OV9650_COM7, OV9650_QVGA_SELECT |
+ OV9650_RGB_SELECT |
+ OV9650_RAW_RGB_SELECT},
};
#endif