Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b40db68 authored by Huang Shijie's avatar Huang Shijie Committed by David Woodhouse
Browse files

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: default avatarHuang Shijie <b32955@freescale.com>
Reviewed-and-tested-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 5138a98f
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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)
{