mtd: add a helper to get the supported features for ONFI nand
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Aug 30 16:59:02 EDT 2013
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5b40db68cb1bd14b3d5b159754c9c1bc3bdeb080
Commit: 5b40db68cb1bd14b3d5b159754c9c1bc3bdeb080
Parent: 5138a98f6f47ce62a86cce4b9c381aaf4ad3a643
Author: Huang Shijie <shijie8 at gmail.com>
AuthorDate: Fri May 17 11:17:28 2013 +0800
Committer: David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Aug 30 21:34:41 2013 +0100
mtd: add a helper to get the supported features for ONFI nand
add a helper to get the supported features for ONFI nand.
Also add the neccessary macros.
Signed-off-by: Huang Shijie <b32955 at freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace at gmail.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
include/linux/mtd/nand.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 01a7f3c..bf4c566 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -202,6 +202,10 @@ typedef enum {
/* Keep gcc happy */
struct nand_chip;
+/* ONFI features */
+#define ONFI_FEATURE_16_BIT_BUS (1 << 0)
+#define ONFI_FEATURE_EXT_PARAM_PAGE (1 << 7)
+
/* ONFI timing mode, used in both asynchronous and synchronous mode */
#define ONFI_TIMING_MODE_0 (1 << 0)
#define ONFI_TIMING_MODE_1 (1 << 1)
@@ -756,6 +760,12 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
return chip->priv;
}
+/* return the supported features. */
+static inline int onfi_feature(struct nand_chip *chip)
+{
+ return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0;
+}
+
/* return the supported asynchronous timing mode. */
static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
{
More information about the linux-mtd-cvs
mailing list