Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76279
b: refs/heads/master
c: e92adc2
h: refs/heads/master
i:
  76277: 4d60413
  76275: bb9cba5
  76271: 51394d2
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent fa50f01 commit af1cf61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 289d4d2f0746715ada41e0945116eb3d62d5f35c
refs/heads/master: e92adc2c39aaaa0129b7b97584784a8ba9da9ec4
16 changes: 9 additions & 7 deletions trunk/drivers/media/video/cx23885/cx23885-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
u32 wdata, addr, ctrl;
int retval, cnt;

dprintk(1, "%s()\n", __FUNCTION__);
dprintk(1, "%s(msg->len=%d, last=%d)\n", __FUNCTION__, msg->len, last);

/* Deal with i2c probe functions with zero payload */
if (msg->len == 0) {
cx_write(bus->reg_addr, msg->addr << 25);
Expand Down Expand Up @@ -127,7 +128,7 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
wdata = msg->buf[cnt];
ctrl = bus->i2c_period | (1 << 12) | (1 << 2);

if (cnt < msg->len-1 || !last)
if (cnt < msg->len - 1)
ctrl |= I2C_NOSTOP | I2C_EXTEND;

cx_write(bus->reg_addr, addr);
Expand Down Expand Up @@ -162,7 +163,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
u32 ctrl, cnt;
int retval;

dprintk(1, "%s()\n", __FUNCTION__);
dprintk(1, "%s(msg->len=%d, last=%d)\n", __FUNCTION__, msg->len, last);

/* Deal with i2c probe functions with zero payload */
if (msg->len == 0) {
Expand All @@ -178,11 +179,14 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
return 0;
}

if (i2c_debug)
printk(" <R %02x", (msg->addr << 1) + 1);

for(cnt = 0; cnt < msg->len; cnt++) {

ctrl = bus->i2c_period | (1 << 12) | (1 << 2) | 1;

if (cnt < msg->len-1 || !last)
if (cnt < msg->len - 1)
ctrl |= I2C_NOSTOP | I2C_EXTEND;

cx_write(bus->reg_addr, msg->addr << 25);
Expand All @@ -195,9 +199,7 @@ static int i2c_readbytes(struct i2c_adapter *i2c_adap,
goto eio;
msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff;
if (i2c_debug) {
if (!(ctrl & I2C_NOSTOP))
printk(" <R %02x", (msg->addr << 1) +1);
printk(" =%02x", msg->buf[cnt]);
printk(" %02x", msg->buf[cnt]);
if (!(ctrl & I2C_NOSTOP))
printk(" >\n");
}
Expand Down

0 comments on commit af1cf61

Please sign in to comment.