[3/5] mtd: nand: add a helper to get the supported features for JEDEC
diff mbox

Message ID 1388121286-32620-4-git-send-email-b32955@freescale.com
State New, archived
Headers show

Commit Message

Huang Shijie Dec. 27, 2013, 5:14 a.m. UTC
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@freescale.com>
---
 include/linux/mtd/nand.h |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 13ae489..26b7f2b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -334,6 +334,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'  */
@@ -885,4 +888,10 @@  static inline bool nand_is_slc(struct nand_chip *chip)
 {
 	return chip->bits_per_cell == 1;
 }
+
+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 */