summaryrefslogtreecommitdiffstats
path: root/sys/arm/freescale/imx
diff options
context:
space:
mode:
authorbr <br@FreeBSD.org>2014-07-22 04:39:32 +0000
committerbr <br@FreeBSD.org>2014-07-22 04:39:32 +0000
commite4173984103481ac44dfb2d46f374c6be0d5d6f9 (patch)
tree58d3584b4c249bb2f492bcf1a55ff368eeaa8737 /sys/arm/freescale/imx
parent36ebc159929023d807ce252faf6bd20a93696cb7 (diff)
downloadFreeBSD-src-e4173984103481ac44dfb2d46f374c6be0d5d6f9.zip
FreeBSD-src-e4173984103481ac44dfb2d46f374c6be0d5d6f9.tar.gz
Enable Freescale i.MX I2C driver for i.MX6.
Diffstat (limited to 'sys/arm/freescale/imx')
-rw-r--r--sys/arm/freescale/imx/files.imx62
-rw-r--r--sys/arm/freescale/imx/imx_i2c.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/arm/freescale/imx/files.imx6 b/sys/arm/freescale/imx/files.imx6
index e2a882b..0074be5 100644
--- a/sys/arm/freescale/imx/files.imx6
+++ b/sys/arm/freescale/imx/files.imx6
@@ -27,6 +27,7 @@ arm/freescale/imx/imx6_pl310.c standard
arm/freescale/imx/imx_machdep.c standard
arm/freescale/imx/imx_gpt.c standard
arm/freescale/imx/imx_gpio.c optional gpio
+arm/freescale/imx/imx_i2c.c optional fsliic
#
# Optional devices.
@@ -52,5 +53,4 @@ arm/freescale/imx/imx6_usbphy.c optional ehci
#
#arm/freescale/imx/imx51_iomux.c optional iomux
#dev/ata/chipsets/ata-fsl.c optional imxata
-#arm/freescale/imx/imx_i2c.c optional fsliic
#arm/freescale/imx/imx51_ipuv3.c optional sc
diff --git a/sys/arm/freescale/imx/imx_i2c.c b/sys/arm/freescale/imx/imx_i2c.c
index dd74a7d..3c192ea 100644
--- a/sys/arm/freescale/imx/imx_i2c.c
+++ b/sys/arm/freescale/imx/imx_i2c.c
@@ -86,6 +86,12 @@ __FBSDID("$FreeBSD$");
#define debugf(fmt, args...)
#endif
+static struct ofw_compat_data compat_data[] = {
+ {"fsl,imx6q-i2c", 1},
+ {"fsl,imx-i2c", 1},
+ {NULL, 0}
+};
+
struct i2c_softc {
device_t dev;
device_t iicbus;
@@ -227,7 +233,7 @@ i2c_probe(device_t dev)
if (!ofw_bus_status_okay(dev))
return (ENXIO);
- if (!ofw_bus_is_compatible(dev, "fsl,imx-i2c"))
+ if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0)
return (ENXIO);
sc = device_get_softc(dev);
@@ -246,7 +252,7 @@ i2c_probe(device_t dev)
/* Enable I2C */
i2c_write_reg(sc, I2C_CONTROL_REG, I2CCR_MEN);
bus_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res);
- device_set_desc(dev, "I2C bus controller");
+ device_set_desc(dev, "Freescale i.MX I2C bus controller");
return (BUS_PROBE_DEFAULT);
}
OpenPOWER on IntegriCloud