diff options
author | Furquan Shaikh <furquan@google.com> | 2021-01-02 00:03:00 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-01-08 08:24:20 +0000 |
commit | fb29ca0c551dce18546b440ea98bf6bc8101c800 (patch) | |
tree | 534189f13d4cecd6962fccb1c07efa0097496a69 /src/soc/intel/common/block/gspi | |
parent | e4f7e0405083b7a7725c0f042ed65d1488687b78 (diff) |
soc/intel/common: Pass in pci_devfn_t into lpss_set_power_state
This change updates the parameter passed into `lpss_set_power_state()`
from struct device * to pci_devfn_t. This allows the users in the
early stages to use pci_devfn_t instead of having to walk the device
tree to get a pointer to the relevant device structure. It is
important for optimizing out unnecessary components of the device tree
from the early stages.
Change-Id: Ic9e32794da65348fe2a0a2791db47ab83b64cb0f
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49210
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block/gspi')
-rw-r--r-- | src/soc/intel/common/block/gspi/gspi.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/soc/intel/common/block/gspi/gspi.c b/src/soc/intel/common/block/gspi/gspi.c index 836371372a..395a14dc7b 100644 --- a/src/soc/intel/common/block/gspi/gspi.c +++ b/src/soc/intel/common/block/gspi/gspi.c @@ -448,7 +448,6 @@ static int gspi_ctrlr_setup(const struct spi_slave *dev) int devfn; uint32_t cs_ctrl, sscr0, sscr1, clocks, sitf, sirf, pol; struct gspi_ctrlr_params params, *p = ¶ms; - const struct device *device; /* Only chip select 0 is supported. */ if (dev->cs != 0) { @@ -468,14 +467,9 @@ static int gspi_ctrlr_setup(const struct spi_slave *dev) } devfn = gspi_soc_bus_to_devfn(p->gspi_bus); - /* - * devfn is already validated as part of gspi_ctrlr_params_init. - * No need to revalidate it again. - */ - device = pcidev_path_on_root(devfn); /* Ensure controller is in D0 state */ - lpss_set_power_state(device, STATE_D0); + lpss_set_power_state(PCI_DEV(0, PCI_SLOT(devfn), PCI_FUNC(devfn)), STATE_D0); /* Take controller out of reset, keeping DMA in reset. */ gspi_write_mmio_reg(p, RESETS, CTRLR_ACTIVE | DMA_RESET); |