summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/spi-nor/core.h
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2022-04-29 12:20:18 +0200
committerPratyush Yadav <p.yadav@ti.com>2022-05-09 16:55:22 +0530
commit0257be79fc4a16a3252ce80aa13b3640f728c425 (patch)
treee2d47a77633bdc9fd64d26b1a6c4f5e7764f26d2 /drivers/mtd/spi-nor/core.h
parentd92e0dbc6a2686e20b558220376d5d1c6b0d9108 (diff)
downloadlinux-0257be79fc4a16a3252ce80aa13b3640f728c425.tar.bz2
mtd: spi-nor: expose internal parameters via debugfs
There is no way to gather all information to verify support for a new flash chip. Also if you want to convert an existing flash chip to the new SFDP parsing, there is not enough information to determine if the flash will work like before. To ease this development, expose internal parameters via the debugfs. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Pratyush Yadav <p.yadav@ti.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Link: https://lore.kernel.org/r/20220429102018.2361038-2-michael@walle.cc
Diffstat (limited to 'drivers/mtd/spi-nor/core.h')
-rw-r--r--drivers/mtd/spi-nor/core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index ef37e179c615..3f841ec36e56 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -114,6 +114,7 @@
SPI_MEM_OP_NO_ADDR, \
SPI_MEM_OP_NO_DATA)
+/* Keep these in sync with the list in debugfs.c */
enum spi_nor_option_flags {
SNOR_F_HAS_SR_TB = BIT(0),
SNOR_F_NO_OP_CHIP_ERASE = BIT(1),
@@ -700,4 +701,10 @@ static inline struct spi_nor *mtd_to_spi_nor(struct mtd_info *mtd)
return container_of(mtd, struct spi_nor, mtd);
}
+#ifdef CONFIG_DEBUG_FS
+void spi_nor_debugfs_register(struct spi_nor *nor);
+#else
+static inline void spi_nor_debugfs_register(struct spi_nor *nor) {}
+#endif
+
#endif /* __LINUX_MTD_SPI_NOR_INTERNAL_H */