diff options
author | Allen Martin <amartin@nvidia.com> | 2013-03-16 18:58:07 +0000 |
---|---|---|
committer | Tom Warren <twarren@nvidia.com> | 2013-03-25 09:56:06 -0700 |
commit | 78f47b7353ebe1f243203dcc1ce0a2a374c08a40 (patch) | |
tree | aafdfd503145a8bc2d16af8f2ad0f10c8dd62887 /arch/arm/include | |
parent | 6b3a03e112cecda55b58f3de40f4fc760159979b (diff) | |
download | u-boot-imx-78f47b7353ebe1f243203dcc1ce0a2a374c08a40.zip u-boot-imx-78f47b7353ebe1f243203dcc1ce0a2a374c08a40.tar.gz u-boot-imx-78f47b7353ebe1f243203dcc1ce0a2a374c08a40.tar.bz2 |
spi: add common fdt SPI driver interface
Add a common interface to fdt based SPI drivers. Each driver is
represented by a table entry in fdt_spi_drivers[]. If there are
multiple SPI drivers in the table, the first driver to return success
from spi_init() will be registered as the SPI driver.
Signed-off-by: Allen Martin <amartin@nvidia.com>
Signed-off-by: Tom Warren <twarren@nvidia.com>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/arch-tegra20/tegra20_sflash.h | 11 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-tegra20/tegra20_slink.h | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-tegra20/tegra20_sflash.h b/arch/arm/include/asm/arch-tegra20/tegra20_sflash.h index 28775db..e8cc68c 100644 --- a/arch/arm/include/asm/arch-tegra20/tegra20_sflash.h +++ b/arch/arm/include/asm/arch-tegra20/tegra20_sflash.h @@ -27,4 +27,15 @@ #include <asm/types.h> +int tegra20_spi_cs_is_valid(unsigned int bus, unsigned int cs); +struct spi_slave *tegra20_spi_setup_slave(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int mode); +void tegra20_spi_free_slave(struct spi_slave *slave); +int tegra20_spi_init(int *node_list, int count); +int tegra20_spi_claim_bus(struct spi_slave *slave); +void tegra20_spi_cs_activate(struct spi_slave *slave); +void tegra20_spi_cs_deactivate(struct spi_slave *slave); +int tegra20_spi_xfer(struct spi_slave *slave, unsigned int bitlen, + const void *data_out, void *data_in, unsigned long flags); + #endif /* _TEGRA20_SPI_H_ */ diff --git a/arch/arm/include/asm/arch-tegra20/tegra20_slink.h b/arch/arm/include/asm/arch-tegra20/tegra20_slink.h index fe8b534..5aa74dd 100644 --- a/arch/arm/include/asm/arch-tegra20/tegra20_slink.h +++ b/arch/arm/include/asm/arch-tegra20/tegra20_slink.h @@ -27,4 +27,15 @@ #include <asm/types.h> +int tegra30_spi_init(int *node_list, int count); +int tegra30_spi_cs_is_valid(unsigned int bus, unsigned int cs); +struct spi_slave *tegra30_spi_setup_slave(unsigned int bus, unsigned int cs, + unsigned int max_hz, unsigned int mode); +void tegra30_spi_free_slave(struct spi_slave *slave); +int tegra30_spi_claim_bus(struct spi_slave *slave); +void tegra30_spi_cs_activate(struct spi_slave *slave); +void tegra30_spi_cs_deactivate(struct spi_slave *slave); +int tegra30_spi_xfer(struct spi_slave *slave, unsigned int bitlen, + const void *data_out, void *data_in, unsigned long flags); + #endif /* _TEGRA30_SPI_H_ */ |