diff mbox

[6/6,V2] SMDK5250: Initialise I2C using FDT

Message ID 1352884279-24067-7-git-send-email-rajeshwari.s@samsung.com
State Superseded
Headers show

Commit Message

Rajeshwari Shinde Nov. 14, 2012, 9:11 a.m. UTC
This patch initialises I2C using FDT.

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
---
Changes since V2:
	- board_i2c_init moved to driver in case of FDT.
 board/samsung/smdk5250/smdk5250.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

Comments

Simon Glass Nov. 14, 2012, 6:46 p.m. UTC | #1
On Wed, Nov 14, 2012 at 1:11 AM, Rajeshwari Shinde
<rajeshwari.s@samsung.com> wrote:
> This patch initialises I2C using FDT.
>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>

Acked-by: Simon Glass <sjg@chromium.org>

> ---
> Changes since V2:
>         - board_i2c_init moved to driver in case of FDT.
>  board/samsung/smdk5250/smdk5250.c |   20 +-------------------
>  1 files changed, 1 insertions(+), 19 deletions(-)
>
> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
> index db2457b..5ebc665 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -272,24 +272,6 @@ static int board_uart_init(void)
>         return 0;
>  }
>
> -#ifdef CONFIG_SYS_I2C_INIT_BOARD
> -static int board_i2c_init(void)
> -{
> -       int i, err;
> -
> -       for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
> -               err = exynos_pinmux_config((PERIPH_ID_I2C0 + i),
> -                                               PINMUX_FLAG_NONE);
> -               if (err) {
> -                       debug("I2C%d not configured\n", (PERIPH_ID_I2C0 + i));
> -                       return err;
> -               }
> -       }
> -       i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
> -       return 0;
> -}
> -#endif
> -
>  #ifdef CONFIG_BOARD_EARLY_INIT_F
>  int board_early_init_f(void)
>  {
> @@ -300,7 +282,7 @@ int board_early_init_f(void)
>                 return err;
>         }
>  #ifdef CONFIG_SYS_I2C_INIT_BOARD
> -       err = board_i2c_init();
> +       board_i2c_init(gd->fdt_blob);
>  #endif
>         return err;
>  }
> --
> 1.7.4.4
>
Heiko Schocher Nov. 19, 2012, 8:54 a.m. UTC | #2
Hello Rajeshwari,

On 14.11.2012 10:11, Rajeshwari Shinde wrote:
> This patch initialises I2C using FDT.
>
> Signed-off-by: Rajeshwari Shinde<rajeshwari.s@samsung.com>
> ---
> Changes since V2:
> 	- board_i2c_init moved to driver in case of FDT.
>   board/samsung/smdk5250/smdk5250.c |   20 +-------------------
>   1 files changed, 1 insertions(+), 19 deletions(-)

Acked-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
diff mbox

Patch

diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index db2457b..5ebc665 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -272,24 +272,6 @@  static int board_uart_init(void)
 	return 0;
 }
 
-#ifdef CONFIG_SYS_I2C_INIT_BOARD
-static int board_i2c_init(void)
-{
-	int i, err;
-
-	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
-		err = exynos_pinmux_config((PERIPH_ID_I2C0 + i),
-						PINMUX_FLAG_NONE);
-		if (err) {
-			debug("I2C%d not configured\n", (PERIPH_ID_I2C0 + i));
-			return err;
-		}
-	}
-	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
-	return 0;
-}
-#endif
-
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
@@ -300,7 +282,7 @@  int board_early_init_f(void)
 		return err;
 	}
 #ifdef CONFIG_SYS_I2C_INIT_BOARD
-	err = board_i2c_init();
+	board_i2c_init(gd->fdt_blob);
 #endif
 	return err;
 }