]> git.sur5r.net Git - u-boot/commitdiff
i2c: lpc32xx: Move definitions to header file
authorLiam Beguin <lbeguin@tycoint.com>
Tue, 14 Mar 2017 15:24:44 +0000 (11:24 -0400)
committerHeiko Schocher <hs@denx.de>
Tue, 28 Mar 2017 04:27:14 +0000 (06:27 +0200)
Since the lpc32xx i2c driver does not yet support the devicetree bindings,
this structure is also needed by the board file as the hardware description
is done there.

Signed-off-by: Liam Beguin <lbeguin@tycoint.com>
Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
arch/arm/include/asm/arch-lpc32xx/i2c.h [new file with mode: 0644]
drivers/i2c/lpc32xx_i2c.c

diff --git a/arch/arm/include/asm/arch-lpc32xx/i2c.h b/arch/arm/include/asm/arch-lpc32xx/i2c.h
new file mode 100644 (file)
index 0000000..5301d4c
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef _LPC32XX_I2C_H
+#define _LPC32XX_I2C_H
+
+#include <common.h>
+#include <asm/types.h>
+
+/* i2c register set */
+struct lpc32xx_i2c_base {
+       union {
+               u32 rx;
+               u32 tx;
+       };
+       u32 stat;
+       u32 ctrl;
+       u32 clk_hi;
+       u32 clk_lo;
+       u32 adr;
+       u32 rxfl;
+       u32 txfl;
+       u32 rxb;
+       u32 txb;
+       u32 stx;
+       u32 stxfl;
+};
+
+#ifdef CONFIG_DM_I2C
+enum {
+       I2C_0, I2C_1, I2C_2,
+};
+
+struct lpc32xx_i2c_dev {
+       struct lpc32xx_i2c_base *base;
+       int index;
+       uint speed;
+};
+#endif /* CONFIG_DM_I2C */
+#endif /* _LPC32XX_I2C_H */
index cacbe8764197d9a559dc3065f0ca3dceff7a382d..f172e0e4bb12f0e469c3d8dee54a418472911113 100644 (file)
@@ -12,6 +12,7 @@
 #include <i2c.h>
 #include <linux/errno.h>
 #include <asm/arch/clk.h>
+#include <asm/arch/i2c.h>
 #include <dm.h>
 #include <mapmem.h>
 
 #define CONFIG_SYS_I2C_LPC32XX_SLAVE 0
 #endif
 
-/* i2c register set */
-struct lpc32xx_i2c_base {
-       union {
-               u32 rx;
-               u32 tx;
-       };
-       u32 stat;
-       u32 ctrl;
-       u32 clk_hi;
-       u32 clk_lo;
-       u32 adr;
-       u32 rxfl;
-       u32 txfl;
-       u32 rxb;
-       u32 txb;
-       u32 stx;
-       u32 stxfl;
-};
-
-#ifdef CONFIG_DM_I2C
-struct lpc32xx_i2c_dev {
-       struct lpc32xx_i2c_base *base;
-       int index;
-       uint speed;
-};
-#endif /* CONFIG_DM_I2C */
-
 /* TX register fields */
 #define LPC32XX_I2C_TX_START           0x00000100
 #define LPC32XX_I2C_TX_STOP            0x00000200