From patchwork Fri Dec 5 09:19:10 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pierre Aubert
X-Patchwork-Id: 418045
X-Patchwork-Delegate: sbabic@denx.de
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Received: from theia.denx.de (theia.denx.de [85.214.87.163])
by ozlabs.org (Postfix) with ESMTP id C4C42140119
for ;
Fri, 5 Dec 2014 20:32:30 +1100 (AEDT)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 3F49D4B617;
Fri, 5 Dec 2014 10:32:28 +0100 (CET)
Received: from theia.denx.de ([127.0.0.1])
by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id 2nyNyOgbzaLV; Fri, 5 Dec 2014 10:32:27 +0100 (CET)
Received: from theia.denx.de (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id 5A3C44B609;
Fri, 5 Dec 2014 10:32:27 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
by theia.denx.de (Postfix) with ESMTP id A881A4B609
for ; Fri, 5 Dec 2014 10:32:23 +0100 (CET)
Received: from theia.denx.de ([127.0.0.1])
by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ctUebYwK2rxT for ;
Fri, 5 Dec 2014 10:32:23 +0100 (CET)
X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5
NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested)
Received: from esa1.staubli.c3s2.iphmx.com (esa1.staubli.c3s2.iphmx.com
[68.232.133.30]) by theia.denx.de (Postfix) with ESMTPS id 7A2DB4B608
for ; Fri, 5 Dec 2014 10:32:19 +0100 (CET)
X-IronPort-AV: E=Sophos;i="5.07,521,1413237600"; d="scan'208";a="13850566"
Received: from unknown (HELO fav03not.staubli.pri) ([217.109.88.35])
by esa1.staubli.c3s2.iphmx.com with ESMTP; 05 Dec 2014 10:19:21 +0100
Received: from favd8744.staubli.pri ([10.10.100.28])
by fav03not.staubli.pri (Lotus Domino Release 8.5.3FP5)
with ESMTP id 2014120510194120-35708 ;
Fri, 5 Dec 2014 10:19:41 +0100
Received: from favd8744.staubli.pri (localhost [127.0.0.1])
by favd8744.staubli.pri (8.14.5/8.14.5) with ESMTP id sB59Jfbj005457;
Fri, 5 Dec 2014 10:19:41 +0100
Received: (from aubert@localhost)
by favd8744.staubli.pri (8.14.5/8.14.5/Submit) id sB59JeBk005456;
Fri, 5 Dec 2014 10:19:40 +0100
From: Pierre Aubert
To: u-boot@lists.denx.de
Date: Fri, 5 Dec 2014 10:19:10 +0100
Message-Id: <1417771150-5413-1-git-send-email-p.aubert@staubli.com>
X-Mailer: git-send-email 1.7.6.5
X-MIMETrack: Itemize by SMTP Server on FAV03NOT/FAVERGES/STAUBLI(Release
8.5.3FP5|July 31, 2013) at 05/12/2014 10:19:41,
Serialize by Router on FAV03NOT/FAVERGES/STAUBLI(Release
8.5.3FP5|July 31, 2013) at 05/12/2014 10:19:41,
Serialize complete at 05/12/2014 10:19:41
Cc: Pierre Aubert
Subject: [U-Boot] [PATCH] imx: complete the definition of the I2C_PADS macros
X-BeenThere: u-boot@lists.denx.de
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: U-Boot discussion
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Sender: u-boot-bounces@lists.denx.de
Errors-To: u-boot-bounces@lists.denx.de
Complete the definition of the macros I2C_PADS and I2C_PADS_INFO for use
without multiple SoC type. Usefull when the same board have configurations
with or without SPL.
Cc: Stefano Babic
Cc: Nikita Kiryanov
Signed-off-by: Pierre Aubert
---
arch/arm/include/asm/imx-common/mxc_i2c.h | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/arm/include/asm/imx-common/mxc_i2c.h b/arch/arm/include/asm/imx-common/mxc_i2c.h
index af86163..459a2e9 100644
--- a/arch/arm/include/asm/imx-common/mxc_i2c.h
+++ b/arch/arm/include/asm/imx-common/mxc_i2c.h
@@ -50,6 +50,22 @@ struct i2c_pads_info {
#define I2C_PADS_INFO(name) \
(is_cpu_type(MXC_CPU_MX6Q) || is_cpu_type(MXC_CPU_MX6D)) ? \
&mx6q_##name : &mx6s_##name
+#else
+#define I2C_PADS(name, scl_i2c, scl_gpio, scl_gp, sda_i2c, sda_gpio, sda_gp) \
+ struct i2c_pads_info mx6_##name = { \
+ .scl = { \
+ .i2c_mode = MX6_##scl_i2c, \
+ .gpio_mode = MX6_##scl_gpio, \
+ .gp = scl_gp, \
+ }, \
+ .sda = { \
+ .i2c_mode = MX6_##sda_i2c, \
+ .gpio_mode = MX6_##sda_gpio, \
+ .gp = sda_gp, \
+ } \
+ }; \
+
+#define I2C_PADS_INFO(name) &mx6_##name
#endif
int setup_i2c(unsigned i2c_index, int speed, int slave_addr,