diff options
author | Marc Gonzalez <marc_gonzalez@sigmadesigns.com> | 2016-11-15 05:05:39 -0500 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2016-11-19 03:43:10 -0500 |
commit | ff9e9eae0f50ab3f7d1763677b62db4a2ed24a88 (patch) | |
tree | 8b127846f3c69df65a601c4d0cfdfe93dc81015c | |
parent | 3371d663bb4579f1b2003a92162edd6d90edd089 (diff) |
mtd: nand: tango: Enable custom page accessors
Enable NAND_ECC_CUSTOM_PAGE_ACCESS in the tango NFC driver.
Fixup the "raw" page accessors to send the proper NAND commands.
Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
-rw-r--r-- | drivers/mtd/nand/tango_nand.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/nand/tango_nand.c b/drivers/mtd/nand/tango_nand.c index fd8cf414cb2b..bacc2a02b7fe 100644 --- a/drivers/mtd/nand/tango_nand.c +++ b/drivers/mtd/nand/tango_nand.c | |||
@@ -402,13 +402,17 @@ static int raw_write(struct nand_chip *chip, const u8 *buf, const u8 *oob) | |||
402 | static int tango_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | 402 | static int tango_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, |
403 | u8 *buf, int oob_required, int page) | 403 | u8 *buf, int oob_required, int page) |
404 | { | 404 | { |
405 | chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page); | ||
405 | return raw_read(chip, buf, chip->oob_poi); | 406 | return raw_read(chip, buf, chip->oob_poi); |
406 | } | 407 | } |
407 | 408 | ||
408 | static int tango_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, | 409 | static int tango_write_page_raw(struct mtd_info *mtd, struct nand_chip *chip, |
409 | const u8 *buf, int oob_required, int page) | 410 | const u8 *buf, int oob_required, int page) |
410 | { | 411 | { |
411 | return raw_write(chip, buf, chip->oob_poi); | 412 | chip->cmdfunc(mtd, NAND_CMD_SEQIN, 0, page); |
413 | raw_write(chip, buf, chip->oob_poi); | ||
414 | chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1); | ||
415 | return 0; | ||
412 | } | 416 | } |
413 | 417 | ||
414 | static int tango_read_oob(struct mtd_info *mtd, struct nand_chip *chip, | 418 | static int tango_read_oob(struct mtd_info *mtd, struct nand_chip *chip, |
@@ -553,6 +557,7 @@ static int chip_init(struct device *dev, struct device_node *np) | |||
553 | ecc->write_page = tango_write_page; | 557 | ecc->write_page = tango_write_page; |
554 | ecc->read_oob = tango_read_oob; | 558 | ecc->read_oob = tango_read_oob; |
555 | ecc->write_oob = tango_write_oob; | 559 | ecc->write_oob = tango_write_oob; |
560 | ecc->options = NAND_ECC_CUSTOM_PAGE_ACCESS; | ||
556 | 561 | ||
557 | err = nand_scan_tail(mtd); | 562 | err = nand_scan_tail(mtd); |
558 | if (err) | 563 | if (err) |