summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2013-09-25 14:58:10 +0800
committerHuang Shijie <b32955@freescale.com>2013-11-05 09:17:26 +0800
commit19e1316ff9dca5e077435458a259d630e288e12c (patch)
treed0bffc35eb76b57e2ae161f833781b2a9fcad339 /include
parenta73e9fadd91fc0b5cf544f28b4b096f4def63383 (diff)
mtd: nand: add a helper to check the SLC/MLC nand chip
Add a helper to check if a nand chip is SLC or MLC. This helper makes the code more readable. Signed-off-by: Huang Shijie <b32955@freescale.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/nand.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index a8d6623f18f7..afaf63d95f29 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -727,4 +727,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 */