mtd: nand: omap: Switch to using GPMC-NAND ops for writebuffer empty check
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon May 23 21:59:03 PDT 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d6e552168db59d627fd56074f2c588df1faf0c95
Commit: d6e552168db59d627fd56074f2c588df1faf0c95
Parent: c509aefd75d026f4ef4aa306131d7a780c2eda7b
Author: Roger Quadros <rogerq at ti.com>
AuthorDate: Wed Aug 5 13:36:43 2015 +0300
Committer: Roger Quadros <rogerq at ti.com>
CommitDate: Fri Apr 15 11:53:20 2016 +0300
mtd: nand: omap: Switch to using GPMC-NAND ops for writebuffer empty check
Instead of accessing the gpmc_status register directly start
using the gpmc_nand_ops->nand_writebuffer_empty() helper
to check write buffer empty status.
Signed-off-by: Roger Quadros <rogerq at ti.com>
Acked-by: Brian Norris <computersforpeace at gmail.com>
Acked-by: Tony Lindgren <tony at atomide.com>
---
drivers/mtd/nand/omap2.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index cba9bf0..98023d5 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -291,14 +291,13 @@ static void omap_write_buf8(struct mtd_info *mtd, const u_char *buf, int len)
{
struct omap_nand_info *info = mtd_to_omap(mtd);
u_char *p = (u_char *)buf;
- u32 status = 0;
+ bool status;
while (len--) {
iowrite8(*p++, info->nand.IO_ADDR_W);
/* wait until buffer is available for write */
do {
- status = readl(info->reg.gpmc_status) &
- STATUS_BUFF_EMPTY;
+ status = info->ops->nand_writebuffer_empty();
} while (!status);
}
}
@@ -326,7 +325,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
{
struct omap_nand_info *info = mtd_to_omap(mtd);
u16 *p = (u16 *) buf;
- u32 status = 0;
+ bool status;
/* FIXME try bursts of writesw() or DMA ... */
len >>= 1;
@@ -334,8 +333,7 @@ static void omap_write_buf16(struct mtd_info *mtd, const u_char * buf, int len)
iowrite16(*p++, info->nand.IO_ADDR_W);
/* wait until buffer is available for write */
do {
- status = readl(info->reg.gpmc_status) &
- STATUS_BUFF_EMPTY;
+ status = info->ops->nand_writebuffer_empty();
} while (!status);
}
}
More information about the linux-mtd-cvs
mailing list