Skip to content

Commit 5b40db6

Browse files
zyziiDavid Woodhouse
authored andcommitted
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@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>
1 parent 5138a98 commit 5b40db6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎include/linux/mtd/nand.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ typedef enum {
202202
/* Keep gcc happy */
203203
struct nand_chip;
204204

205+
/* ONFI features */
206+
#define ONFI_FEATURE_16_BIT_BUS (1 << 0)
207+
#define ONFI_FEATURE_EXT_PARAM_PAGE (1 << 7)
208+
205209
/* ONFI timing mode, used in both asynchronous and synchronous mode */
206210
#define ONFI_TIMING_MODE_0 (1 << 0)
207211
#define ONFI_TIMING_MODE_1 (1 << 1)
@@ -756,6 +760,12 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
756760
return chip->priv;
757761
}
758762

763+
/* return the supported features. */
764+
static inline int onfi_feature(struct nand_chip *chip)
765+
{
766+
return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0;
767+
}
768+
759769
/* return the supported asynchronous timing mode. */
760770
static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
761771
{

0 commit comments

Comments
 (0)