[U-Boot-Users] [Patch 9/9]U-boot-V2:Boards:SDP3430 I2C bus1

Menon, Nishanth x0nishan at ti.com
Thu Jun 19 17:13:39 CEST 2008


Registers i2c adapters used when CONFIG_I2C_OMAP
is enabled in config.

This patch additionally fixes a minor sparse
warning sdram_dev

Signed-off-by: Nishanth Menon <x0nishan at ti.com>

---
 board/omap/board-sdp343x.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

Index: u-boot-v2.git/board/omap/board-sdp343x.c
===================================================================
--- u-boot-v2.git.orig/board/omap/board-sdp343x.c       2008-06-19 08:39:57.000000000 -0500
+++ u-boot-v2.git/board/omap/board-sdp343x.c    2008-06-19 08:51:37.000000000 -0500
@@ -54,6 +54,7 @@
 #include <asm/arch/syslib.h>
 #include <asm/arch/control.h>
 #include <asm/arch/omap3-mux.h>
+#include <asm/arch/i2c.h>
 #include "board-sdp343x.h"

 /******************** Board Boot Time *******************/
@@ -642,7 +643,7 @@
 console_initcall(sdp3430_console_init);
 #endif                         /* CONFIG_DRIVER_SERIAL_NS16550 */

-struct device_d sdram_dev = {
+static struct device_d sdram_dev = {
        .name = "ram",
        .id = "ram0",

@@ -665,6 +666,21 @@
 };
 #endif

+#ifdef CONFIG_I2C_OMAP
+static struct i2c_omap_platform_data sdp343_i2c1 = {
+       .bus_id = 0,
+       .i2c_clock_speed = OMAP_I2C_CLK_2P6M,
+       .func_clk = OMAP_I2C_FCLK_96MHZ,
+};
+static struct device_d sdp3430_i2c1 = {
+       .name = OMAP_I2C_ADAPTER_NAME,
+       .id = "omap-i2c0",
+       .map_base = OMAP_I2C1_BASE,
+       .platform_data = (void *)&sdp343_i2c1,
+       .type = DEVICE_TYPE_I2C,
+};
+#endif
+
 static int sdp3430_devices_init(void)
 {
        int ret;
@@ -676,6 +692,12 @@
        if (ret)
                goto failed;
 #endif
+#ifdef CONFIG_I2C_OMAP
+       ret = register_device(&sdp3430_i2c1);
+       if (ret)
+               goto failed;
+#endif
+
 failed:
        return ret;
 }




More information about the U-Boot mailing list