forked from Minki/linux
[media] usbvision: Drop broken 10-bit I2C address support
The support for 10-bit I2C addresses in usbvision seems plain broken to me. I had already noticed that back in February 2007 [1]. The code was not fixed since then, so I take it that it's not actually needed. And as a matter of fact I don't know of any 10-bit addressed I2C tuner, encode, decoder or the like. So let's simply get rid of the broken and useless code. I'm also adding I2C_FUNC_I2C, as the driver and hardware support plain I2C messaging. [1] http://marc.info/?l=linux-i2c&m=117499415208244&w=2 Signed-off-by: Jean Delvare <khali@linux-fr.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
fdb5a9111e
commit
819cd82b0a
@ -110,42 +110,20 @@ static inline int usb_find_address(struct i2c_adapter *i2c_adap,
|
|||||||
|
|
||||||
unsigned char addr;
|
unsigned char addr;
|
||||||
int ret;
|
int ret;
|
||||||
if ((flags & I2C_M_TEN)) {
|
|
||||||
/* a ten bit address */
|
addr = (msg->addr << 1);
|
||||||
addr = 0xf0 | ((msg->addr >> 7) & 0x03);
|
if (flags & I2C_M_RD)
|
||||||
/* try extended address code... */
|
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);
|
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 */
|
if (ret != 1)
|
||||||
addr = (msg->addr << 1);
|
return -EREMOTEIO;
|
||||||
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);
|
|
||||||
|
|
||||||
if (ret != 1)
|
|
||||||
return -EREMOTEIO;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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)
|
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: ------------------------------------- */
|
/* -----exported algorithm data: ------------------------------------- */
|
||||||
|
Loading…
Reference in New Issue
Block a user