Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a644e4a3e95f8ca6eca019c92d8dfde101150687
Commit:     a644e4a3e95f8ca6eca019c92d8dfde101150687
Parent:     272479d7ab067344d118e7633b624bf98f8896f3
Author:     Chris Pascoe <[EMAIL PROTECTED]>
AuthorDate: Mon Nov 19 03:05:09 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 19:02:20 2008 -0200

    V4L/DVB (6627): CXUSB: handle write then read from different address
    
    The path to perform a read immediately after a write was not checking that
    the address being read from was the same as the one that was written.
    
    Handling this case correctly should mean that we now can handle more than
    two i2c messages at a time.
    
    Signed-off-by: Chris Pascoe <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/dvb/dvb-usb/cxusb.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/cxusb.c 
b/drivers/media/dvb/dvb-usb/cxusb.c
index 016a378..74eeb16 100644
--- a/drivers/media/dvb/dvb-usb/cxusb.c
+++ b/drivers/media/dvb/dvb-usb/cxusb.c
@@ -83,9 +83,6 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct 
i2c_msg msg[],
        if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
                return -EAGAIN;
 
-       if (num > 2)
-               warn("more than two i2c messages at a time is not handled yet. 
TODO.");
-
        for (i = 0; i < num; i++) {
 
                if (d->udev->descriptor.idVendor == USB_VID_MEDION)
@@ -111,8 +108,9 @@ static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct 
i2c_msg msg[],
                                break;
                        }
                        memcpy(msg[i].buf, &ibuf[1], msg[i].len);
-               } else if (i+1 < num && (msg[i+1].flags & I2C_M_RD)) {
-                       /* write then read */
+               } else if (i+1 < num && (msg[i+1].flags & I2C_M_RD) &&
+                          msg[i].addr == msg[i+1].addr) {
+                       /* write to then read from same address */
                        u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len];
                        obuf[0] = msg[i].len;
                        obuf[1] = msg[i+1].len;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to