* [PATCH] Extend plat_nand to support more callbacks
@ 2007-10-24 14:04 Florian Fainelli
0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2007-10-24 14:04 UTC (permalink / raw)
To: Linux-MTD Mailing List
Hi all,
This patch extends the platform NAND driver to support more callbacks.
One user will be the AU1550 NAND driver.
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
--
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index cd725fc..365642a 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -60,6 +60,12 @@ 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.cmdfunc = pdata->ctrl.cmdfunc;
+ data->chip.read_byte = pdata->ctrl.read_byte;
+ data->chip.read_word = pdata->ctrl.ready_byte;
+ data->chip.write_buf = pdata->ctrl.write_buf;
+ data->chip.read_buf = pdata->ctrl.read_buf;
+ data->chip.verify_buf = pdata->ctrl.verify_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 c42bc7f..dd69c62 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -583,6 +583,12 @@ struct platform_nand_chip {
* @select_chip: platform specific chip select function
* @cmd_ctrl: platform specific function for controlling
* ALE/CLE/nCE. Also used to write command and address
+ * @cmdfunc: [REPLACEABLE] hardwarespecific function for writing commands to the chip
+ * @read_byte: [REPLACEABLE] read one byte from the chip
+ * @read_word: [REPLACEABLE] read one word from the chip
+ * @write_buf: [REPLACEABLE] write data from the buffer to the chip
+ * @read_buf: [REPLACEABLE] read data from the chip into the buffer
+ * @verify_buf: [REPLACEABLE] verify buffer contents against the chip data
* @priv: private data to transport driver specific settings
*
* All fields are optional and depend on the hardware driver requirements
@@ -593,6 +599,12 @@ 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 (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
+ uint8_t (*read_byte)(struct mtd_info *mtd);
+ u16 (*read_word)(struct mtd_info *mtd);
+ 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);
+ int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
void *priv;
};
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] Extend plat_nand to support more callbacks
@ 2008-03-03 17:28 Florian Fainelli
2008-04-22 19:06 ` David Woodhouse
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2008-03-03 17:28 UTC (permalink / raw)
To: linux-mtd; +Cc: David Woodhouse
This patch extends the platform NAND driver to support
more callbacks thus making possible to convert more
drivers to use plat_nand.
Signed-off-by: Florian Fainelli <florian.fainelli@telecomint.eu>
---
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index f6d5c2a..d924a1d 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -58,7 +58,13 @@ static int __init plat_nand_probe(struct platform_device *pdev)
data->chip.IO_ADDR_R = data->io_base;
data->chip.IO_ADDR_W = data->io_base;
data->chip.cmd_ctrl = pdata->ctrl.cmd_ctrl;
+ data->chip.cmdfunc = pdata->ctrl.cmdfunc;
data->chip.dev_ready = pdata->ctrl.dev_ready;
+ data->chip.read_byte = pdata->ctrl.read_byte;
+ data->chip.read_word = pdata->ctrl.read_word;
+ data->chip.write_buf = pdata->ctrl.write_buf;
+ data->chip.read_buf = pdata->ctrl.read_buf;
+ data->chip.verify_buf = pdata->ctrl.verify_buf;
data->chip.select_chip = pdata->ctrl.select_chip;
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 c42bc7f..9256d51 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -583,6 +583,16 @@ struct platform_nand_chip {
* @select_chip: platform specific chip select function
* @cmd_ctrl: platform specific function for controlling
* ALE/CLE/nCE. Also used to write command and address
+ * @cmdfunc: platform specific function for writing commands
+ * to the chip
+ * @read_byte: platform specific function to read one byte from the chip
+ * @read_word: platform specific function to read one word from the chip
+ * @write_buf: platform specific function to write data from the buffer to
+ * the chip
+ * @read_buf: platform specific function to read data from the chip into
+ * the buffer
+ * @verify_buf: platforum specific function to verify buffer contents against
+ * the chip data
* @priv: private data to transport driver specific settings
*
* All fields are optional and depend on the hardware driver requirements
@@ -593,6 +603,16 @@ 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 (*cmdfunc)(struct mtd_info *mtd, unsigned command,
+ int column, int page_addr);
+ uint8_t (*read_byte)(struct mtd_info *mtd);
+ u16 (*read_word)(struct mtd_info *mtd);
+ 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);
+ int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf,
+ int len);
void *priv;
};
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Extend plat_nand to support more callbacks
2008-03-03 17:28 Florian Fainelli
@ 2008-04-22 19:06 ` David Woodhouse
0 siblings, 0 replies; 3+ messages in thread
From: David Woodhouse @ 2008-04-22 19:06 UTC (permalink / raw)
To: Florian Fainelli; +Cc: linux-mtd
On Mon, 2008-03-03 at 18:28 +0100, Florian Fainelli wrote:
> This patch extends the platform NAND driver to support
> more callbacks thus making possible to convert more
> drivers to use plat_nand.
At what point does it stop being a simple platform driver, and start
being a driver with all its own custom methods which might as well have
had its own driver?
--
dwmw2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-04-22 19:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-24 14:04 [PATCH] Extend plat_nand to support more callbacks Florian Fainelli
-- strict thread matches above, loose matches on Subject: below --
2008-03-03 17:28 Florian Fainelli
2008-04-22 19:06 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox