summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-26 09:06:53 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-26 09:06:53 -0200
commitc0865655193316a68b177107fc481c0e60845c74 (patch)
tree1c647667546009f48c1a1fb410473264902cb4e1 /linux/drivers/media/video
parent0112b169f6a802bc14c7d9c52eed37f5990dfa93 (diff)
parenta4e2a7b449b5a1f8c2ad97ca1f58ba6df206597b (diff)
downloadmediapointer-dvb-s2-c0865655193316a68b177107fc481c0e60845c74.tar.gz
mediapointer-dvb-s2-c0865655193316a68b177107fc481c0e60845c74.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/cx23885/cx23885-i2c.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/linux/drivers/media/video/cx23885/cx23885-i2c.c b/linux/drivers/media/video/cx23885/cx23885-i2c.c
index da621d2d7..9906a02a8 100644
--- a/linux/drivers/media/video/cx23885/cx23885-i2c.c
+++ b/linux/drivers/media/video/cx23885/cx23885-i2c.c
@@ -85,7 +85,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);
@@ -128,7 +129,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);
@@ -163,7 +164,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) {
@@ -179,11 +180,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);
@@ -196,9 +200,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");
}