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>
This commit is contained in:
parent
250715eb2f
commit
b46e9f6029
|
@ -800,15 +800,12 @@ static const struct spi_ctrlr spi_ctrlr = {
|
||||||
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
|
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
|
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
|
||||||
{
|
{
|
||||||
struct tegra_spi_channel *channel = to_tegra_spi(bus);
|
.ctrlr = &spi_ctrlr,
|
||||||
if (!channel)
|
.bus_start = 1,
|
||||||
return -1;
|
.bus_end = ARRAY_SIZE(tegra_spi_channels)
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
slave->bus = channel->slave.bus;
|
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
|
||||||
slave->cs = channel->slave.cs;
|
|
||||||
slave->ctrlr = &spi_ctrlr;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
|
@ -836,15 +836,12 @@ static const struct spi_ctrlr spi_ctrlr = {
|
||||||
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
|
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
|
||||||
};
|
};
|
||||||
|
|
||||||
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
|
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
|
||||||
{
|
{
|
||||||
struct tegra_spi_channel *channel = to_tegra_spi(bus);
|
.ctrlr = &spi_ctrlr,
|
||||||
if (!channel)
|
.bus_start = 1,
|
||||||
return -1;
|
.bus_end = ARRAY_SIZE(tegra_spi_channels)
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
slave->cs = channel->slave.cs;
|
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
|
||||||
slave->bus = channel->slave.bus;
|
|
||||||
slave->ctrlr = &spi_ctrlr;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue