summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/atmel_nand.c
diff options
context:
space:
mode:
authorJosh Wu <josh.wu@atmel.com>2013-05-09 07:34:55 (GMT)
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-08-05 19:56:15 (GMT)
commit1b7192658a08f70df0f290634fd7cd2ecb629fc9 (patch)
treebc6bccfafb2ff417638d8161fd188b4b3cf1e07d /drivers/mtd/nand/atmel_nand.c
parent71b94e2e866aa35f40945d9e820fc3214b792d1f (diff)
downloadlinux-1b7192658a08f70df0f290634fd7cd2ecb629fc9.tar.xz
mtd: atmel_nand: add a new dt binding item for nand dma support
This patch will set the nand dma support in dts. Since we will not use cpu_is_xxx() in nand driver. We needn't include the mach/cpu.h any more. Signed-off-by: Josh Wu <josh.wu@atmel.com> 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/atmel_nand.c')
-rw-r--r--drivers/mtd/nand/atmel_nand.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 7bf912b..61d3869 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -43,8 +43,6 @@
#include <linux/platform_data/atmel.h>
#include <linux/pinctrl/consumer.h>
-#include <mach/cpu.h>
-
static int use_dma = 1;
module_param(use_dma, int, 0);
@@ -128,11 +126,6 @@ struct atmel_nand_host {
static struct nand_ecclayout atmel_pmecc_oobinfo;
-static int cpu_has_dma(void)
-{
- return cpu_is_at91sam9rl() || cpu_is_at91sam9g45();
-}
-
/*
* Enable NAND.
*/
@@ -1336,6 +1329,8 @@ static int atmel_of_init_port(struct atmel_nand_host *host,
board->on_flash_bbt = of_get_nand_on_flash_bbt(np);
+ board->has_dma = of_property_read_bool(np, "atmel,nand-has-dma");
+
if (of_get_nand_bus_width(np) == 16)
board->bus_width_16 = 1;
@@ -1600,7 +1595,7 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
nand_chip->bbt_options |= NAND_BBT_USE_FLASH;
}
- if (!cpu_has_dma())
+ if (!host->board.has_dma)
use_dma = 0;
if (use_dma) {