Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82c54f864fea26c4c44f27e2b4c4d9a811dde299
Commit:     82c54f864fea26c4c44f27e2b4c4d9a811dde299
Parent:     a7ff43b808f077e7aae2772b2f1a06a39e6b0cf8
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 25 07:17:48 2007 -0700
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Thu Oct 11 13:32:55 2007 +0200

    [AVR32] ngw100 i2c-gpio tweaks
    
    Make the NGW100 bitbang i2c use open drain signaling.
    
    Also, speed it up, so it's closer to 100 kHz ... the code paths seem
    to be long enough that the udelay isn't dominating bit times.  The
    peak bit rate I observed was around 125 kHz, but that's with large
    delays (usually before ACK/NAK) which hold the overall rate down to
    around 80 kHz (call it 100 usec/byte on average).
    
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/boards/atngw100/setup.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/arch/avr32/boards/atngw100/setup.c 
b/arch/avr32/boards/atngw100/setup.c
index 6e180f4..52987c8 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -125,8 +125,11 @@ static struct platform_device ngw_gpio_leds = {
 };
 
 static struct i2c_gpio_platform_data i2c_gpio_data = {
-       .sda_pin        = GPIO_PIN_PA(6),
-       .scl_pin        = GPIO_PIN_PA(7),
+       .sda_pin                = GPIO_PIN_PA(6),
+       .scl_pin                = GPIO_PIN_PA(7),
+       .sda_is_open_drain      = 1,
+       .scl_is_open_drain      = 1,
+       .udelay                 = 2,    /* close to 100 kHz */
 };
 
 static struct platform_device i2c_gpio_device = {
@@ -162,8 +165,10 @@ static int __init atngw100_init(void)
        }
        platform_device_register(&ngw_gpio_leds);
 
-       at32_select_gpio(i2c_gpio_data.sda_pin, 0);
-       at32_select_gpio(i2c_gpio_data.scl_pin, 0);
+       at32_select_gpio(i2c_gpio_data.sda_pin,
+               AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
+       at32_select_gpio(i2c_gpio_data.scl_pin,
+               AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
        platform_device_register(&i2c_gpio_device);
 
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to