aboutsummaryrefslogtreecommitdiff
path: root/include/spi_flash.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-12-06 21:42:50 -0700
committerBin Meng <bmeng.cn@gmail.com>2019-12-15 11:44:24 +0800
commit4806fcea1a4b0143fc57932bc5cbdffdf8afca4e (patch)
tree43ef300a6cbe7a112458589f0ba7ae587e1af261 /include/spi_flash.h
parent3937df3d6c0b88745399434c58d80960f7bf31af (diff)
downloadu-boot-4806fcea1a4b0143fc57932bc5cbdffdf8afca4e.zip
u-boot-4806fcea1a4b0143fc57932bc5cbdffdf8afca4e.tar.gz
u-boot-4806fcea1a4b0143fc57932bc5cbdffdf8afca4e.tar.bz2
mtd: spi: Export spi_flash_std_probe()
With of-platdata we need to create drivers for particular chips, or at least drivers that are separate from the standard code, since C structures are created by dtoc which are private to that driver. To avoid duplicating the probing code, export this probe function for use by these drivers. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'include/spi_flash.h')
-rw-r--r--include/spi_flash.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 55b4721..0b23f57 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -102,6 +102,18 @@ int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len);
*/
int spl_flash_get_sw_write_prot(struct udevice *dev);
+/**
+ * spi_flash_std_probe() - Probe a SPI flash device
+ *
+ * This is the standard internal method for probing a SPI flash device to
+ * determine its type. It can be used in chip-specific drivers which need to
+ * do this, typically with of-platdata
+ *
+ * @dev: SPI-flash device to probe
+ * @return 0 if OK, -ve on error
+ */
+int spi_flash_std_probe(struct udevice *dev);
+
int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
unsigned int max_hz, unsigned int spi_mode,
struct udevice **devp);