]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00294026-1 char: viim: modify for device tree
authorRobin Gong <B38343@freescale.com>
Wed, 8 Jan 2014 08:54:36 +0000 (08:54 +0000)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:53 +0000 (10:06 +0200)
Change iim driver code for device tree framework.

Signed-off-by: Robin Gong <b38343@freescale.com>
drivers/char/Kconfig
drivers/char/mxs_viim.c

index dcac68ae02f83dc3e0f47083b098e8819e919052..cc120f225a44af7034341993d55b5fb54a5a5a00 100644 (file)
@@ -617,7 +617,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.
 
index e02c330381d8c1a21956bc683571bc6f1b642b97..d0ad69be43192218ee22d4f0f060d928abb6369c 100644 (file)
@@ -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");