From: Liam Beguin Date: Tue, 14 Mar 2017 15:24:44 +0000 (-0400) Subject: i2c: lpc32xx: Move definitions to header file X-Git-Tag: v2017.05-rc1~7^2~4 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;ds=sidebyside;h=fb057880138447019945a6ab3b88038220226017;p=u-boot i2c: lpc32xx: Move definitions to header file 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 Signed-off-by: Sylvain Lemieux --- diff --git a/arch/arm/include/asm/arch-lpc32xx/i2c.h b/arch/arm/include/asm/arch-lpc32xx/i2c.h new file mode 100644 index 0000000000..5301d4c1b0 --- /dev/null +++ b/arch/arm/include/asm/arch-lpc32xx/i2c.h @@ -0,0 +1,37 @@ +#ifndef _LPC32XX_I2C_H +#define _LPC32XX_I2C_H + +#include +#include + +/* 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 */ diff --git a/drivers/i2c/lpc32xx_i2c.c b/drivers/i2c/lpc32xx_i2c.c index cacbe87641..f172e0e4bb 100644 --- a/drivers/i2c/lpc32xx_i2c.c +++ b/drivers/i2c/lpc32xx_i2c.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -27,33 +28,6 @@ #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