Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357054
b: refs/heads/master
c: 18fa0d3
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Mauro Carvalho Chehab committed Dec 21, 2012
1 parent 31f5d3e commit e4cdbc3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 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: 8547fd18e9009ea0f010c5ec7463d61efa72b555
refs/heads/master: 18fa0d36ad5b451d835ca79301265649334214c0
13 changes: 8 additions & 5 deletions trunk/drivers/media/usb/gspca/sonixb.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,24 +496,27 @@ static void reg_w(struct gspca_dev *gspca_dev,
}
}

static void i2c_w(struct gspca_dev *gspca_dev, const __u8 *buffer)
static void i2c_w(struct gspca_dev *gspca_dev, const u8 *buf)
{
int retry = 60;

if (gspca_dev->usb_err < 0)
return;

/* is i2c ready */
reg_w(gspca_dev, 0x08, buffer, 8);
reg_w(gspca_dev, 0x08, buf, 8);
while (retry--) {
if (gspca_dev->usb_err < 0)
return;
msleep(10);
msleep(1);
reg_r(gspca_dev, 0x08);
if (gspca_dev->usb_buf[0] & 0x04) {
if (gspca_dev->usb_buf[0] & 0x08) {
dev_err(gspca_dev->v4l2_dev.dev,
"i2c write error\n");
"i2c error writing %02x %02x %02x %02x"
" %02x %02x %02x %02x\n",
buf[0], buf[1], buf[2], buf[3],
buf[4], buf[5], buf[6], buf[7]);
gspca_dev->usb_err = -EIO;
}
return;
Expand All @@ -530,7 +533,7 @@ static void i2c_w_vector(struct gspca_dev *gspca_dev,
for (;;) {
if (gspca_dev->usb_err < 0)
return;
reg_w(gspca_dev, 0x08, *buffer, 8);
i2c_w(gspca_dev, *buffer);
len -= 8;
if (len <= 0)
break;
Expand Down

0 comments on commit e4cdbc3

Please sign in to comment.