Patchwork [U-Boot,V11,09/13] OMAP3: SPL: do not call I2C init if no I2C is set.

login
register
mail settings
Submitter Stefano Babic
Date Dec. 16, 2011, 3:37 p.m.
Message ID <1324049833-18143-10-git-send-email-sbabic@denx.de>
Download mbox | patch
Permalink /patch/131853/
State RFC
Delegated to: Tom Rini
Headers show

Comments

Stefano Babic - Dec. 16, 2011, 3:37 p.m.
Call i2c initialization in spl_board_init only if I2C
is configured for the board.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <tom.rini@gmail.com>
CC: Wolfgang Denk <wd@denx.de>
CC: Simon Schwarz <simonschwarzcor@gmail.com>
---
 arch/arm/cpu/armv7/omap3/board.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Tom Rini - Dec. 16, 2011, 3:53 p.m.
On Fri, Dec 16, 2011 at 8:37 AM, Stefano Babic <sbabic@denx.de> wrote:
> Call i2c initialization in spl_board_init only if I2C
> is configured for the board.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Tom Rini <tom.rini@gmail.com>
> CC: Wolfgang Denk <wd@denx.de>
> CC: Simon Schwarz <simonschwarzcor@gmail.com>
> ---
>  arch/arm/cpu/armv7/omap3/board.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
> index 1f33c63..889d650 100644
> --- a/arch/arm/cpu/armv7/omap3/board.c
> +++ b/arch/arm/cpu/armv7/omap3/board.c
> @@ -92,7 +92,9 @@ u32 omap_boot_device(void)
>
>  void spl_board_init(void)
>  {
> +#ifdef CONFIG_HARD_I2C

This should be CONFIG_HARD_I2C || CONFIG_SOFT_I2C.  Or perhaps since
we're in SPL, CONFIG_SPL_I2C_SUPPORT ?

Patch

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 1f33c63..889d650 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -92,7 +92,9 @@  u32 omap_boot_device(void)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_HARD_I2C
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 }
 #endif /* CONFIG_SPL_BUILD */