]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/mtd/nand.h
mtd: nand: add a helper to check the SLC/MLC nand chip
[karo-tx-linux.git] / include / linux / mtd / nand.h
index 129548169400bfb88c3f298f69485c7e9cc93b58..5c05bab0ad896a50737c487928b1626390402aa1 100644 (file)
@@ -795,4 +795,13 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
        return le16_to_cpu(chip->onfi_params.src_sync_timing_mode);
 }
 
+/*
+ * Check if it is a SLC nand.
+ * The !nand_is_slc() can be used to check the MLC/TLC nand chips.
+ * We do not distinguish the MLC and TLC now.
+ */
+static inline bool nand_is_slc(struct nand_chip *chip)
+{
+       return !(chip->cellinfo & NAND_CI_CELLTYPE_MSK);
+}
 #endif /* __LINUX_MTD_NAND_H */