Message ID | 1358768638-14187-11-git-send-email-amarendra.xt@samsung.com |
---|---|
State | New |
Headers | show |
Hi Amar, On Tue, Jan 22, 2013 at 12:43 AM, Amar <amarendra.xt@samsung.com> wrote: > This patch adds FDT and non-FDT support for I2C, and initialise > the I2C channels. > > Signed-off-by: Amar <amarendra.xt@samsung.com> > --- > Changes since V4: > New patch. > > drivers/i2c/s3c24x0_i2c.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c > index 769a2ba..f2a035c 100644 > --- a/drivers/i2c/s3c24x0_i2c.c > +++ b/drivers/i2c/s3c24x0_i2c.c > @@ -524,11 +524,12 @@ 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, i; > + int count; > > count = fdtdec_find_aliases_for_id(blob, "i2c", > COMPAT_SAMSUNG_S3C2440_I2C, node_list, > @@ -548,8 +549,16 @@ 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 > + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); I suggest this goes up one line, since it shouldn't be needed in the FDT case, right? > } > > +#ifdef CONFIG_OF_CONTROL > static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) > { > if (bus_idx < i2c_busses) > -- > 1.8.0 > Regards, Simon
Hi Simon, Please find the response below. Thanks & Regards Amarendra Reddy On 27 January 2013 01:59, Simon Glass <sjg@chromium.org> wrote: > Hi Amar, > > On Tue, Jan 22, 2013 at 12:43 AM, Amar <amarendra.xt@samsung.com> wrote: > > This patch adds FDT and non-FDT support for I2C, and initialise > > the I2C channels. > > > > Signed-off-by: Amar <amarendra.xt@samsung.com> > > --- > > Changes since V4: > > New patch. > > > > drivers/i2c/s3c24x0_i2c.c | 13 +++++++++++-- > > 1 file changed, 11 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c > > index 769a2ba..f2a035c 100644 > > --- a/drivers/i2c/s3c24x0_i2c.c > > +++ b/drivers/i2c/s3c24x0_i2c.c > > @@ -524,11 +524,12 @@ 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, i; > > + int count; > > > > count = fdtdec_find_aliases_for_id(blob, "i2c", > > COMPAT_SAMSUNG_S3C2440_I2C, node_list, > > @@ -548,8 +549,16 @@ 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 > > + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); > > I suggest this goes up one line, since it shouldn't be needed in the > FDT case, right? Actually the function i2c_init() need not be called here. Only the pinmux configuration need to be done here. Hence i2c_init() call will be removed here. i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE) is called from arch/arm/lib/board.c which initialises I2C. > } > > +#ifdef CONFIG_OF_CONTROL > static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) > { > if (bus_idx < i2c_busses) > -- > 1.8.0 > Regards, > Simon > _______________________________________________ > U-Boot mailing list > U-Boot@lists.denx.de > http://lists.denx.de/mailman/listinfo/u-boot >
diff --git a/drivers/i2c/s3c24x0_i2c.c b/drivers/i2c/s3c24x0_i2c.c index 769a2ba..f2a035c 100644 --- a/drivers/i2c/s3c24x0_i2c.c +++ b/drivers/i2c/s3c24x0_i2c.c @@ -524,11 +524,12 @@ 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, i; + int count; count = fdtdec_find_aliases_for_id(blob, "i2c", COMPAT_SAMSUNG_S3C2440_I2C, node_list, @@ -548,8 +549,16 @@ 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 + i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE); } +#ifdef CONFIG_OF_CONTROL static struct s3c24x0_i2c_bus *get_bus(unsigned int bus_idx) { if (bus_idx < i2c_busses)
This patch adds FDT and non-FDT support for I2C, and initialise the I2C channels. Signed-off-by: Amar <amarendra.xt@samsung.com> --- Changes since V4: New patch. drivers/i2c/s3c24x0_i2c.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)