Skip to content

Commit

Permalink
mtd: nand: add a helper to get the supported features for JEDEC
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Huang Shijie authored and Brian Norris committed Mar 11, 2014
1 parent d94abba commit 7852f89
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/linux/mtd/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,9 @@ struct jedec_ecc_info {
u8 reserved[2];
} __packed;

/* JEDEC features */
#define JEDEC_FEATURE_16_BIT_BUS (1 << 0)

struct nand_jedec_params {
/* rev info and features block */
/* 'J' 'E' 'S' 'D' */
Expand Down Expand Up @@ -925,4 +928,10 @@ static inline int nand_opcode_8bits(unsigned int command)
return command == NAND_CMD_READID;
}

/* return the supported JEDEC features. */
static inline int jedec_feature(struct nand_chip *chip)
{
return chip->jedec_version ? le16_to_cpu(chip->jedec_params.features)
: 0;
}
#endif /* __LINUX_MTD_NAND_H */

0 comments on commit 7852f89

Please sign in to comment.