diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-05-18 10:46:46 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2017-05-24 04:38:04 +0200 |
commit | b46e9f602939c7cddf17bb38541fc5a59f2fe6c8 (patch) | |
tree | 12db39458dde50a36f6226dae4dc9f601c7c3e73 /src/soc/nvidia | |
parent | 250715eb2ff15503710a7d2187688a7db1b4d22f (diff) |
soc/nvidia/tegra*: Move spi driver to use spi_bus_map
This is in preparation to get rid of the strong spi_setup_slave
implemented by different platforms.
BUG=b:38430839
Change-Id: I873b96d286655a814554bfd89f899ee87302b06d
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/19769
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Diffstat (limited to 'src/soc/nvidia')
-rw-r--r-- | src/soc/nvidia/tegra124/spi.c | 19 | ||||
-rw-r--r-- | src/soc/nvidia/tegra210/spi.c | 19 |
2 files changed, 16 insertions, 22 deletions
diff --git a/src/soc/nvidia/tegra124/spi.c b/src/soc/nvidia/tegra124/spi.c index 4ecd67a8a4..ae07d53fed 100644 --- a/src/soc/nvidia/tegra124/spi.c +++ b/src/soc/nvidia/tegra124/spi.c @@ -800,15 +800,12 @@ static const struct spi_ctrlr spi_ctrlr = { .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; -int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) -{ - struct tegra_spi_channel *channel = to_tegra_spi(bus); - if (!channel) - return -1; - - slave->bus = channel->slave.bus; - slave->cs = channel->slave.cs; - slave->ctrlr = &spi_ctrlr; +const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = { + { + .ctrlr = &spi_ctrlr, + .bus_start = 1, + .bus_end = ARRAY_SIZE(tegra_spi_channels) + }, +}; - return 0; -} +const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map); diff --git a/src/soc/nvidia/tegra210/spi.c b/src/soc/nvidia/tegra210/spi.c index 0987ddb53a..54e46f13d6 100644 --- a/src/soc/nvidia/tegra210/spi.c +++ b/src/soc/nvidia/tegra210/spi.c @@ -836,15 +836,12 @@ static const struct spi_ctrlr spi_ctrlr = { .max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE, }; -int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) -{ - struct tegra_spi_channel *channel = to_tegra_spi(bus); - if (!channel) - return -1; - - slave->cs = channel->slave.cs; - slave->bus = channel->slave.bus; - slave->ctrlr = &spi_ctrlr; +const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = { + { + .ctrlr = &spi_ctrlr, + .bus_start = 1, + .bus_end = ARRAY_SIZE(tegra_spi_channels) + }, +}; - return 0; -} +const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map); |