Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137794
b: refs/heads/master
c: 1de1ddf
h: refs/heads/master
v: v3
  • Loading branch information
Jean-Francois Moine authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 0e22c57 commit 851f404
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 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: a5df5c14335988317da4ba9aec64b7eb971a6ffc
refs/heads/master: 1de1ddf35752485fd1b7774385b72f0f618058fd
49 changes: 24 additions & 25 deletions trunk/drivers/media/video/gspca/spca505.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,31 +650,6 @@ static int sd_config(struct gspca_dev *gspca_dev,
/* this function is called at probe and resume time */
static int sd_init(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
int ret;

if (sd->subtype == Nxultra)
write_vector(gspca_dev, spca505b_open_data_ccd);
else
write_vector(gspca_dev, spca505_open_data_ccd);
ret = reg_read(gspca_dev, 0x06, 0x16);

if (ret < 0) {
PDEBUG(D_ERR|D_CONF,
"register read failed err: %d",
ret);
return ret;
}
if (ret != 0x0101) {
PDEBUG(D_ERR|D_CONF,
"After vector read returns 0x%04x should be 0x0101",
ret);
}

ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a);
if (ret < 0)
return ret;
reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12);
return 0;
}

Expand All @@ -689,6 +664,7 @@ static void setbrightness(struct gspca_dev *gspca_dev)

static int sd_start(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
struct usb_device *dev = gspca_dev->dev;
int ret, mode;
static u8 mode_tb[][3] = {
Expand All @@ -700,6 +676,29 @@ static int sd_start(struct gspca_dev *gspca_dev)
{0x05, 0x40, 0x40} /* 160x120 */
};

if (sd->subtype == Nxultra)
write_vector(gspca_dev, spca505b_open_data_ccd);
else
write_vector(gspca_dev, spca505_open_data_ccd);
ret = reg_read(gspca_dev, 0x06, 0x16);

if (ret < 0) {
PDEBUG(D_ERR|D_CONF,
"register read failed err: %d",
ret);
return ret;
}
if (ret != 0x0101) {
PDEBUG(D_ERR|D_CONF,
"After vector read returns 0x%04x should be 0x0101",
ret);
}

ret = reg_write(gspca_dev->dev, 0x06, 0x16, 0x0a);
if (ret < 0)
return ret;
reg_write(gspca_dev->dev, 0x05, 0xc2, 0x12);

/* necessary because without it we can see stream
* only once after loading module */
/* stopping usb registers Tomasz change */
Expand Down

0 comments on commit 851f404

Please sign in to comment.