[U-Boot] [PATCH] imx: complete the definition of the I2C_PADS macros

Pierre Aubert p.aubert at staubli.com
Fri Dec 5 10:19:10 CET 2014


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 <sbabic at denx.de>
Cc: Nikita Kiryanov <nikita at compulab.co.il>

Signed-off-by: Pierre Aubert <p.aubert at staubli.com>
---
 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,
-- 
1.7.6.5



More information about the U-Boot mailing list