mtd: nand: add a helper to get the supported features for JEDEC
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Sat Apr 5 02:59:02 EDT 2014
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7852f8962f0f022b11fc56d63de06226a9f70d88
Commit: 7852f8962f0f022b11fc56d63de06226a9f70d88
Parent: d94abba7605d3c15123eb3b331a1872ef17d29e0
Author: Huang Shijie <b32955 at freescale.com>
AuthorDate: Fri Feb 21 13:39:39 2014 +0800
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 10 22:42:26 2014 -0700
mtd: nand: add a helper to get the supported features for JEDEC
Add a helper to get the supported features for JEDEC compliant NAND.
Also add a macro JEDEC_FEATURE_16_BIT_BUS.
Signed-off-by: Huang Shijie <b32955 at freescale.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
include/linux/mtd/nand.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index f9af756..afd1cf9b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -350,6 +350,9 @@ struct jedec_ecc_info {
u8 reserved[2];
} __packed;
+/* JEDEC features */
+#define JEDEC_FEATURE_16_BIT_BUS (1 << 0)
+
struct nand_jedec_params {
/* rev info and features block */
/* 'J' 'E' 'S' 'D' */
@@ -925,4 +928,10 @@ static inline int nand_opcode_8bits(unsigned int command)
return command == NAND_CMD_READID;
}
+/* return the supported JEDEC features. */
+static inline int jedec_feature(struct nand_chip *chip)
+{
+ return chip->jedec_version ? le16_to_cpu(chip->jedec_params.features)
+ : 0;
+}
#endif /* __LINUX_MTD_NAND_H */
More information about the linux-mtd-cvs
mailing list