diff mbox

[U-Boot] arm: goni: add i2c_init_board()

Message ID 1412598791-1813-1-git-send-email-r.baldyga@samsung.com
State Awaiting Upstream
Delegated to: Simon Glass
Headers show

Commit Message

Robert Baldyga Oct. 6, 2014, 12:33 p.m. UTC
Add proper initialization of GPIO pins used by software i2c.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---

Hi Simon,

This patch is intended for your gpio-working branch. It seems that this
is only thing which is missing to make your changes working on Goni platform
(excepting patches changing cache and memory configuration which doesn't
depend on dm, and will probably be added through samsung tree).

Best regards,
Robert Baldyga

 board/samsung/goni/goni.c  | 10 ++++++++++
 include/configs/s5p_goni.h |  2 ++
 2 files changed, 12 insertions(+)

Comments

Simon Glass Oct. 10, 2014, 3:45 a.m. UTC | #1
On 6 October 2014 06:33, Robert Baldyga <r.baldyga@samsung.com> wrote:
> Add proper initialization of GPIO pins used by software i2c.
>
> Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> ---
>
> Hi Simon,
>
> This patch is intended for your gpio-working branch. It seems that this
> is only thing which is missing to make your changes working on Goni platform
> (excepting patches changing cache and memory configuration which doesn't
> depend on dm, and will probably be added through samsung tree).

Thanks.

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

>
> Best regards,
> Robert Baldyga
>
>  board/samsung/goni/goni.c  | 10 ++++++++++
>  include/configs/s5p_goni.h |  2 ++
>  2 files changed, 12 insertions(+)
>
> diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
> index 22f4995..58cf96e 100644
> --- a/board/samsung/goni/goni.c
> +++ b/board/samsung/goni/goni.c
> @@ -33,6 +33,16 @@ int board_init(void)
>         return 0;
>  }
>
> +#ifdef CONFIG_SYS_I2C_INIT_BOARD
> +void i2c_init_board(void)
> +{
> +       gpio_request(S5PC110_GPIO_J43, "i2c_clk");
> +       gpio_request(S5PC110_GPIO_J40, "i2c_data");
> +       gpio_direction_output(S5PC110_GPIO_J43, 1);
> +       gpio_direction_output(S5PC110_GPIO_J40, 1);
> +}
> +#endif
> +
>  int power_init_board(void)
>  {
>         int ret;
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index fb1a7db..76b0503 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -276,6 +276,8 @@
>  #define CONFIG_SYS_I2C_SOFT_SPEED      50000
>  #define CONFIG_SYS_I2C_SOFT_SLAVE      0x7F
>  #define CONFIG_I2C_MULTI_BUS
> +#define CONFIG_SYS_I2C_INIT_BOARD
> +
>  #define CONFIG_SYS_MAX_I2C_BUS 7
>  #define CONFIG_USB_GADGET
>  #define CONFIG_USB_GADGET_S3C_UDC_OTG
> --
> 1.9.1
>
Simon Glass Oct. 23, 2014, 3:01 a.m. UTC | #2
On 9 October 2014 21:45, Simon Glass <sjg@chromium.org> wrote:
>
> On 6 October 2014 06:33, Robert Baldyga <r.baldyga@samsung.com> wrote:
> > Add proper initialization of GPIO pins used by software i2c.
> >
> > Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
> > ---
> >
> > Hi Simon,
> >
> > This patch is intended for your gpio-working branch. It seems that this
> > is only thing which is missing to make your changes working on Goni platform
> > (excepting patches changing cache and memory configuration which doesn't
> > depend on dm, and will probably be added through samsung tree).
>
> Thanks.
>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot-dm/master, thanks!
diff mbox

Patch

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 22f4995..58cf96e 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -33,6 +33,16 @@  int board_init(void)
 	return 0;
 }
 
+#ifdef CONFIG_SYS_I2C_INIT_BOARD
+void i2c_init_board(void)
+{
+	gpio_request(S5PC110_GPIO_J43, "i2c_clk");
+	gpio_request(S5PC110_GPIO_J40, "i2c_data");
+	gpio_direction_output(S5PC110_GPIO_J43, 1);
+	gpio_direction_output(S5PC110_GPIO_J40, 1);
+}
+#endif
+
 int power_init_board(void)
 {
 	int ret;
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index fb1a7db..76b0503 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -276,6 +276,8 @@ 
 #define CONFIG_SYS_I2C_SOFT_SPEED	50000
 #define CONFIG_SYS_I2C_SOFT_SLAVE	0x7F
 #define CONFIG_I2C_MULTI_BUS
+#define CONFIG_SYS_I2C_INIT_BOARD
+
 #define CONFIG_SYS_MAX_I2C_BUS	7
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG