summaryrefslogtreecommitdiff
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2014-02-21 13:39:39 +0800
committerNitin Garg <nitin.garg@freescale.com>2015-09-17 08:57:52 -0500
commitbb83d11875552e73c4b8cb68ed5556fea441a962 (patch)
tree91d31fe1d14acfbf7cf171d0e3afc164700fc853 /include/linux/mtd/nand.h
parent29dc31d16a620ed778dfcc58b97d8d691de87076 (diff)
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@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 384f3378a29b..0d5e86999d74 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 */