Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-21 Thread Thomas Chou
Mike Frysinger wrote: once i enabled that for all Blackfin boards, soft i2c worked for me. so i posted an updated patch ... if you need some open drain behavior, i think it best to post a patch on top of that. -mike Hi Mike, Thanks. I tested the v2 patch, and it works well on my nios2

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-14 Thread Reinhard Meyer
Thomas Chou schrieb: Reinhard Meyer wrote: Thomas Chou schrieb: Reinhard Meyer wrote: Its even simpler, provided the hardware can do open collector. Here was my solution for AVR32AP7000: Then we could add a config for open drain similar to that of linux driver. # ifndef I2C_SDA # ifdef

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-13 Thread Thomas Chou
Reinhard Meyer wrote: Thomas Chou schrieb: Reinhard Meyer wrote: Its even simpler, provided the hardware can do open collector. Here was my solution for AVR32AP7000: Then we could add a config for open drain similar to that of linux driver. # ifndef I2C_SDA # ifdef

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-12 Thread Reinhard Meyer
Thomas Chou schrieb: Reinhard Meyer wrote: Its even simpler, provided the hardware can do open collector. Here was my solution for AVR32AP7000: Then we could add a config for open drain similar to that of linux driver. # ifndef I2C_SDA # ifdef CONFIG_SOFT_I2C_GPIO_SDA_IS_OPEN_DRAIN #

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-11 Thread Mike Frysinger
On Wednesday, July 07, 2010 00:45:42 Andrew Dyer wrote: On Tue, Jul 6, 2010 at 1:14 AM, Thomas Chou tho...@wytron.com.tw wrote: We should not set SDA after TRISTATE, as it results in contention. Signed-off-by: Thomas Chou tho...@wytron.com.tw --- drivers/i2c/soft_i2c.c |2 +- 1

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-11 Thread Andrew Dyer
On Sun, Jul 11, 2010 at 5:55 PM, Mike Frysinger vap...@gentoo.org wrote: On Wednesday, July 07, 2010 00:45:42 Andrew Dyer wrote: On Tue, Jul 6, 2010 at 1:14 AM, Thomas Chou tho...@wytron.com.tw wrote: We should not set SDA after TRISTATE, as it results in contention. Signed-off-by: Thomas

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-11 Thread Thomas Chou
Reinhard Meyer wrote: Whenever possible by the hardware, I make I2C_SDA/SCL(1) do a tri-state and I2C_TRISTATE and I2C_ACTIVE are empty. Dear Mike, I traced the i2c-gpio.c of linux and realized that there are potential bus contention with the current soft_i2c.c if the ports are not

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-11 Thread Reinhard Meyer
Thomas Chou wrote: Reinhard Meyer wrote: Whenever possible by the hardware, I make I2C_SDA/SCL(1) do a tri-state and I2C_TRISTATE and I2C_ACTIVE are empty. Dear Mike, I traced the i2c-gpio.c of linux and realized that there are potential bus contention with the current

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-11 Thread Thomas Chou
Reinhard Meyer wrote: Its even simpler, provided the hardware can do open collector. Here was my solution for AVR32AP7000: Then we could add a config for open drain similar to that of linux driver. # ifndef I2C_SDA # ifdef CONFIG_SOFT_I2C_GPIO_SDA_IS_OPEN_DRAIN # define I2C_SDA(bit)

[U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-06 Thread Thomas Chou
We should not set SDA after TRISTATE, as it results in contention. Signed-off-by: Thomas Chou tho...@wytron.com.tw --- drivers/i2c/soft_i2c.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c index 847db76..344b7f8 100644

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-06 Thread Andrew Dyer
On Tue, Jul 6, 2010 at 1:14 AM, Thomas Chou tho...@wytron.com.tw wrote: We should not set SDA after TRISTATE, as it results in contention. Signed-off-by: Thomas Chou tho...@wytron.com.tw ---  drivers/i2c/soft_i2c.c |    2 +-  1 files changed, 1 insertions(+), 1 deletions(-) diff --git

Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-06 Thread Reinhard Meyer
Andrew Dyer wrote: NAK. I2C_TRISTATE is supposed to be persistent until I2C_ACTIVE is called, so in the original code it should still be in effect when I2C_SDA(1) is executed and there should be no contention. This patch causes the code to actively drive SDA high at the same time the