public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [MTD] [NAND] add (write|read)_buf callbacks to plat_nand
@ 2009-03-04 10:00 Alexander Clouter
  0 siblings, 0 replies; only message in thread
From: Alexander Clouter @ 2009-03-04 10:00 UTC (permalink / raw)
  To: linux-mtd

This patch adds (write|read)_buf callbacks to plat_nand.

The NAND on the TS-7800 provisioned by the FPGA allows readl() and
writel() to be used which gives a 2.5x speed up.  To be able to
use this from the plat_nand driver hooks to write_buf and read_buf
need to be made available.  This patch adds those hooks.

Signed-off-by: Alexander Clouter <alex@digriz.org.uk>
---
 drivers/mtd/nand/plat_nand.c |    2 ++
 include/linux/mtd/nand.h     |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 75f9f48..262bede 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -61,6 +61,8 @@ static int __init plat_nand_probe(struct platform_device *pdev)
 	data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl;
 	data->chip.dev_ready = pdata->ctrl.dev_ready;
 	data->chip.select_chip = pdata->ctrl.select_chip;
+	data->chip.write_buf = pdata->ctrl.write_buf;
+	data->chip.read_buf = pdata->ctrl.read_buf;
 	data->chip.chip_delay = pdata->chip.chip_delay;
 	data->chip.options |= pdata->chip.options;
 
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index db5b63d..c383dee 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -594,6 +594,10 @@ struct platform_nand_ctrl {
 	void		(*select_chip)(struct mtd_info *mtd, int chip);
 	void		(*cmd_ctrl)(struct mtd_info *mtd, int dat,
 				    unsigned int ctrl);
+	void		(*write_buf)(struct mtd_info *mtd,
+				    const uint8_t *buf, int len);
+	void		(*read_buf)(struct mtd_info *mtd,
+				    uint8_t *buf, int len);
 	void		*priv;
 };
 
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-04 10:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04 10:00 [MTD] [NAND] add (write|read)_buf callbacks to plat_nand Alexander Clouter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox