diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2015-01-22 13:21:30 +0300 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2015-03-11 19:49:28 +0300 |
commit | 111573ccd89b67fdef64d945cc0e611df85a6ac8 (patch) | |
tree | ec40f8cf07fb775985097824a95a42f4d04d579c /drivers/mtd/nand/atmel_nand.c | |
parent | 393d23c4e22996ad0c694577927bcf13ba31beda (diff) | |
download | linux-111573ccd89b67fdef64d945cc0e611df85a6ac8.tar.xz |
mtd: atmel_nand: check NFC busy flag by HSMC_SR instead of NFC cmd regs
Currently the driver read NFC command registers to get NFC busy flag.
Actually this flag also can be get by reading HSMC_SR register.
Use the read NFC command registers need mapping a huge memory region.
To save the mapped memory region, we change to check NFC busy flag by
reading HSMC_SR register.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/atmel_nand.c')
-rw-r--r-- | drivers/mtd/nand/atmel_nand.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 13104507da63..feaac9099bb9 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -1752,11 +1752,10 @@ static int nfc_send_command(struct atmel_nand_host *host, cmd, addr, cycle0); timeout = jiffies + msecs_to_jiffies(NFC_TIME_OUT_MS); - while (nfc_cmd_readl(NFCADDR_CMD_NFCBUSY, host->nfc->base_cmd_regs) - & NFCADDR_CMD_NFCBUSY) { + while (nfc_readl(host->nfc->hsmc_regs, SR) & NFC_SR_BUSY) { if (time_after(jiffies, timeout)) { dev_err(host->dev, - "Time out to wait CMD_NFCBUSY ready!\n"); + "Time out to wait for NFC ready!\n"); return -ETIMEDOUT; } } |