summaryrefslogtreecommitdiff
path: root/drivers/i2c/mvtwsi.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-06-13 20:55:49 (GMT)
committerIan Campbell <ijc@hellion.org.uk>2014-07-18 18:41:30 (GMT)
commit6620377e4b8be3c232c59d673efcd673c30bc69f (patch)
treec04ee4d95f5eca88f6be5e2266701b57c190d2b4 /drivers/i2c/mvtwsi.c
parent0db2bbdc04c7ba41861e686acb815fce5a227a01 (diff)
downloadu-boot-6620377e4b8be3c232c59d673efcd673c30bc69f.tar.xz
sunxi: Add i2c support
Add support for the i2c controller found on all Allwinner sunxi SoCs, this is the same controller as found on the Marvell orion5x and kirkwood SoC families, with a slightly different register layout, so this patch uses the existing mvtwsi code. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk> Acked-By: Prafulla Wadaskar <prafulla@marvell.com> Acked-by: Heiko Schocher <hs@denx.de> [ ijc -- updated u-boot-spl-fel.lds ]
Diffstat (limited to 'drivers/i2c/mvtwsi.c')
-rw-r--r--drivers/i2c/mvtwsi.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/i2c/mvtwsi.c b/drivers/i2c/mvtwsi.c
index c8b5425..ab3ffa0 100644
--- a/drivers/i2c/mvtwsi.c
+++ b/drivers/i2c/mvtwsi.c
@@ -22,6 +22,8 @@
#include <asm/arch/orion5x.h>
#elif defined(CONFIG_KIRKWOOD)
#include <asm/arch/kirkwood.h>
+#elif defined(CONFIG_SUNXI)
+#include <asm/arch/i2c.h>
#else
#error Driver mvtwsi not supported by SoC or board
#endif
@@ -30,6 +32,20 @@
* TWSI register structure
*/
+#ifdef CONFIG_SUNXI
+
+struct mvtwsi_registers {
+ u32 slave_address;
+ u32 xtnd_slave_addr;
+ u32 data;
+ u32 control;
+ u32 status;
+ u32 baudrate;
+ u32 soft_reset;
+};
+
+#else
+
struct mvtwsi_registers {
u32 slave_address;
u32 data;
@@ -43,6 +59,8 @@ struct mvtwsi_registers {
u32 soft_reset;
};
+#endif
+
/*
* Control register fields
*/