]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/mtd/nand.h
mtd: nand: add a helper to get the supported features for JEDEC
[karo-tx-linux.git] / include / linux / mtd / nand.h
index f9af7564118a8dcd61869695e5e022e4ba9fbafc..afd1cf9b5eaf57e32fa2043ba0b22b0c7d91ab8f 100644 (file)
@@ -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'  */
@@ -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 */