From: Reinhard Meyer Date: Mon, 12 Jul 2010 08:49:26 +0200 Subject: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte() In-Reply-To: <4C3AAD74.7090307@wytron.com.tw> References: <1278396866-5571-1-git-send-email-thomas@wytron.com.tw> <4C3409F6.9000902@emk-elektronik.de> <4C3A96AF.9080109@wytron.com.tw> <4C3AA15E.6070203@emk-elektronik.de> <4C3AAD74.7090307@wytron.com.tw> Message-ID: <4C3ABAF6.5030607@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > # define I2C_SDA(bit) gpio_set_value(CONFIG_SOFT_I2C_GPIO_SDA, bit) > # else > # define I2C_SDA(bit) \ > if (bit) { \ > gpio_direction_input(CONFIG_SOFT_I2C_GPIO_SDA); \ > } else { \ > gpio_direction_output(CONFIG_SOFT_I2C_GPIO_SDA, 0);\ > } > # endif > # endif Why would we need that? Since the defines reside in the board/project specific include/configs/*.h file, it is well known if the hardware has open drain or not. > > BTW, will you be interested in using common gpio framework for avr32 > family? No, AVR32AP7000 is dead for me. Working on AT91SAM9xxx now, which already uses gpio framework... Reinhard -------------- next part -------------- A non-text attachment was scrubbed... Name: reinhard_meyer.vcf Type: text/x-vcard Size: 370 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20100712/6db4bf2c/attachment.vcf