From patchwork Mon Sep 3 10:16:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ludovic Desroches X-Patchwork-Id: 1399381 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 AC7EADFFD0 for ; Mon, 3 Sep 2012 10:20:57 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T8Tir-0005r7-0T; Mon, 03 Sep 2012 10:17:37 +0000 Received: from eusmtp01.atmel.com ([212.144.249.242]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T8TiP-0005ai-87 for linux-arm-kernel@lists.infradead.org; Mon, 03 Sep 2012 10:17:10 +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; Mon, 3 Sep 2012 12:18:22 +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; Mon, 3 Sep 2012 12:17:06 +0200 From: To: , , Subject: [PATCH v2 4/8] ARM: at91: do not configure at91sam9g10 twi pio as open-drain Date: Mon, 3 Sep 2012 12:16:03 +0200 Message-ID: <1346667367-7969-5-git-send-email-ludovic.desroches@atmel.com> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1346667367-7969-1-git-send-email-ludovic.desroches@atmel.com> References: <1346667367-7969-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, w.sang@pengutronix.de, 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 Acked-by: Nikolaus Voss Acked-by: Nicolas Ferre --- 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 fdb5675..991a7e4 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 = "i2c-at91sam9g10"; + at91_set_A_periph(AT91_PIN_PA7, 0); /* TWD */ + at91_set_A_periph(AT91_PIN_PA8, 0); /* TWCK */ } else { at91sam9261_twi_device.name = "i2c-at91sam9261"; + 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); }