summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gong <B38343@freescale.com>2014-01-08 08:54:36 +0000
committerRobin Gong <b38343@freescale.com>2014-01-08 11:38:28 +0800
commit18f364f8718348205426e6add68431e888dbac28 (patch)
tree777c2917f600937c08f90e6aa099239d704671d0
parent179186fb089cde1cf7800dce0daba1bf4cf3b0d5 (diff)
ENGR00294026-1 char: viim: modify for device tree
Change iim driver code for device tree framework. Signed-off-by: Robin Gong <b38343@freescale.com>
-rw-r--r--drivers/char/Kconfig2
-rw-r--r--drivers/char/mxs_viim.c23
2 files changed, 11 insertions, 14 deletions
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 926b469fd3bd..91252530b7bc 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -622,7 +622,7 @@ config TILE_SROM
config MXS_VIIM
tristate "MXS Virtual IIM device driver"
- depends on (ARCH_MX50 || ARCH_MX6)
+ depends on (SOC_IMX50 || SOC_IMX6Q || SOC_IMX6SL)
help
Support for access to MXS Virtual IIM device, most people should say N here.
diff --git a/drivers/char/mxs_viim.c b/drivers/char/mxs_viim.c
index e02c330381d8..d0ad69be4319 100644
--- a/drivers/char/mxs_viim.c
+++ b/drivers/char/mxs_viim.c
@@ -17,6 +17,8 @@
#include <linux/err.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/of.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,27 +149,22 @@ static int mxs_viim_remove(struct platform_device *pdev)
return 0;
}
+static const struct of_device_id mxs_viim_dt_ids[] = {
+ { .compatible = "fsl,mxs_viim", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_viim_dt_ids);
+
static struct platform_driver mxs_viim_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "mxs_viim",
+ .of_match_table = mxs_viim_dt_ids,
},
.probe = mxs_viim_probe,
.remove = mxs_viim_remove,
};
-
-static int __init mxs_viim_dev_init(void)
-{
- return platform_driver_register(&mxs_viim_driver);
-}
-
-static void __exit mxs_viim_dev_cleanup(void)
-{
- platform_driver_unregister(&mxs_viim_driver);
-}
-
-module_init(mxs_viim_dev_init);
-module_exit(mxs_viim_dev_cleanup);
+module_platform_driver(mxs_viim_driver);
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("IMX Virtual IIM driver");