mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 07:17:10 +00:00
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>
This commit is contained in:
parent
3937df3d6c
commit
4806fcea1a
2 changed files with 13 additions and 1 deletions
|
@ -137,7 +137,7 @@ static int spi_flash_std_get_sw_write_prot(struct udevice *dev)
|
|||
return spi_flash_cmd_get_sw_write_prot(flash);
|
||||
}
|
||||
|
||||
static int spi_flash_std_probe(struct udevice *dev)
|
||||
int spi_flash_std_probe(struct udevice *dev)
|
||||
{
|
||||
struct spi_slave *slave = dev_get_parent_priv(dev);
|
||||
struct dm_spi_slave_platdata *plat = dev_get_parent_platdata(dev);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue