Patchwork [U-Boot,V0,1/1] Resolve i2c compilation error for non-FDT case

login
register
mail settings
Submitter Amar
Date July 9, 2013, 12:44 p.m.
Message ID <1373373869-20357-1-git-send-email-amarendra.xt@samsung.com>
Download mbox | patch
Permalink /patch/257714/
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Comments

Amar - July 9, 2013, 12:44 p.m.
This patch resolves the below mentiond compilation error of i2c driver 
for non-FDT case.

Compilation error:
s3c24x0_i2c.c: In function 'board_i2c_init':
s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use
in this function) s3c24x0_i2c.c:544:18: note: each undeclared
identifier is reported only once for each function it appears in
s3c24x0_i2c.c:545:3: warning: implicit declaration of function
'exynos_pinmux_config' [-Wimplicit-function-declaration]
s3c24x0_i2c.c:545:25: error: 'PERIPH_ID_I2C0' undeclared (first use in
this function) s3c24x0_i2c.c:546:10: error: 'PINMUX_FLAG_NONE'
undeclared (first use in this function) make[1]: ***
[/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/s3c24x0_i2c.o]
Error 1 make: ***
[/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/libi2c.o] Error 2

Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
Signed-off-by: Amar <amarendra.xt@samsung.com>
---
 board/samsung/smdk5250/smdk5250.c |    9 +++++++++
 drivers/i2c/s3c24x0_i2c.c         |    9 +--------
 2 files changed, 10 insertions(+), 8 deletions(-)
Minkyu Kang - July 9, 2013, 1:20 p.m.
Dear amar_g

On 09/07/13 21:44, amar_g wrote:

Please add prefix at title.

> This patch resolves the below mentiond compilation error of i2c driver 

typo. -> mentiond

> for non-FDT case.
> 
> Compilation error:
> s3c24x0_i2c.c: In function 'board_i2c_init':
> s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use
> in this function) s3c24x0_i2c.c:544:18: note: each undeclared
> identifier is reported only once for each function it appears in
> s3c24x0_i2c.c:545:3: warning: implicit declaration of function
> 'exynos_pinmux_config' [-Wimplicit-function-declaration]
> s3c24x0_i2c.c:545:25: error: 'PERIPH_ID_I2C0' undeclared (first use in
> this function) s3c24x0_i2c.c:546:10: error: 'PINMUX_FLAG_NONE'
> undeclared (first use in this function) make[1]: ***
> [/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/s3c24x0_i2c.o]
> Error 1 make: ***
> [/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/libi2c.o] Error 2
> 
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> Signed-off-by: Amar <amarendra.xt@samsung.com>
> ---
>  board/samsung/smdk5250/smdk5250.c |    9 +++++++++
>  drivers/i2c/s3c24x0_i2c.c         |    9 +--------
>  2 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
> index ae1f077..262398f 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -332,6 +332,15 @@ static int board_uart_init(void)
>  	return ret;
>  }
>  
> +void board_i2c_init(const void *blob)
> +{
> +	int i;

please add blank line here.

> +	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
> +		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
> +				     PINMUX_FLAG_NONE);
> +	}
> +}
> +

This is for non-fdt case, right?

>  #ifdef CONFIG_BOARD_EARLY_INIT_F
>  int board_early_init_f(void)
>  {
> diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
> index 3fc1c5b..382e4c2 100644
> --- a/drivers/i2c/s3c24x0_i2c.c
> +++ b/drivers/i2c/s3c24x0_i2c.c
> @@ -515,10 +515,10 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
>  		 len) != 0);
>  }
>  
> +#ifdef CONFIG_OF_CONTROL
>  void board_i2c_init(const void *blob)
>  {
>  	int i;
> -#ifdef CONFIG_OF_CONTROL
>  	int node_list[CONFIG_MAX_I2C_NUM];
>  	int count;
>  
> @@ -540,15 +540,8 @@ void board_i2c_init(const void *blob)
>  		bus->bus_num = i2c_busses++;
>  		exynos_pinmux_config(bus->id, 0);
>  	}
> -#else
> -	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
> -		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
> -				     PINMUX_FLAG_NONE);
> -	}
> -#endif
>  }
>  
> -#ifdef CONFIG_OF_CONTROL
>  static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
>  {
>  	if (bus_idx < i2c_busses)
> 

Thanks,
Minkyu Kang.
Amarendra Reddy - July 9, 2013, 1:34 p.m.
Dear Minkyu,

Please find my responses below.

Thanks & Regards
Amarendra Reddy

On 9 July 2013 18:50, Minkyu Kang <mk7.kang@samsung.com> wrote:

> Dear amar_g
>
> On 09/07/13 21:44, amar_g wrote:
>
> Please add prefix at title.
>
>  OK shall add aprefix 'EXYNOS' at title in the next patch.


> > This patch resolves the below mentiond compilation error of i2c driver
>
> typo. -> mentiond
>
> OK shall remove the '.' form "for non-FDT case."


>  > for non-FDT case.
> >
> > Compilation error:
> > s3c24x0_i2c.c: In function 'board_i2c_init':
> > s3c24x0_i2c.c:544:18: error: 'CONFIG_MAX_I2C_NUM' undeclared (first use
> > in this function) s3c24x0_i2c.c:544:18: note: each undeclared
> > identifier is reported only once for each function it appears in
> > s3c24x0_i2c.c:545:3: warning: implicit declaration of function
> > 'exynos_pinmux_config' [-Wimplicit-function-declaration]
> > s3c24x0_i2c.c:545:25: error: 'PERIPH_ID_I2C0' undeclared (first use in
> > this function) s3c24x0_i2c.c:546:10: error: 'PINMUX_FLAG_NONE'
> > undeclared (first use in this function) make[1]: ***
> > [/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/s3c24x0_i2c.o]
> > Error 1 make: ***
> > [/home/albert/src/u-boot-arm/build/VCMA9/drivers/i2c/libi2c.o] Error 2
> >
> > Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> > Signed-off-by: Amar <amarendra.xt@samsung.com>
> > ---
> >  board/samsung/smdk5250/smdk5250.c |    9 +++++++++
> >  drivers/i2c/s3c24x0_i2c.c         |    9 +--------
> >  2 files changed, 10 insertions(+), 8 deletions(-)
> >
> > diff --git a/board/samsung/smdk5250/smdk5250.c
> b/board/samsung/smdk5250/smdk5250.c
> > index ae1f077..262398f 100644
> > --- a/board/samsung/smdk5250/smdk5250.c
> > +++ b/board/samsung/smdk5250/smdk5250.c
> > @@ -332,6 +332,15 @@ static int board_uart_init(void)
> >       return ret;
> >  }
> >
> > +void board_i2c_init(const void *blob)
> > +{
> > +     int i;
>
> please add blank line here.
>

Ok shall add a new line here.


> > +     for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
> > +             exynos_pinmux_config((PERIPH_ID_I2C0 + i),
> > +                                  PINMUX_FLAG_NONE);
> > +     }
> > +}
> > +
>
> This is for non-fdt case, right?

 Yes, it is for non-fdt case.
>


>  >  #ifdef CONFIG_BOARD_EARLY_INIT_F
> >  int board_early_init_f(void)
> >  {
> > diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
> > index 3fc1c5b..382e4c2 100644
> > --- a/drivers/i2c/s3c24x0_i2c.c
> > +++ b/drivers/i2c/s3c24x0_i2c.c
> > @@ -515,10 +515,10 @@ int i2c_write(uchar chip, uint addr, int alen,
> uchar *buffer, int len)
> >                len) != 0);
> >  }
> >
> > +#ifdef CONFIG_OF_CONTROL
> >  void board_i2c_init(const void *blob)
> >  {
> >       int i;
> > -#ifdef CONFIG_OF_CONTROL
> >       int node_list[CONFIG_MAX_I2C_NUM];
> >       int count;
> >
> > @@ -540,15 +540,8 @@ void board_i2c_init(const void *blob)
> >               bus->bus_num = i2c_busses++;
> >               exynos_pinmux_config(bus->id, 0);
> >       }
> > -#else
> > -     for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
> > -             exynos_pinmux_config((PERIPH_ID_I2C0 + i),
> > -                                  PINMUX_FLAG_NONE);
> > -     }
> > -#endif
> >  }
> >
> > -#ifdef CONFIG_OF_CONTROL
> >  static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
> >  {
> >       if (bus_idx < i2c_busses)
> >
>
> Thanks,
> Minkyu Kang.
>  _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>

Patch

diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
index ae1f077..262398f 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -332,6 +332,15 @@  static int board_uart_init(void)
 	return ret;
 }
 
+void board_i2c_init(const void *blob)
+{
+	int i;
+	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
+		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
+				     PINMUX_FLAG_NONE);
+	}
+}
+
 #ifdef CONFIG_BOARD_EARLY_INIT_F
 int board_early_init_f(void)
 {
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c
index 3fc1c5b..382e4c2 100644
--- a/drivers/i2c/s3c24x0_i2c.c
+++ b/drivers/i2c/s3c24x0_i2c.c
@@ -515,10 +515,10 @@  int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len)
 		 len) != 0);
 }
 
+#ifdef CONFIG_OF_CONTROL
 void board_i2c_init(const void *blob)
 {
 	int i;
-#ifdef CONFIG_OF_CONTROL
 	int node_list[CONFIG_MAX_I2C_NUM];
 	int count;
 
@@ -540,15 +540,8 @@  void board_i2c_init(const void *blob)
 		bus->bus_num = i2c_busses++;
 		exynos_pinmux_config(bus->id, 0);
 	}
-#else
-	for (i = 0; i < CONFIG_MAX_I2C_NUM; i++) {
-		exynos_pinmux_config((PERIPH_ID_I2C0 + i),
-				     PINMUX_FLAG_NONE);
-	}
-#endif
 }
 
-#ifdef CONFIG_OF_CONTROL
 static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx)
 {
 	if (bus_idx < i2c_busses)