]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mtd: add a helper to get the supported features for ONFI nand
authorHuang Shijie <shijie8@gmail.com>
Fri, 17 May 2013 03:17:28 +0000 (11:17 +0800)
committerHuang Shijie <b32955@freescale.com>
Tue, 5 Nov 2013 01:17:27 +0000 (09:17 +0800)
add a helper to get the supported features for ONFI nand.
Also add the neccessary macros.

Signed-off-by: Huang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
include/linux/mtd/nand.h

index 9c3c55254a4ef3c81fb7e4f8fa7afe388cc6baea..5a2605ae4645dc72e0d9ae1c8e30058550c4b59c 100644 (file)
@@ -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)
@@ -719,6 +723,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)
 {