summaryrefslogtreecommitdiff
path: root/board/sunxi
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2017-04-27 00:03:36 +0200
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-04-28 09:19:03 +0200
commita8f01ccff2abf680449b2e694284ecf089b5d9be (patch)
tree423039dfee27decbd332d2ffb18a6d2dbda27443 /board/sunxi
parentacbc7e0a706bc12fe023034bfc4de72e86eb35ea (diff)
sunxi: i2c: Add support for DM I2C
This commit adds support for DM I2C on sunxi platform. It can coexist with old style sunxi I2C driver, because it is still used in SPL and by some SoCs. Because sunxi platform doesn't yet support DM clk, reset and pinctrl driver, workaround is needed to enable clocks and set resets and pinctrls. This is done by calling i2c_init_board() in board_init(). This means that CONFIG_I2Cx_ENABLE options needs to be correctly set in order to use needed I2C controller. Commit is based on the previous patch made by Philipp Tomsich Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'board/sunxi')
-rw-r--r--board/sunxi/board.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/sunxi/board.c b/board/sunxi/board.c
index f903a5d0a0..01de42d031 100644
--- a/board/sunxi/board.c
+++ b/board/sunxi/board.c
@@ -222,6 +222,14 @@ int board_init(void)
gpio_direction_output(macpwr_pin, 1);
#endif
+#ifdef CONFIG_DM_I2C
+ /*
+ * Temporary workaround for enabling I2C clocks until proper sunxi DM
+ * clk, reset and pinctrl drivers land.
+ */
+ i2c_init_board();
+#endif
+
/* Uses dm gpio code so do this here and not in i2c_init_board() */
return soft_i2c_board_init();
}