git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
i2c
/
algos
/
i2c-algo-bit.c
diff --git
a/drivers/i2c/algos/i2c-algo-bit.c
b/drivers/i2c/algos/i2c-algo-bit.c
index
efcb775
..
df05df1
100644
(file)
--- a/
drivers/i2c/algos/i2c-algo-bit.c
+++ b/
drivers/i2c/algos/i2c-algo-bit.c
@@
-381,7
+381,13
@@
static inline int readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msg)
break;
}
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 {
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);
};
scllo(adap);
sdahi(adap);
- temp++;
- count--;
}
return rdcount;
}
}
return rdcount;
}
@@
-507,16
+511,14
@@
static int bit_xfer(struct i2c_adapter *i2c_adap,
static u32 bit_func(struct i2c_adapter *adap)
{
static u32 bit_func(struct i2c_adapter *adap)
{
- return I2C_FUNC_
SMBUS_EMUL | I2C_FUNC_10BIT_ADDR
|
- I2C_FUNC_PROTOCOL_MANGLING;
+ return I2C_FUNC_
I2C | I2C_FUNC_SMBUS_EMUL
|
+ I2C_FUNC_
10BIT_ADDR | I2C_FUNC_
PROTOCOL_MANGLING;
}
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_bit_algo = {
}
/* -----exported algorithm data: ------------------------------------- */
static struct i2c_algorithm i2c_bit_algo = {
- .name = "Bit-shift algorithm",
- .id = I2C_ALGO_BIT,
.master_xfer = bit_xfer,
.functionality = bit_func,
};
.master_xfer = bit_xfer,
.functionality = bit_func,
};
@@
-537,8
+539,6
@@
int i2c_bit_add_bus(struct i2c_adapter *adap)
DEB2(dev_dbg(&adap->dev, "hw routines registered.\n"));
/* register new adapter to i2c module... */
DEB2(dev_dbg(&adap->dev, "hw routines registered.\n"));
/* register new adapter to i2c module... */
-
- adap->id |= i2c_bit_algo.id;
adap->algo = &i2c_bit_algo;
adap->timeout = 100; /* default values, should */
adap->algo = &i2c_bit_algo;
adap->timeout = 100; /* default values, should */
@@
-561,8
+561,8
@@
MODULE_AUTHOR("Simon G. Vogl <simon@tk.uni-linz.ac.at>");
MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("I2C-Bus bit-banging algorithm");
MODULE_LICENSE("GPL");
-
MODULE_PARM(bit_test, "i"
);
-
MODULE_PARM(i2c_debug,"i"
);
+
module_param(bit_test, bool, 0
);
+
module_param(i2c_debug, int, S_IRUGO | S_IWUSR
);
MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck");
MODULE_PARM_DESC(i2c_debug,
MODULE_PARM_DESC(bit_test, "Test the lines of the bus to see if it is stuck");
MODULE_PARM_DESC(i2c_debug,