mtd: nand: export nand_get_flash_type function
authorJörg Krause <joerg.krause@embedded.rocks>
Sun, 14 Jan 2018 18:26:37 +0000 (19:26 +0100)
committerStefano Babic <sbabic@denx.de>
Wed, 27 Jun 2018 10:20:55 +0000 (12:20 +0200)
`nand_get_flash_type()` allows identification of supported NAND flashs.
The function is useful in SPL (like mxs_nand_spl.c) to lookup for a NAND
flash (which does not support ONFi) instead of using nand_simple.c and
hard-coding all required NAND parameters.

Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
drivers/mtd/nand/nand_base.c
include/linux/mtd/rawnand.h

index eb9f121f810a270616e41c514fd44b8d69a9d8e1..64e4621aaaf1324667763fb6fa67001959a63125 100644 (file)
@@ -3755,7 +3755,7 @@ static bool find_full_id_nand(struct mtd_info *mtd, struct nand_chip *chip,
 /*
  * Get the flash and manufacturer id and lookup if the type is supported.
  */
-static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
                                                  struct nand_chip *chip,
                                                  int *maf_id, int *dev_id,
                                                  struct nand_flash_dev *type)
@@ -3927,6 +3927,7 @@ ident_done:
                mtd->erasesize >> 10, mtd->writesize, mtd->oobsize);
        return type;
 }
+EXPORT_SYMBOL(nand_get_flash_type);
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 DECLARE_GLOBAL_DATA_PTR;
index 7fe553fc51c2488de556bb9effd902987b88576f..cdad7b85fa6dfc7e0bc3a63b7202e139b82ac53e 100644 (file)
 #include <asm/cache.h>
 
 struct mtd_info;
+struct nand_chip;
 struct nand_flash_dev;
 struct device_node;
 
+/* Get the flash and manufacturer id and lookup if the type is supported. */
+struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
+                                          struct nand_chip *chip,
+                                          int *maf_id, int *dev_id,
+                                          struct nand_flash_dev *type);
+
 /* Scan and identify a NAND device */
 int nand_scan(struct mtd_info *mtd, int max_chips);
 /*
@@ -247,9 +254,6 @@ typedef enum {
 #define NAND_CI_CELLTYPE_MSK   0x0C
 #define NAND_CI_CELLTYPE_SHIFT 2
 
-/* Keep gcc happy */
-struct nand_chip;
-
 /* ONFI features */
 #define ONFI_FEATURE_16_BIT_BUS                (1 << 0)
 #define ONFI_FEATURE_EXT_PARAM_PAGE    (1 << 7)