From c4ed681bc383b82fd407665ff1c4a4e2d4b8c1f5 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 15 Jun 2016 10:08:27 +0200 Subject: TPL: TM2: set MAX77843 MUIC to USB path before entering download mode Use simple soft i2c gpio bit-bang based controller to enable MUIC register write. Signed-off-by: Marek Szyprowski Change-Id: I4087fe304d49bd4b88657e6bb4f0bd438e92d6d3 --- board/samsung/tm2/tm2.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'board') diff --git a/board/samsung/tm2/tm2.c b/board/samsung/tm2/tm2.c index a355fe33f0..8313ea8aee 100644 --- a/board/samsung/tm2/tm2.c +++ b/board/samsung/tm2/tm2.c @@ -15,6 +15,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -102,6 +103,23 @@ int board_mmc_init(bd_t *bis) } #endif +#ifdef CONFIG_SYS_I2C_INIT_BOARD +void i2c_init_board(void) +{ + /* Soft I2C - hsi2c_8 */ + + gpio_request(GPIO_I2C_SDA_PIN, "hsi2c_8_data"); + gpio_request(GPIO_I2C_SCL_PIN, "hsi2c_8_clk"); + gpio_direction_output(GPIO_I2C_SDA_PIN, 1); + gpio_direction_output(GPIO_I2C_SCL_PIN, 1); + + gpio_set_pull(GPIO_I2C_SCL_PIN, S5P_GPIO_PULL_UP); + gpio_set_pull(GPIO_I2C_SDA_PIN, S5P_GPIO_PULL_UP); + + gpio_set_drv(GPIO_I2C_SCL_PIN, S5P_GPIO_DRV_1X); + gpio_set_drv(GPIO_I2C_SDA_PIN, S5P_GPIO_DRV_1X); +} +#endif #ifdef CONFIG_USB_DWC3 static struct dwc3_device dwc3_device_data = { .maximum_speed = USB_SPEED_SUPER, -- cgit v1.2.3