ARM: at91: do not configure at91sam9g10 twi pio as open-drain
authorLudovic Desroches <ludovic.desroches@atmel.com>
Wed, 12 Sep 2012 06:42:13 +0000 (08:42 +0200)
committerWolfram Sang <w.sang@pengutronix.de>
Wed, 12 Sep 2012 12:49:14 +0000 (14:49 +0200)
As indicated in the datasheet, TWD and TWCK must not be programmed as
open-drain.

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nikolaus Voss <n.voss@weinmann.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
arch/arm/mach-at91/at91sam9261_devices.c

index 29188ef7422b3bbbf55ad018ff758eb24bf65273..50d317940f5ab3779bb3f7afdf819d9faf75eecf 100644 (file)
@@ -327,16 +327,16 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
        /* IP version is not the same on 9261 and g10 */
        if (cpu_is_at91sam9g10()) {
                at91sam9261_twi_device.name = "i2c-at91sam9g10";
+               /* I2C PIO must not be configured as open-drain on this chip */
        } else {
                at91sam9261_twi_device.name = "i2c-at91sam9261";
+               at91_set_multi_drive(AT91_PIN_PA7, 1);
+               at91_set_multi_drive(AT91_PIN_PA8, 1);
        }
 
        /* pins used for TWI interface */
        at91_set_A_periph(AT91_PIN_PA7, 0);             /* TWD */
-       at91_set_multi_drive(AT91_PIN_PA7, 1);
-
        at91_set_A_periph(AT91_PIN_PA8, 0);             /* TWCK */
-       at91_set_multi_drive(AT91_PIN_PA8, 1);
 
        i2c_register_board_info(0, devices, nr_devices);
        platform_device_register(&at91sam9261_twi_device);