summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-09-25 17:12:39 +0100
committerDavid Woodhouse <dwmw2@infradead.org>2006-09-25 17:12:39 +0100
commit956e944c7690ea994757a8cbedbb6241e1d9138f (patch)
treec2c4c3eead457d963583925bbf517f840d40db69 /include/linux/mtd/nand.h
parent4bf63fcb83dc761853f69a77b15e47712689020b (diff)
[MTD NAND] Allow override of page read and write functions.
- allow high-level nand_write_page() function to be overridden - likewise low-level write_page_raw() and read_page_raw() functions - Clean up the abuse of chip->ecc.{write,read}_page() with MTD_OOB_RAW Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index cd4fe9ae862..2bcbcc89683 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -235,6 +235,8 @@ struct nand_hw_control {
* be provided if an hardware ECC is available
* @calculate: function for ecc calculation or readback from ecc hardware
* @correct: function for ecc correction, matching to ecc generator (sw/hw)
+ * @read_page_raw: function to read a raw page without ECC
+ * @write_page_raw: function to write a raw page without ECC
* @read_page: function to read a page according to the ecc generator requirements
* @write_page: function to write a page according to the ecc generator requirements
* @read_oob: function to read chip OOB data
@@ -256,6 +258,12 @@ struct nand_ecc_ctrl {
int (*correct)(struct mtd_info *mtd, uint8_t *dat,
uint8_t *read_ecc,
uint8_t *calc_ecc);
+ int (*read_page_raw)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ uint8_t *buf);
+ void (*write_page_raw)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ const uint8_t *buf);
int (*read_page)(struct mtd_info *mtd,
struct nand_chip *chip,
uint8_t *buf);
@@ -344,6 +352,7 @@ struct nand_buffers {
* @priv: [OPTIONAL] pointer to private chip date
* @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
* (determine if errors are correctable)
+ * @write_page [REPLACEABLE] High-level page write function
*/
struct nand_chip {
@@ -366,6 +375,8 @@ struct nand_chip {
void (*erase_cmd)(struct mtd_info *mtd, int page);
int (*scan_bbt)(struct mtd_info *mtd);
int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
+ int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
+ const uint8_t *buf, int page, int cached, int raw);
int chip_delay;
unsigned int options;