Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285201
b: refs/heads/master
c: 819cd82
h: refs/heads/master
i:
  285199: 296ba93
v: v3
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Nov 8, 2011
1 parent dee292a commit a1087a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 35 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: fdb5a9111ef77d537efb86e90e8073ebfd0b553e
refs/heads/master: 819cd82b0a994d9d83dc1d1ced1088e71d702d4c
46 changes: 12 additions & 34 deletions trunk/drivers/media/video/usbvision/usbvision-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,42 +110,20 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,

unsigned char addr;
int ret;
if ((flags & I2C_M_TEN)) {
/* a ten bit address */
addr = 0xf0 | ((msg->addr >> 7) & 0x03);
/* try extended address code... */
ret = try_write_address(i2c_adap, addr, retries);
if (ret != 1) {
dev_err(&i2c_adap->dev,
"died at extended address code, while writing\n");
return -EREMOTEIO;
}
add[0] = addr;
if (flags & I2C_M_RD) {
/* okay, now switch into reading mode */
addr |= 0x01;
ret = try_read_address(i2c_adap, addr, retries);
if (ret != 1) {
dev_err(&i2c_adap->dev,
"died at extended address code, while reading\n");
return -EREMOTEIO;
}
}

} else { /* normal 7bit address */
addr = (msg->addr << 1);
if (flags & I2C_M_RD)
addr |= 1;
addr = (msg->addr << 1);
if (flags & I2C_M_RD)
addr |= 1;

add[0] = addr;
if (flags & I2C_M_RD)
ret = try_read_address(i2c_adap, addr, retries);
else
ret = try_write_address(i2c_adap, addr, retries);
add[0] = addr;
if (flags & I2C_M_RD)
ret = try_read_address(i2c_adap, addr, retries);
else
ret = try_write_address(i2c_adap, addr, retries);

if (ret != 1)
return -EREMOTEIO;

if (ret != 1)
return -EREMOTEIO;
}
return 0;
}

Expand Down Expand Up @@ -184,7 +162,7 @@ usbvision_i2c_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)

static u32 functionality(struct i2c_adapter *adap)
{
return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_10BIT_ADDR;
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
}

/* -----exported algorithm data: ------------------------------------- */
Expand Down

0 comments on commit a1087a3

Please sign in to comment.