summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-12-11 10:55:52 +0200
committerPatrick Boettcher <pb@linuxtv.org>2006-12-11 10:55:52 +0200
commit4e224049c1f298a12a190e8153a0cdc5fa44fe77 (patch)
tree391ad39ffdb9a26854a5c7928ec259c49964fad3
parent6a77fe8fa75f27e398022ae2e89f45081d5a7250 (diff)
parentdd4d7f3416ae08b18a71aa06a23a14ea197a8a5b (diff)
downloadmediapointer-dvb-s2-4e224049c1f298a12a190e8153a0cdc5fa44fe77.tar.gz
mediapointer-dvb-s2-4e224049c1f298a12a190e8153a0cdc5fa44fe77.tar.bz2
merge from main
From: Patrick Boettcher <pb@linuxtv.org> merge from main Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
-rw-r--r--linux/drivers/media/video/usbvision/usbvision-i2c.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/linux/drivers/media/video/usbvision/usbvision-i2c.c b/linux/drivers/media/video/usbvision/usbvision-i2c.c
index 81bf4df65..500b18b5a 100644
--- a/linux/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/linux/drivers/media/video/usbvision/usbvision-i2c.c
@@ -52,6 +52,11 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
#define PDEBUG(level, fmt, args...) \
if (i2c_debug & (level)) info("[%s:%d] " fmt, __PRETTY_FUNCTION__, __LINE__ , ## args)
+static int usbvision_i2c_write(void *data, unsigned char addr, char *buf,
+ short len);
+static int usbvision_i2c_read(void *data, unsigned char addr, char *buf,
+ short len);
+
static inline int try_write_address(struct i2c_adapter *i2c_adap,
unsigned char addr, int retries)
{
@@ -63,7 +68,7 @@ static inline int try_write_address(struct i2c_adapter *i2c_adap,
data = i2c_get_adapdata(i2c_adap);
buf[0] = 0x00;
for (i = 0; i <= retries; i++) {
- ret = (adap->outb(data, addr, buf, 1));
+ ret = (usbvision_i2c_write(data, addr, buf, 1));
if (ret == 1)
break; /* success! */
udelay(5 /*adap->udelay */ );
@@ -88,7 +93,7 @@ static inline int try_read_address(struct i2c_adapter *i2c_adap,
data = i2c_get_adapdata(i2c_adap);
for (i = 0; i <= retries; i++) {
- ret = (adap->inb(data, addr, buf, 1));
+ ret = (usbvision_i2c_read(data, addr, buf, 1));
if (ret == 1)
break; /* success! */
udelay(5 /*adap->udelay */ );
@@ -155,7 +160,6 @@ static int
usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
{
struct i2c_msg *pmsg;
- struct i2c_algo_usb_data *adap = i2c_adap->algo_data;
void *data;
int i, ret;
unsigned char addr;
@@ -172,13 +176,13 @@ usb_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
if (pmsg->flags & I2C_M_RD) {
/* read bytes into buffer */
- ret = (adap->inb(data, addr, pmsg->buf, pmsg->len));
+ ret = (usbvision_i2c_read(data, addr, pmsg->buf, pmsg->len));
if (ret < pmsg->len) {
return (ret < 0) ? ret : -EREMOTEIO;
}
} else {
/* write bytes from buffer */
- ret = (adap->outb(data, addr, pmsg->buf, pmsg->len));
+ ret = (usbvision_i2c_write(data, addr, pmsg->buf, pmsg->len));
if (ret < pmsg->len) {
return (ret < 0) ? ret : -EREMOTEIO;
}