On Fri, Nov 7, 2008 at 5:14 PM, Andrew Lunn <[EMAIL PROTECTED]> wrote: > > On Fri, Nov 07, 2008 at 08:39:23PM +0530, vibisreenivasan wrote: > > hello, > > Is there any one working on i2c bus driver for at91sam7x. > > I know eCosCentric have one, but you need to pay for that. > > Other people have mentioned writing i2c drivers as well. > > However, you need to be careful. The i2c hardware is broken. The Linux > kernel marks it as such. See: > > http://www.at91.com/samphpbb/viewtopic.php?t=4665&sid=1032a7cdc95b571dc784adb204d78d33 > > From what i understand, if you are doing transfers of 1 byte, it is > O.K, but multiple byte transfers can break. > > Writing a GPIO based driver should be reasonably easy as far as i > understand and does not suffer from these problems. > > Andrew
I have written such a driver some time ago, but I changed jobs since, so I don't have access to the source anymore. My experience: use GPIO and the eCos bit-banging interface, since the hardware implementation is seriously broken. The driver I wrote didn't work well using interrupts (latency problems combined with a 'smart' hardware implementation that decides to generate stop-conditions by itself, breaking multy-byte transfers, etc.) It did work in polling mode. Tom