]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Revert "I2C: Add back the zero size hack"
authorTony Lindgren <tony@atomide.com>
Wed, 3 Jan 2007 17:22:17 +0000 (09:22 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 3 Jan 2007 17:22:17 +0000 (09:22 -0800)
This reverts f690b5406fd6b4094d06ebc9ea9ae07a5bd87f32 commit.

I2C_FUNC_SMBUS_QUICK was missing. See next patch.

drivers/i2c/busses/i2c-omap.c

index a059a3adc2ec627a3ce3f786234f8e078b2b065d..da897a48c6a18be4da8f357641d558cd8e1f3de7 100644 (file)
@@ -285,14 +285,12 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
                             struct i2c_msg *msg, int stop)
 {
        struct omap_i2c_dev *dev = i2c_get_adapdata(adap);
-       u8 zero_byte = 0;
        int r;
        u16 w;
 
        dev_dbg(dev->dev, "addr: 0x%04x, len: %d, flags: 0x%x, stop: %d\n",
                msg->addr, msg->len, msg->flags, stop);
 
-#if 0
        if (msg->len == 0)
                return -EINVAL;
 
@@ -302,27 +300,6 @@ static int omap_i2c_xfer_msg(struct i2c_adapter *adap,
        dev->buf = msg->buf;
        dev->buf_len = msg->len;
 
-#else
-
-       omap_i2c_write_reg(dev, OMAP_I2C_SA_REG, msg->addr);
-       /* REVISIT: Remove this hack when we can get I2C chips from board-*.c
-        *          files
-        * Sigh, seems we can't do zero length transactions. Thus, we
-        * can't probe for devices w/o actually sending/receiving at least
-        * a single byte. So we'll set count to 1 for the zero length
-        * transaction case and hope we don't cause grief for some
-        * arbitrary device due to random byte write/read during
-        * probes.
-        */
-       if (msg->len == 0) {
-               dev->buf = &zero_byte;
-               dev->buf_len = 1;
-       } else {
-               dev->buf = msg->buf;
-               dev->buf_len = msg->len;
-       }
-#endif
-
        omap_i2c_write_reg(dev, OMAP_I2C_CNT_REG, dev->buf_len);
 
        init_completion(&dev->cmd_complete);