summaryrefslogtreecommitdiff
path: root/drivers/i2c
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 /drivers/i2c
parentacbc7e0a706bc12fe023034bfc4de72e86eb35ea (diff)
downloadu-boot-fsl-qoriq-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 'drivers/i2c')
-rw-r--r--drivers/i2c/mvtwsi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index 648a96e..3703519 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -37,6 +37,14 @@ DECLARE_GLOBAL_DATA_PTR;
#endif /* CONFIG_DM_I2C */
/*
+ * On SUNXI, we get CONFIG_SYS_TCLK from this include, so we want to
+ * always have it.
+ */
+#if defined(CONFIG_DM_I2C) && defined(CONFIG_ARCH_SUNXI)
+#include <asm/arch/i2c.h>
+#endif
+
+/*
* TWSI register structure
*/
@@ -831,6 +839,7 @@ static const struct dm_i2c_ops mvtwsi_i2c_ops = {
static const struct udevice_id mvtwsi_i2c_ids[] = {
{ .compatible = "marvell,mv64xxx-i2c", },
{ .compatible = "marvell,mv78230-i2c", },
+ { .compatible = "allwinner,sun6i-a31-i2c", },
{ /* sentinel */ }
};