diff mbox

[RFC] mtd/nand: modify NAND_CHIPOPTIONS_MSK

Message ID 1322490040-27161-1-git-send-email-j.weitzel@phytec.de
State RFC
Headers show

Commit Message

Jan Weitzel Nov. 28, 2011, 2:20 p.m. UTC
Trying to set NAND_NO_SUBPAGE_WRITE from platform fail, because
nand_flash_detect_onfi options from struct nand_flash_dev overwrite the flag.

Removing NAND_NO_SUBPAGE_WRITE from NAND_CHIPOPTIONS_MSK fix this,
but setting it via struct nand_flash_dev table is not longer supported.

Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
 include/linux/mtd/nand.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Comments

Brian Norris Nov. 28, 2011, 6:34 p.m. UTC | #1
On Mon, Nov 28, 2011 at 6:20 AM, Jan Weitzel <j.weitzel@phytec.de> wrote:
> Trying to set NAND_NO_SUBPAGE_WRITE from platform fail, because
> nand_flash_detect_onfi options from struct nand_flash_dev overwrite the flag.
>
> Removing NAND_NO_SUBPAGE_WRITE from NAND_CHIPOPTIONS_MSK fix this,
> but setting it via struct nand_flash_dev table is not longer supported.

Is it necessary to change the mask? I'm not real familiar with this
particular option, but can't you set your flags after the initial
identification stage? For instance, something like this:

nand_scan_ident(mtd, ...);
chip->options |= NAND_NO_SUBPAGE_WRITE;
nand_scan_tail(mtd);

Brian
diff mbox

Patch

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 904131b..babef5b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -216,7 +216,8 @@  typedef enum {
 					&& (chip->page_shift > 9))
 
 /* Mask to zero out the chip options, which come from the id table */
-#define NAND_CHIPOPTIONS_MSK	(0x0000ffff & ~NAND_NO_AUTOINCR)
+#define NAND_CHIPOPTIONS_MSK \
+	(0x0000ffff & ~NAND_NO_AUTOINCR & ~NAND_NO_SUBPAGE_WRITE)
 
 /* Non chip related options */
 /* This option skips the bbt scan during initialization. */