aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Miao <eric.miao@linaro.org>2011-12-30 20:57:34 +0800
committerEric Miao <eric.miao@linaro.org>2012-01-11 13:57:12 +0800
commitf6634cfbe522fd2d09e7543ae6f5c00a04e8b9bd (patch)
tree12f8e9961cf37243a62b4cb0c49ffdcc5f1a7012
parent8f2d2c660964932bcdf13b2437292ce27a716a38 (diff)
downloadlinux-linaro-f6634cfbe522fd2d09e7543ae6f5c00a04e8b9bd.tar.gz
imx6q: add device tree support for IIM driver
Signed-off-by: Eric Miao <eric.miao@linaro.org>
-rw-r--r--arch/arm/boot/dts/imx6q.dtsi8
-rw-r--r--drivers/char/mxs_viim.c16
2 files changed, 16 insertions, 8 deletions
diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index bc554390001..c269da61154 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -509,11 +509,9 @@
};
ocotp@021bc000 {
- reg = <0x021bc000 0x4000>;
- };
-
- ocotp@021c0000 {
- reg = <0x021c0000 0x4000>;
+ compatible = "fsl,imx6q-ocotp";
+ reg = <0x021bc000 0x4000>,
+ <0x021c0000 0x4000>;
interrupts = <0 21 0x04>;
};
diff --git a/drivers/char/mxs_viim.c b/drivers/char/mxs_viim.c
index 31195b39aa4..2a076a10a74 100644
--- a/drivers/char/mxs_viim.c
+++ b/drivers/char/mxs_viim.c
@@ -11,12 +11,15 @@
* http://www.gnu.org/copyleft/gpl.html
*/
+#include <linux/module.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
static unsigned long iim_reg_base0, iim_reg_end0, iim_reg_size0;
static unsigned long iim_reg_base1, iim_reg_end1, iim_reg_size1;
@@ -147,11 +150,18 @@ static int mxs_viim_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id mxs_viim_dt_ids[] = {
+ { .compatible = "fsl,imx6q-ocotp", },
+ { /* sentinel */ }
+};
+
+
static struct platform_driver mxs_viim_driver = {
.driver = {
- .owner = THIS_MODULE,
- .name = "imx_viim",
- },
+ .owner = THIS_MODULE,
+ .name = "imx_viim",
+ .of_match_table = mxs_viim_dt_ids,
+ },
.probe = mxs_viim_probe,
.remove = mxs_viim_remove,
};