diff options
| author | Huang Shijie <shijie8@gmail.com> | 2013-05-16 23:17:28 -0400 |
|---|---|---|
| committer | Nitin Garg <nitin.garg@freescale.com> | 2014-04-16 09:06:03 -0400 |
| commit | 4d514f6334482fa080c15c6395b6454db110f063 (patch) | |
| tree | 0771f9786d1ffcb428ff3f0563a927a6a84f33a3 /include/linux/mtd | |
| parent | 76d36e451d1ecba85b3d9346afe8805f0ef1eec9 (diff) | |
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>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/nand.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 9c3c55254a4e..5a2605ae4645 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -202,6 +202,10 @@ typedef enum { | |||
| 202 | /* Keep gcc happy */ | 202 | /* Keep gcc happy */ |
| 203 | struct nand_chip; | 203 | struct nand_chip; |
| 204 | 204 | ||
| 205 | /* ONFI features */ | ||
| 206 | #define ONFI_FEATURE_16_BIT_BUS (1 << 0) | ||
| 207 | #define ONFI_FEATURE_EXT_PARAM_PAGE (1 << 7) | ||
| 208 | |||
| 205 | /* ONFI timing mode, used in both asynchronous and synchronous mode */ | 209 | /* ONFI timing mode, used in both asynchronous and synchronous mode */ |
| 206 | #define ONFI_TIMING_MODE_0 (1 << 0) | 210 | #define ONFI_TIMING_MODE_0 (1 << 0) |
| 207 | #define ONFI_TIMING_MODE_1 (1 << 1) | 211 | #define ONFI_TIMING_MODE_1 (1 << 1) |
| @@ -719,6 +723,12 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd) | |||
| 719 | return chip->priv; | 723 | return chip->priv; |
| 720 | } | 724 | } |
| 721 | 725 | ||
| 726 | /* return the supported features. */ | ||
| 727 | static inline int onfi_feature(struct nand_chip *chip) | ||
| 728 | { | ||
| 729 | return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0; | ||
| 730 | } | ||
| 731 | |||
| 722 | /* return the supported asynchronous timing mode. */ | 732 | /* return the supported asynchronous timing mode. */ |
| 723 | static inline int onfi_get_async_timing_mode(struct nand_chip *chip) | 733 | static inline int onfi_get_async_timing_mode(struct nand_chip *chip) |
| 724 | { | 734 | { |
