diff options
author | Huang Shijie <b32955@freescale.com> | 2014-02-21 00:39:39 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-03-11 01:42:26 -0400 |
commit | 7852f8962f0f022b11fc56d63de06226a9f70d88 (patch) | |
tree | 75a481d0f1e396b7356becb5066646337d6b4058 /include/linux/mtd | |
parent | d94abba7605d3c15123eb3b331a1872ef17d29e0 (diff) |
mtd: nand: add a helper to get the supported features for JEDEC
Add a helper to get the supported features for JEDEC compliant NAND.
Also add a macro JEDEC_FEATURE_16_BIT_BUS.
Signed-off-by: Huang Shijie <b32955@freescale.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r-- | include/linux/mtd/nand.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index f9af7564118a..afd1cf9b5eaf 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -350,6 +350,9 @@ struct jedec_ecc_info { | |||
350 | u8 reserved[2]; | 350 | u8 reserved[2]; |
351 | } __packed; | 351 | } __packed; |
352 | 352 | ||
353 | /* JEDEC features */ | ||
354 | #define JEDEC_FEATURE_16_BIT_BUS (1 << 0) | ||
355 | |||
353 | struct nand_jedec_params { | 356 | struct nand_jedec_params { |
354 | /* rev info and features block */ | 357 | /* rev info and features block */ |
355 | /* 'J' 'E' 'S' 'D' */ | 358 | /* 'J' 'E' 'S' 'D' */ |
@@ -925,4 +928,10 @@ static inline int nand_opcode_8bits(unsigned int command) | |||
925 | return command == NAND_CMD_READID; | 928 | return command == NAND_CMD_READID; |
926 | } | 929 | } |
927 | 930 | ||
931 | /* return the supported JEDEC features. */ | ||
932 | static inline int jedec_feature(struct nand_chip *chip) | ||
933 | { | ||
934 | return chip->jedec_version ? le16_to_cpu(chip->jedec_params.features) | ||
935 | : 0; | ||
936 | } | ||
928 | #endif /* __LINUX_MTD_NAND_H */ | 937 | #endif /* __LINUX_MTD_NAND_H */ |