[U-Boot-Users] [Patch 9/9] U-boot-V2:Boards:SDP3430: Enable i2c bus1
Sascha Hauer
s.hauer at pengutronix.de
Wed Jun 18 17:34:00 CEST 2008
On Wed, Jun 18, 2008 at 07:36:20AM -0500, Menon, Nishanth wrote:
> Enable the i2c bus 1 if the adapter is enabled in defconfig.
How does the bus find its devices? Are they probed? Experience showed
that probing i2c devices is not safe, so this should be explicitly
allowed on board level.
Sascha
>
> This patch also fixes a sparse warning of sdram dev not being static
>
> Signed-off-by: Nishanth Menon <x0nishan at ti.com>
>
> ---
> board/omap/board-sdp343x.c | 26 +++++++++++++++++++++++++-
> 1 file changed, 25 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-17 16:52:25.000000000 -0500
> +++ u-boot-v2.git/board/omap/board-sdp343x.c 2008-06-17 17:01:31.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,23 @@
> };
> #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,
> + .info = NULL,
> + .len = 0,
> +};
> +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 +694,12 @@
> if (ret)
> goto failed;
> #endif
> +#ifdef CONFIG_I2C_OMAP
> + ret = register_device(&sdp3430_i2c1);
> + if (ret)
> + goto failed;
> +#endif
> +
> failed:
> return ret;
> }
>
--
Pengutronix e.K. - Linux Solutions for Science and Industry
-----------------------------------------------------------
Kontakt-Informationen finden Sie im Header dieser Mail oder
auf der Webseite -> http://www.pengutronix.de/impressum/ <-
More information about the U-Boot
mailing list