diff options
author | Roland Stigge <stigge@antcom.de> | 2012-08-16 13:15:35 (GMT) |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-09-29 13:53:08 (GMT) |
commit | 9c6f62a7ef230253a7dfc0547c431f07d8a64721 (patch) | |
tree | 90f2b0913b8993b86f62759359063714107a8be9 /drivers/mtd/nand/lpc32xx_mlc.c | |
parent | de20c22d2bf41f970a6300a89dd550f12121c126 (diff) | |
download | linux-fsl-qoriq-9c6f62a7ef230253a7dfc0547c431f07d8a64721.tar.xz |
mtd: lpc32xx_mlc: Make driver independent of AMBA DMA engine driver
This patch makes the MLC NAND driver independent of the single AMBA DMA engine
driver by using the platform data provided dma_filter callback.
Signed-off-by: Roland Stigge <stigge@antcom.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/lpc32xx_mlc.c')
-rw-r--r-- | drivers/mtd/nand/lpc32xx_mlc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c index 1cf3593..5da3179 100644 --- a/drivers/mtd/nand/lpc32xx_mlc.c +++ b/drivers/mtd/nand/lpc32xx_mlc.c @@ -37,7 +37,7 @@ #include <linux/of.h> #include <linux/of_mtd.h> #include <linux/of_gpio.h> -#include <linux/amba/pl08x.h> +#include <linux/mtd/lpc32xx_mlc.h> #include <linux/io.h> #include <linux/mm.h> #include <linux/dma-mapping.h> @@ -171,6 +171,7 @@ static struct nand_bbt_descr lpc32xx_nand_bbt_mirror = { struct lpc32xx_nand_host { struct nand_chip nand_chip; + struct lpc32xx_mlc_platform_data *pdata; struct clk *clk; struct mtd_info mtd; void __iomem *io_base; @@ -581,9 +582,15 @@ static int lpc32xx_dma_setup(struct lpc32xx_nand_host *host) struct mtd_info *mtd = &host->mtd; dma_cap_mask_t mask; + if (!host->pdata || !host->pdata->dma_filter) { + dev_err(mtd->dev.parent, "no DMA platform data\n"); + return -ENOENT; + } + dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - host->dma_chan = dma_request_channel(mask, pl08x_filter_id, "nand-mlc"); + host->dma_chan = dma_request_channel(mask, host->pdata->dma_filter, + "nand-mlc"); if (!host->dma_chan) { dev_err(mtd->dev.parent, "Failed to request DMA channel\n"); return -EBUSY; @@ -703,6 +710,8 @@ static int __devinit lpc32xx_nand_probe(struct platform_device *pdev) } lpc32xx_wp_disable(host); + host->pdata = pdev->dev.platform_data; + nand_chip->priv = host; /* link the private data structures */ mtd->priv = nand_chip; mtd->owner = THIS_MODULE; |