diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-05-18 11:03:00 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2017-05-24 04:38:50 +0200 |
commit | 23d5d99098a61b90cb4bea07a357531f74e7be38 (patch) | |
tree | 0572659f4d48acbe31472785d496585ddd429502 | |
parent | 02c0743a24b26315b964a6aa99f6ada310c5c114 (diff) |
soc/rockchip: 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: I66b1b9635ece2381f62f2a9d6f5744d639d59163
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://review.coreboot.org/19771
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>
-rw-r--r-- | src/soc/rockchip/common/spi.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/soc/rockchip/common/spi.c b/src/soc/rockchip/common/spi.c index 0e7376945b..86f2594285 100644 --- a/src/soc/rockchip/common/spi.c +++ b/src/soc/rockchip/common/spi.c @@ -330,13 +330,12 @@ static const struct spi_ctrlr spi_ctrlr = { .max_xfer_size = 65535, }; -int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave) -{ - assert(bus < ARRAY_SIZE(rockchip_spi_slaves)); - - slave->bus = bus; - slave->cs = cs; - slave->ctrlr = &spi_ctrlr; +const struct spi_ctrlr_buses spi_ctrlr_bus_map[] = { + { + .ctrlr = &spi_ctrlr, + .bus_start = 0, + .bus_end = ARRAY_SIZE(rockchip_spi_slaves) - 1, + }, +}; - return 0; -} +const size_t spi_ctrlr_bus_map_count = ARRAY_SIZE(spi_ctrlr_bus_map); |