summaryrefslogtreecommitdiff
path: root/include/configs/sunxi-common.h
diff options
context:
space:
mode:
authorJernej Skrabec <jernej.skrabec@siol.net>2017-04-26 22:03:36 (GMT)
committerMaxime Ripard <maxime.ripard@free-electrons.com>2017-04-28 07:19:03 (GMT)
commita8f01ccff2abf680449b2e694284ecf089b5d9be (patch)
tree423039dfee27decbd332d2ffb18a6d2dbda27443 /include/configs/sunxi-common.h
parentacbc7e0a706bc12fe023034bfc4de72e86eb35ea (diff)
downloadu-boot-a8f01ccff2abf680449b2e694284ecf089b5d9be.tar.xz
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 'include/configs/sunxi-common.h')
-rw-r--r--include/configs/sunxi-common.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
index 64a1900..b794e42 100644
--- a/include/configs/sunxi-common.h
+++ b/include/configs/sunxi-common.h
@@ -211,11 +211,13 @@
#if defined CONFIG_I2C0_ENABLE || defined CONFIG_I2C1_ENABLE || \
defined CONFIG_I2C2_ENABLE || defined CONFIG_I2C3_ENABLE || \
defined CONFIG_I2C4_ENABLE || defined CONFIG_R_I2C_ENABLE
-#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_MVTWSI
+#ifndef CONFIG_DM_I2C
+#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_SPEED 400000
#define CONFIG_SYS_I2C_SLAVE 0x7f
#endif
+#endif
#if defined CONFIG_VIDEO_LCD_PANEL_I2C && !(defined CONFIG_SPL_BUILD)
#define CONFIG_SYS_I2C_SOFT