From patchwork Mon Aug 6 08:52:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 10503 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5668B24039 for ; Mon, 6 Aug 2012 08:52:40 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 04F05A18608 for ; Mon, 6 Aug 2012 08:52:39 +0000 (UTC) Received: by yenq6 with SMTP id q6so2245371yen.11 for ; Mon, 06 Aug 2012 01:52:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:mime-version:content-type :x-gm-message-state; bh=KVN57hUBJ96/nGgZp7/EnUkaZCxElqxiDVa5RU9RSsA=; b=BZJJjy2p/GTrExJ/wvoUcs+Dgi76OPmrRCisYqE3/+PVgZlnI2WuPOam2IjInITwxz QIop7XtdDIYd0/thvw+i476j/wLxlYPrcDiyqOS1JdLcSPX7fdyYQDcTfUS3P0upIhMS 3JjhC+gtT72AW2RbILkSKou672r4A6lWgB3ekDfSpmWbVLfAq4oM0dT9SwjC4KmLB7UN JDdUeqJK1tzSlR3ll6B6ssA6+6WvvpSZ8aFsj37qtpoqPkMkLywVeMng9WrOxKI7WxqK zpJQe8Y7cOOcFg2d0vvsRtLYXxuIeOG/WIM/5qadNT/f4b+h/KYjiSA2vmwCQnzjojvp o60A== Received: by 10.50.46.132 with SMTP id v4mr4648880igm.25.1344243158866; Mon, 06 Aug 2012 01:52:38 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp429088igz; Mon, 6 Aug 2012 01:52:37 -0700 (PDT) Received: by 10.14.206.200 with SMTP id l48mr11879852eeo.41.1344243156906; Mon, 06 Aug 2012 01:52:36 -0700 (PDT) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com. [207.126.144.113]) by mx.google.com with SMTP id o42si9772962eep.119.2012.08.06.01.52.32 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 01:52:36 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.113; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKUB+F0NUkSDEsL65mJVC5yJkfZVoJgaCL@postini.com; Mon, 06 Aug 2012 08:52:36 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 3855644; Mon, 6 Aug 2012 08:52:05 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 8FAE34A; Mon, 6 Aug 2012 05:21:49 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 5180DA8072; Mon, 6 Aug 2012 10:52:26 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.83.0; Mon, 6 Aug 2012 10:52:29 +0200 From: Linus Walleij To: Cc: Linus Walleij , Srinidhi Kasagar , Lee Jones Subject: [PATCH] ARM: ux500: resurrect I2C platform data Date: Mon, 6 Aug 2012 10:52:26 +0200 Message-ID: <1344243146-6598-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQno6d9uOB3sb4V7jTOaq+OIEQVbDo9OC8CHJp7P8LK+m4PjOB/otbUMqtAenpsBF4cI82mC From: Linus Walleij Commit: 98582d9562b4bea6b0eb6e2bfafcd3fab3b60ccb "ARM: ux500: Remove unused i2c platform_data initialisation code" Deleted platform data intialization code that was used, not unused as indicated in the commit. The boot log (without devicetree) now looks like this: nmk-i2c nmk-i2c.0: no platform data nmk-i2c nmk-i2c.1: no platform data nmk-i2c nmk-i2c.2: no platform data nmk-i2c nmk-i2c.3: no platform data And no I2C drivers register anymore. Take this opportunity to bump the i2c bus speed to 400kHz. Some recent discussion revealed inconsistency in the board file for the MOP500 family. The board can very well do 400kHz on the I2C busses, so make it do that. Cc: Srinidhi Kasagar Cc: Lee Jones Signed-off-by: Linus Walleij --- arch/arm/mach-ux500/board-mop500.c | 39 ++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 8674a89..dbb9946 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -327,12 +327,43 @@ static struct i2c_board_info __initdata mop500_i2c2_devices[] = { }, }; +#define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, t_out, _sm) \ +static struct nmk_i2c_controller u8500_i2c##id##_data = { \ + /* \ + * slave data setup time, which is \ + * 250 ns,100ns,10ns which is 14,6,2 \ + * respectively for a 48 Mhz \ + * i2c clock \ + */ \ + .slsu = _slsu, \ + /* Tx FIFO threshold */ \ + .tft = _tft, \ + /* Rx FIFO threshold */ \ + .rft = _rft, \ + /* std. mode operation */ \ + .clk_freq = clk, \ + /* Slave response timeout(ms) */\ + .timeout = t_out, \ + .sm = _sm, \ +} + +/* + * The board uses 4 i2c controllers, initialize all of + * them with slave data setup time of 250 ns, + * Tx & Rx FIFO threshold values as 1 resp. 8 and fast + * mode of operation + */ +U8500_I2C_CONTROLLER(0, 0xe, 1, 8, 400000, 200, I2C_FREQ_MODE_FAST); +U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 400000, 200, I2C_FREQ_MODE_FAST); +U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 400000, 200, I2C_FREQ_MODE_FAST); +U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 400000, 200, I2C_FREQ_MODE_FAST); + static void __init mop500_i2c_init(struct device *parent) { - db8500_add_i2c0(parent, NULL); - db8500_add_i2c1(parent, NULL); - db8500_add_i2c2(parent, NULL); - db8500_add_i2c3(parent, NULL); + db8500_add_i2c0(parent, &u8500_i2c0_data); + db8500_add_i2c1(parent, &u8500_i2c1_data); + db8500_add_i2c2(parent, &u8500_i2c2_data); + db8500_add_i2c3(parent, &u8500_i2c3_data); } static struct gpio_keys_button mop500_gpio_keys[] = {