Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124512
b: refs/heads/master
c: 082aa89
h: refs/heads/master
v: v3
  • Loading branch information
Erik Andrén authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent c4ad660 commit 54965ff
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 27 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3da3dce5afd267d354427042090aaf6370ebc15c
refs/heads/master: 082aa8937c79a02397981b7543ccc65d2bdeaf97
24 changes: 24 additions & 0 deletions trunk/drivers/media/video/gspca/m5602/m5602_ov9650.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,30 @@ int ov9650_init(struct sd *sd)
return err;
}

int ov9650_start(struct sd *sd)
{
int i, err = 0;
struct cam *cam = &sd->gspca_dev.cam;

switch (cam->cam_mode[sd->gspca_dev.curr_mode].width)
{
default:
case 640:
PDEBUG(D_V4L2, "Configuring camera for VGA mode");

for (i = 0; i < ARRAY_SIZE(VGA_ov9650) && !err; i++) {
u8 data = VGA_ov9650[i][2];
if (VGA_ov9650[i][0] == SENSOR)
err = m5602_write_sensor(sd,
VGA_ov9650[i][1], &data, 1);
else
err = m5602_write_bridge(sd, VGA_ov9650[i][1], data);
}
break;
}
return err;
}

int ov9650_power_down(struct sd *sd)
{
int i, err = 0;
Expand Down
59 changes: 33 additions & 26 deletions trunk/drivers/media/video/gspca/m5602/m5602_ov9650.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ extern int dump_sensor;

int ov9650_probe(struct sd *sd);
int ov9650_init(struct sd *sd);
int ov9650_start(struct sd *sd);
int ov9650_power_down(struct sd *sd);

int ov9650_set_exposure(struct gspca_dev *gspca_dev, __s32 val);
Expand Down Expand Up @@ -151,6 +152,7 @@ static struct m5602_sensor ov9650 = {
.i2c_regW = 1,
.probe = ov9650_probe,
.init = ov9650_init,
.start = ov9650_start,
.power_down = ov9650_power_down,

.nctrls = 8,
Expand Down Expand Up @@ -259,15 +261,15 @@ static struct m5602_sensor ov9650 = {
.nmodes = 1,
.modes = {
{
M5602_DEFAULT_FRAME_WIDTH,
M5602_DEFAULT_FRAME_HEIGHT,
640,
480,
V4L2_PIX_FMT_SBGGR8,
V4L2_FIELD_NONE,
.sizeimage =
M5602_DEFAULT_FRAME_WIDTH * M5602_DEFAULT_FRAME_HEIGHT,
.bytesperline = M5602_DEFAULT_FRAME_WIDTH,
640 * 480,
.bytesperline = 640,
.colorspace = V4L2_COLORSPACE_SRGB,
.priv = 1
.priv = 0
}
}
};
Expand Down Expand Up @@ -414,27 +416,6 @@ static const unsigned char init_ov9650[][3] =
{SENSOR, OV9650_GAIN, GAIN_DEFAULT},
{SENSOR, OV9650_BLUE, BLUE_GAIN_DEFAULT},
{SENSOR, OV9650_RED, RED_GAIN_DEFAULT},

{SENSOR, OV9650_COM3, OV9650_VARIOPIXEL},
{SENSOR, OV9650_COM5, OV9650_SYSTEM_CLK_SEL},

{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},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
/* Moves the view window in a vertical orientation */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01},
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe0}, /* 480 */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x64}, /* 100 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02}, /* 640 + 100 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0xe4}
};

static const unsigned char power_down_ov9650[][3] =
Expand All @@ -457,4 +438,30 @@ static const unsigned char power_down_ov9650[][3] =
{BRIDGE, M5602_XB_SEN_CLK_CTRL, 0xb0}
};

static const unsigned char VGA_ov9650[][3] =
{
{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},

/* Moves the view window in a vertical orientation */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x09},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x01},
{BRIDGE, M5602_XB_VSYNC_PARA, 0xe0}, /* 480 */
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_VSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x00},
{BRIDGE, M5602_XB_HSYNC_PARA, 0x64}, /* 100 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0x02}, /* 640 + 100 */
{BRIDGE, M5602_XB_HSYNC_PARA, 0xe4}
};

#endif

0 comments on commit 54965ff

Please sign in to comment.