UPSTREAM: 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: I1d10c535ad7d5bb8545e9ad463b9938ed2cff4f1
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: b46e9f6029
Original-Change-Id: I873b96d286655a814554bfd89f899ee87302b06d
Original-Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/19769
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Reviewed-on: https://chromium-review.googlesource.com/513958
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
parent
fac51768bd
commit
0389baf984
2 changed files with 16 additions and 22 deletions
|
|
@ -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;
|
||||
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
|
||||
{
|
||||
.ctrlr = &spi_ctrlr,
|
||||
.bus_start = 1,
|
||||
.bus_end = ARRAY_SIZE(tegra_spi_channels)
|
||||
},
|
||||
};
|
||||
|
||||
slave->bus = channel->slave.bus;
|
||||
slave->cs = channel->slave.cs;
|
||||
slave->ctrlr = &spi_ctrlr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
|
||||
{
|
||||
.ctrlr = &spi_ctrlr,
|
||||
.bus_start = 1,
|
||||
.bus_end = ARRAY_SIZE(tegra_spi_channels)
|
||||
},
|
||||
};
|
||||
|
||||
slave->cs = channel->slave.cs;
|
||||
slave->bus = channel->slave.bus;
|
||||
slave->ctrlr = &spi_ctrlr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue