soc/intel: 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: Id3f05a2ea6eb5e31ca607861973d96b507208115
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/19778
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
This commit is contained in:
Furquan Shaikh 2017-05-18 14:54:57 -07:00 committed by Furquan Shaikh
parent f8662ca3bc
commit 2d9a99535d
5 changed files with 45 additions and 35 deletions

View File

@ -612,10 +612,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.max_xfer_size = member_size(ich9_spi_regs, fdata),
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
slave->bus = bus;
slave->cs = cs;
slave->ctrlr = &spi_ctrlr;
return 0;
}
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
.bus_start = 0,
.bus_end = 0,
},
};
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);

View File

@ -596,10 +596,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.max_xfer_size = member_size(ich9_spi_regs, fdata),
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
slave->bus = bus;
slave->cs = cs;
slave->ctrlr = &spi_ctrlr;
return 0;
}
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
.bus_start = 0,
.bus_end = 0,
},
};
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);

View File

@ -653,10 +653,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.max_xfer_size = member_size(ich9_spi_regs, fdata),
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
slave->bus = bus;
slave->cs = cs;
slave->ctrlr = &spi_ctrlr;
return 0;
}
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
.bus_start = 0,
.bus_end = 0,
},
};
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);

View File

@ -593,10 +593,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.max_xfer_size = member_size(ich9_spi_regs, fdata),
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
slave->bus = bus;
slave->cs = cs;
slave->ctrlr = &spi_ctrlr;
return 0;
}
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
.bus_start = 0,
.bus_end = 0,
},
};
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);

View File

@ -609,10 +609,12 @@ static const struct spi_ctrlr spi_ctrlr = {
.max_xfer_size = member_size(ich9_spi_regs, fdata),
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)
{
slave->bus = bus;
slave->cs = cs;
slave->ctrlr = &spi_ctrlr;
return 0;
}
const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = {
{
.ctrlr = &spi_ctrlr,
.bus_start = 0,
.bus_end = 0,
},
};
const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map);