Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 332683
b: refs/heads/master
c: de20c22
h: refs/heads/master
i:
  332681: 2348f47
  332679: 3beef21
v: v3
  • Loading branch information
Roland Stigge authored and David Woodhouse committed Sep 29, 2012
1 parent aefedf0 commit 9eca118
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af69dcd3862ed174cf67637f4142c9c895862436
refs/heads/master: de20c22d2bf41f970a6300a89dd550f12121c126
13 changes: 11 additions & 2 deletions trunk/drivers/mtd/nand/lpc32xx_slc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_slc.h>

#define LPC32XX_MODNAME "lpc32xx-nand"

Expand Down Expand Up @@ -199,6 +199,7 @@ struct lpc32xx_nand_cfg_slc {

struct lpc32xx_nand_host {
struct nand_chip nand_chip;
struct lpc32xx_slc_platform_data *pdata;
struct clk *clk;
struct mtd_info mtd;
void __iomem *io_base;
Expand Down Expand Up @@ -719,9 +720,15 @@ static int lpc32xx_nand_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-slc");
host->dma_chan = dma_request_channel(mask, host->pdata->dma_filter,
"nand-slc");
if (!host->dma_chan) {
dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
return -EBUSY;
Expand Down Expand Up @@ -819,6 +826,8 @@ static int __devinit lpc32xx_nand_probe(struct platform_device *pdev)
}
lpc32xx_wp_disable(host);

host->pdata = pdev->dev.platform_data;

mtd = &host->mtd;
chip = &host->nand_chip;
chip->priv = host;
Expand Down
20 changes: 20 additions & 0 deletions trunk/include/linux/mtd/lpc32xx_slc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Platform data for LPC32xx SoC SLC NAND controller
*
* Copyright © 2012 Roland Stigge
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

#ifndef __LINUX_MTD_LPC32XX_SLC_H
#define __LINUX_MTD_LPC32XX_SLC_H

#include <linux/dmaengine.h>

struct lpc32xx_slc_platform_data {
bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
};

#endif /* __LINUX_MTD_LPC32XX_SLC_H */

0 comments on commit 9eca118

Please sign in to comment.