From patchwork Fri Aug 31 09:23:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Desroches X-Patchwork-Id: 1391911 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 3B75DDF215 for ; Fri, 31 Aug 2012 09:27:12 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T7NS5-0004ty-Df; Fri, 31 Aug 2012 09:23:45 +0000 Received: from eusmtp01.atmel.com ([212.144.249.242]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T7NS1-0004rp-CQ for linux-arm-kernel@lists.infradead.org; Fri, 31 Aug 2012 09:23:41 +0000 Received: from HNOCHT02.corp.atmel.com (10.161.30.162) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server (TLS) id 14.2.318.1; Fri, 31 Aug 2012 11:24:58 +0200 Received: from ibiza.rfo.atmel.com (10.159.245.197) by HNOCHT02.corp.atmel.com (10.161.30.160) with Microsoft SMTP Server (TLS) id 14.2.318.1; Fri, 31 Aug 2012 11:23:39 +0200 From: To: , , Subject: [PATCH 4/8] ARM: at91: do not configure at91sam9g10 twi pio as open-drain Date: Fri, 31 Aug 2012 11:23:30 +0200 Message-ID: <1346405010-18499-1-git-send-email-ludovic.desroches@atmel.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1346404884-18451-1-git-send-email-ludovic.desroches@atmel.com> References: <1346404884-18451-1-git-send-email-ludovic.desroches@atmel.com> MIME-Version: 1.0 X-Originating-IP: [10.159.245.197] X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.1 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.2 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: plagnioj@jcrosoft.com, n.voss@weinmann.de, nicolas.ferre@atmel.com, Ludovic Desroches X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Ludovic Desroches As indicated in the datasheet, TWD and TWCK must not be programmed as open-drain. Signed-off-by: Ludovic Desroches --- arch/arm/mach-at91/at91sam9261_devices.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index c94495d..405f603 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c @@ -324,20 +324,22 @@ static struct platform_device at91sam9261_twi_device = { void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) { - /* IP version is not the same on 9261 and g10 */ + /* + * IP version is not the same on 9261 and g10 and only 9261 one + * requires to configure PIO as open-drain. + */ if (cpu_is_at91sam9g10()) { at91sam9261_twi_device.name = "at91sam9g10_i2c"; + at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ + at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ } else { at91sam9261_twi_device.name = "at91sam9261_i2c"; + 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); } - /* 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); }