summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/nvidia/tegra124/spi.c19
-rw-r--r--src/soc/nvidia/tegra210/spi.c19
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);