lkml.org 
[lkml]   [2004]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] I2C update for 2.6.7-rc1
Date
From
ChangeSet 1.1717.6.28, 2004/05/19 00:26:34-07:00, ebs@ebshome.net

[PATCH] I2C PPC4xx IIC driver: 0-length transaction temporary fix

this patch adds temporary fix for 0-length requests (e.g. SMBUS_QUICK) to PPC4xx
IIC driver. This i2c controller doesn't support such transactions and this patch
just restores previous driver version behavior making SMBUS_QUICK-based bus scan
at least partially usable. This is temporary kludge until correct bit-banging
emulation is implemented.


drivers/i2c/busses/i2c-ibm_iic.c | 10 ++++++++++
1 files changed, 10 insertions(+)


diff -Nru a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
--- a/drivers/i2c/busses/i2c-ibm_iic.c Fri May 28 14:52:12 2004
+++ b/drivers/i2c/busses/i2c-ibm_iic.c Fri May 28 14:52:12 2004
@@ -455,6 +455,16 @@
}
for (i = 0; i < num; ++i){
if (unlikely(msgs[i].len <= 0)){
+ if (num == 1 && !msgs[0].len){
+ /* Special case for I2C_SMBUS_QUICK emulation.
+ * Although this logic is FAR FROM PERFECT, this
+ * is what previous driver version did.
+ * IBM IIC doesn't support 0-length transactions
+ * (except bit-banging through IICx_DIRECTCNTL).
+ */
+ DBG("%d: zero-length msg kludge\n", dev->idx);
+ return 0;
+ }
DBG("%d: invalid len %d in msg[%d]\n", dev->idx,
msgs[i].len, i);
return -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:0.048 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site