]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00143186 GPMI : add the kernel command parameter to disable/enable gpmi
authorHuang Shijie <b32955@freescale.com>
Tue, 10 May 2011 08:04:43 +0000 (16:04 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:09:04 +0000 (14:09 +0200)
add the kernel command parameter to control whether we should enable
the GPMI NAND driver.

Signed-off-by: Huang Shijie <b32955@freescale.com>
drivers/mtd/nand/gpmi-nfc/gpmi-nfc.c

index 95972af2ceff355d1f93d09199a39f5e8a41bc3c..e4edf5dfdc26f0618a9e92dabf489cd1c0772c70 100644 (file)
@@ -35,6 +35,9 @@ int gpmi_debug;
 module_param(gpmi_debug, int, 0644);
 MODULE_PARM_DESC(gpmi_debug, "print out the debug infomation.");
 
+/* enable the gpmi-nfc */
+static bool enable_gpmi_nand;
+
 static ssize_t show_ignorebad(struct device *dev,
                                struct device_attribute *attr, char *buf)
 {
@@ -1229,8 +1232,6 @@ static void read_page_swap_end(struct gpmi_nfc_data *this,
                        void *alt_virt, dma_addr_t alt_phys, unsigned alt_size,
                        void *used_virt, dma_addr_t used_phys)
 {
-       struct device *dev = this->dev;
-
        if (!this->mil.direct_dma_map_ok)
                memcpy(destination, alt_virt, length);
 }
@@ -2453,6 +2454,9 @@ static int __init gpmi_nfc_init(void)
 {
        int err;
 
+       if (!enable_gpmi_nand)
+               return 0;
+
        err = platform_driver_register(&gpmi_nfc_driver);
        if (err == 0)
                printk(KERN_INFO "GPMI NFC driver registered. (IMX)\n");
@@ -2473,6 +2477,13 @@ static int __init gpmi_debug_setup(char *__unused)
 }
 __setup("gpmi_debug_init", gpmi_debug_setup);
 
+static int __init gpmi_nand_setup(char *__unused)
+{
+       enable_gpmi_nand = true;
+       return 1;
+}
+__setup("gpmi-nfc", gpmi_nand_setup);
+
 module_init(gpmi_nfc_init);
 module_exit(gpmi_nfc_exit);