diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-05-18 14:54:57 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2017-05-24 04:41:21 +0200 |
commit | 2d9a99535d0636ffcffe97214f34100a0026d8b0 (patch) | |
tree | 9b768cd3e41552b9da2a36e9ed49a834cd48f0b4 /src | |
parent | f8662ca3bc6279e70022a063acda7fc80d72dbff (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/baytrail/spi.c | 16 | ||||
-rw-r--r-- | src/soc/intel/braswell/spi.c | 16 | ||||
-rw-r--r-- | src/soc/intel/broadwell/spi.c | 16 | ||||
-rw-r--r-- | src/soc/intel/fsp_baytrail/spi.c | 16 | ||||
-rw-r--r-- | src/soc/intel/fsp_broadwell_de/spi.c | 16 |
5 files changed, 45 insertions, 35 deletions
diff --git a/src/soc/intel/baytrail/spi.c b/src/soc/intel/baytrail/spi.c index 36b542f181..6061116c52 100644 --- a/src/soc/intel/baytrail/spi.c +++ b/src/soc/intel/baytrail/spi.c @@ -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); diff --git a/src/soc/intel/braswell/spi.c b/src/soc/intel/braswell/spi.c index 12bf7d5c80..4bdcdbff8f 100644 --- a/src/soc/intel/braswell/spi.c +++ b/src/soc/intel/braswell/spi.c @@ -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); diff --git a/src/soc/intel/broadwell/spi.c b/src/soc/intel/broadwell/spi.c index 40969bc404..a573e32981 100644 --- a/src/soc/intel/broadwell/spi.c +++ b/src/soc/intel/broadwell/spi.c @@ -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); diff --git a/src/soc/intel/fsp_baytrail/spi.c b/src/soc/intel/fsp_baytrail/spi.c index 236ff741fc..0a04b9ba5f 100644 --- a/src/soc/intel/fsp_baytrail/spi.c +++ b/src/soc/intel/fsp_baytrail/spi.c @@ -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); diff --git a/src/soc/intel/fsp_broadwell_de/spi.c b/src/soc/intel/fsp_broadwell_de/spi.c index 01cb281fe0..b917142722 100644 --- a/src/soc/intel/fsp_broadwell_de/spi.c +++ b/src/soc/intel/fsp_broadwell_de/spi.c @@ -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); |