mtd: fsmc: use ALE and CLE offsets from platform data
authorShiraz Hashim <shiraz.hashim@st.com>
Wed, 7 Mar 2012 11:30:51 +0000 (17:00 +0530)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 26 Mar 2012 23:45:55 +0000 (00:45 +0100)
ALE and CLE offsets can be different on different devices. Let devices
pass these offsets to the fsmc driver through platform data.

Signed-off-by: Shiraz Hashim <shiraz.hashim@st.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/fsmc_nand.c
include/linux/mtd/fsmc.h

index abbff77fd1062c8af7e223225e4e84ce71e8cdd9..4dda9bb383340c25f8ef28f25d8033aa4f1ea5b8 100644 (file)
@@ -729,27 +729,28 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
                goto err_probe1;
        }
 
-       host->resaddr = request_mem_region(res->start + PLAT_NAND_ALE,
+       host->resaddr = request_mem_region(res->start + pdata->ale_off,
                        resource_size(res), pdev->name);
        if (!host->resaddr) {
                ret = -EIO;
                goto err_probe1;
        }
 
-       host->addr_va = ioremap(res->start + PLAT_NAND_ALE, resource_size(res));
+       host->addr_va = ioremap(res->start + pdata->ale_off,
+                       resource_size(res));
        if (!host->addr_va) {
                ret = -EIO;
                goto err_probe1;
        }
 
-       host->rescmd = request_mem_region(res->start + PLAT_NAND_CLE,
+       host->rescmd = request_mem_region(res->start + pdata->cle_off,
                        resource_size(res), pdev->name);
        if (!host->rescmd) {
                ret = -EIO;
                goto err_probe1;
        }
 
-       host->cmd_va = ioremap(res->start + PLAT_NAND_CLE, resource_size(res));
+       host->cmd_va = ioremap(res->start + pdata->cle_off, resource_size(res));
        if (!host->cmd_va) {
                ret = -EIO;
                goto err_probe1;
index 6987995ad3cf64a0e10ba74bf43ef4d706d73b5d..2cd655f06e05ffdcfba7a5c75b163ef160efd563 100644 (file)
@@ -151,6 +151,11 @@ struct fsmc_nand_platform_data {
        unsigned int            options;
        unsigned int            width;
        unsigned int            bank;
+
+       /* CLE, ALE offsets */
+       unsigned long           cle_off;
+       unsigned long           ale_off;
+
        void                    (*select_bank)(uint32_t bank, uint32_t busw);
 };