[PATCH] ARM i.MX31: Add i2c register convenience functions

Alexander Kurz akurz at blala.de
Wed Jul 27 07:52:52 PDT 2016


Signed-off-by: Alexander Kurz <akurz at blala.de>
---
 arch/arm/mach-imx/include/mach/devices-imx31.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/mach-imx/include/mach/devices-imx31.h b/arch/arm/mach-imx/include/mach/devices-imx31.h
index 63319fe..8169b98 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx31.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx31.h
@@ -2,6 +2,21 @@
 #include <mach/imx31-regs.h>
 #include <mach/devices.h>
 
+static inline struct device_d *imx31_add_i2c0(void *pdata)
+{
+	return imx_add_i2c((void *)MX31_I2C1_BASE_ADDR, 0, pdata);
+}
+
+static inline struct device_d *imx31_add_i2c1(void *pdata)
+{
+	return imx_add_i2c((void *)MX31_I2C2_BASE_ADDR, 1, pdata);
+}
+
+static inline struct device_d *imx31_add_i2c2(void *pdata)
+{
+	return imx_add_i2c((void *)MX31_I2C3_BASE_ADDR, 2, pdata);
+}
+
 static inline struct device_d *imx31_add_spi0(struct spi_imx_master *pdata)
 {
 	return imx_add_spi_imx27((void *)MX31_CSPI1_BASE_ADDR, 0, pdata);
-- 
2.1.4




More information about the barebox mailing list