Commit e0c91a98 authored by Kevin O\'Connor's avatar Kevin O\'Connor Committed by Deepak Saxena

[PATCH] I2C: support I2C_M_NO_RD_ACK in i2c-algo-bit

I have an I2C device (Samsung ks0127 video grabber) with a peculiar i2c
implementation.  When reading bytes, it only senses for the stop condition
in the place where the acknowledge bit should be.  So, to properly support
this device acks need to be turned off during reads.

There is an I2C_M_NO_RD_ACK bit already defined in i2c.h which appears to
be what I want.  Unfortunately it doesn't seem to be used anywhere in the
current tree.  At the end of this message is a patch to teach i2c_algo_bit
to honor the bit.
parent 5c2bdb6c
......@@ -381,7 +381,13 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
break;
}
if ( count > 1 ) { /* send ack */
temp++;
count--;
if (msg->flags & I2C_M_NO_RD_ACK)
continue;
if ( count > 0 ) { /* send ack */
sdalo(adap);
DEBPROTO(printk(" Am "));
} else {
......@@ -395,8 +401,6 @@ static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
};
scllo(adap);
sdahi(adap);
temp++;
count--;
}
return rdcount;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment