From: Joonyoung Shim <jy0922.shim@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 8/8 V6] CONFIG: SMDK5250: I2C: Enable I2C
Date: Mon, 23 Jul 2012 13:40:13 +0900 [thread overview]
Message-ID: <500CD5AD.1020501@samsung.com> (raw)
In-Reply-To: <1342698001-27683-9-git-send-email-rajeshwari.s@samsung.com>
On 07/19/2012 08:40 PM, Rajeshwari Shinde wrote:
> This enables I2C support on smdk5250.
> Pinmux setting moved to board file to avoid repeated setting of
> gpio lines.
>
> Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
> Acked-by: Simon Glass <sjg@chromium.org>
> ---
> Changes in V2:
> - None
> Changes in V3:
> - None
> Changes in V4:
> - None
> Changes in V5:
> - Pinmux setting of gpio lines moved to board_early_init_f.
> Chnages in V6:
> - EXYNOS_I2C_SPACING moved to cpu.h
> - board_i2c_init compiled only when CONFIG_DRIVER_S3C24X0_I2C is defined.
> board/samsung/smdk5250/smdk5250.c | 28 +++++++++++++++++++++++++++-
> include/configs/smdk5250.h | 8 ++++++++
> 2 files changed, 35 insertions(+), 1 deletions(-)
>
> diff --git a/board/samsung/smdk5250/smdk5250.c b/board/samsung/smdk5250/smdk5250.c
> index b593325..12e6e66 100644
> --- a/board/samsung/smdk5250/smdk5250.c
> +++ b/board/samsung/smdk5250/smdk5250.c
> @@ -172,9 +172,35 @@ static int board_uart_init(void)
> return 0;
> }
>
> +#ifdef CONFIG_DRIVER_S3C24X0_I2C
> +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;
> + }
> + }
> + return 0;
> +}
> +#endif
How about use CONFIG_SYS_I2C_INIT_BOARD and i2c_init_board()?
Some i2c drivers are using them.
> +
> #ifdef CONFIG_BOARD_EARLY_INIT_F
> int board_early_init_f(void)
> {
> - return board_uart_init();
> + int err;
> + err = board_uart_init();
> + if (err) {
> + debug("UART init failed\n");
> + return err;
> + }
> +#ifdef CONFIG_DRIVER_S3C24X0_I2C
> + err = board_i2c_init();
> +#endif
> + return err;
> }
> #endif
> diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
> index c0eaaf8..65dfe9f 100644
> --- a/include/configs/smdk5250.h
> +++ b/include/configs/smdk5250.h
> @@ -198,6 +198,14 @@
>
> #define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_LOAD_ADDR - 0x1000000)
>
> +/* I2C */
> +#define CONFIG_HARD_I2C
> +#define CONFIG_CMD_I2C
> +#define CONFIG_SYS_I2C_SPEED 100000 /* 100 Kbps */
> +#define CONFIG_DRIVER_S3C24X0_I2C
> +#define CONFIG_I2C_MULTI_BUS
> +#define CONFIG_MAX_I2C_NUM 8
> +
> /* Ethernet Controllor Driver */
> #ifdef CONFIG_CMD_NET
> #define CONFIG_SMC911X
prev parent reply other threads:[~2012-07-23 4:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-19 11:39 [U-Boot] [PATCH 0/8 V6] EXYNOS5: Enable I2C support Rajeshwari Shinde
2012-07-19 11:39 ` [U-Boot] [PATCH 1/8 V6] EXYNOS: CLK: Add i2c clock Rajeshwari Shinde
2012-07-19 18:18 ` Simon Glass
2012-07-19 11:39 ` [U-Boot] [PATCH 2/8 V6] EXYNOS: Add I2C base address Rajeshwari Shinde
2012-07-19 11:39 ` [U-Boot] [PATCH 3/8 V6] EXYNOS5: define EXYNOS5_I2C_SPACING Rajeshwari Shinde
2012-07-19 18:18 ` Simon Glass
2012-07-19 11:39 ` [U-Boot] [PATCH 4/8 V6] EXYNOS: PINMUX: Add pinmux support for I2C Rajeshwari Shinde
2012-07-19 11:39 ` [U-Boot] [PATCH 5/8 V6] I2C: Move struct s3c24x0_i2c to a common place Rajeshwari Shinde
2012-07-19 11:39 ` [U-Boot] [PATCH 6/8 V6] I2C: Modify the I2C driver for EXYNOS5 Rajeshwari Shinde
2012-07-19 18:21 ` Simon Glass
2012-07-23 4:37 ` Joonyoung Shim
2012-07-19 11:40 ` [U-Boot] [PATCH 7/8 V6] I2C: Add support for Multi channel Rajeshwari Shinde
2012-07-19 11:40 ` [U-Boot] [PATCH 8/8 V6] CONFIG: SMDK5250: I2C: Enable I2C Rajeshwari Shinde
2012-07-19 18:23 ` Simon Glass
2012-07-23 4:40 ` Joonyoung Shim [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=500CD5AD.1020501@samsung.com \
--to=jy0922.shim@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox