linux/drivers/spi
Ard Biesheuvel 4c3c59544f
spi/acpi: enumerate all SPI slaves in the namespace
Currently, the ACPI enumeration that takes place when registering a
SPI master only considers immediate child devices in the ACPI namespace,
rather than checking the ResourceSource field in the SpiSerialBus()
resource descriptor.

This is incorrect: SPI slaves could reside anywhere in the ACPI
namespace, and so we should enumerate the entire namespace and look for
any device that refers to the newly registered SPI master in its
resource descriptor.

So refactor the existing code and use a lookup structure so that
allocating the SPI device structure is deferred until we have identified
the device as an actual child of the controller. This approach is
loosely based on the way the I2C subsystem handles ACPI enumeration.

Note that Apple x86 hardware does not rely on SpiSerialBus() resources
in _CRS but uses nested devices below the controller's device node in
the ACPI namespace, with a special set of device properties. This means
we have to take care to only parse those properties for device nodes
that are direct children of the controller node.

Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: linux-spi@vger.kernel.org
Cc: broonie@kernel.org
Cc: andy.shevchenko@gmail.com
Cc: masahisa.kojima@linaro.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Cc: linux-acpi@vger.kernel.org
Cc: Lukas Wunner <lukas@wunner.de>

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-13 20:04:32 +01:00
..
atmel-quadspi.c Merge branch 'spi-5.2' into spi-next 2019-05-02 11:20:29 +09:00
internals.h
Kconfig Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
Makefile spi: Add spi driver for Socionext SynQuacer platform 2019-06-04 15:50:33 +01:00
spi-altera.c
spi-armada-3700.c
spi-at91-usart.c spi: at91-usart: add DMA support 2019-05-08 17:45:26 +09:00
spi-ath79.c spi: ath79: Remove now useless code 2019-01-17 12:34:55 +00:00
spi-atmel.c spi-atmel: support inter-word delay 2019-01-30 23:02:11 +00:00
spi-au1550.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-axi-spi-engine.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177 2019-05-30 11:29:19 -07:00
spi-bcm63xx-hsspi.c
spi-bcm63xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-bcm2835.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-bcm2835aux.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-bcm-qspi.c
spi-bcm-qspi.h
spi-bitbang-txrx.h
spi-bitbang.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-brcmstb-qspi.c
spi-butterfly.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-cadence.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 39 2019-05-24 17:27:12 +02:00
spi-cavium-octeon.c
spi-cavium-thunderx.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spi-cavium.c
spi-cavium.h
spi-clps711x.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-coldfire-qspi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-davinci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-dln2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 372 2019-06-05 17:37:10 +02:00
spi-dw-mid.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
spi-dw-mmio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
spi-dw-pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
spi-dw.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
spi-dw.h
spi-efm32.c
spi-ep93xx.c spi: ep93xx: Drop unused variable 2019-05-08 17:37:43 +09:00
spi-falcon.c
spi-fsl-cpm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-fsl-cpm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-fsl-dspi.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-fsl-espi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-fsl-lib.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-fsl-lib.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-fsl-lpspi.c spi: fsl-lpspi: Clean up fsl_lpspi_probe 2019-04-08 14:08:53 +07:00
spi-fsl-qspi.c spi: spi-fsl-qspi: use devm_spi_register_controller 2019-03-13 15:18:39 +00:00
spi-fsl-spi.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-fsl-spi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-geni-qcom.c spi: spi-geni-qcom: Get rid of forward declaration 2019-01-14 12:24:05 +00:00
spi-gpio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-img-spfi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 422 2019-06-05 17:37:15 +02:00
spi-imx.c Merge branch 'spi-5.1' into spi-5.2 for stm32 2019-03-15 17:06:34 +00:00
spi-iproc-qspi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
spi-jcore.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spi-lantiq-ssc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 352 2019-06-05 17:37:09 +02:00
spi-lm70llp.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-loopback-test.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-lp8841-rtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-mem.c spi-mem: fix kernel-doc for spi_mem_dirmap_{read|write}() 2019-04-08 14:06:51 +07:00
spi-meson-spicc.c
spi-meson-spifc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 446 2019-06-05 17:37:18 +02:00
spi-mpc52xx-psc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-mpc52xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 428 2019-06-05 17:37:16 +02:00
spi-mpc512x-psc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-mt65xx.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-mt7621.c Staging / IIO driver patches for 5.2-rc1 2019-05-07 13:31:29 -07:00
spi-mxic.c spi: mxic: simplify getting .driver_data 2019-03-20 17:20:29 +00:00
spi-mxs.c spi: mxs: add tracing to custom .transfer_one_message callback 2019-01-29 15:08:58 +00:00
spi-npcm-pspi.c
spi-nuc900.c
spi-nxp-fspi.c spi: spi-mem: spi-nxp-fspi: add module license info 2019-01-29 11:55:41 +00:00
spi-oc-tiny.c
spi-omap2-mcspi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-omap-100k.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-omap-uwire.c
spi-orion.c spi: orion: Support spi_xfer->word_delay_usecs 2019-03-18 12:18:42 +00:00
spi-pic32-sqi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
spi-pic32.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 445 2019-06-05 17:37:18 +02:00
spi-pl022.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-ppc4xx.c
spi-pxa2xx-dma.c spi: pxa2xx: Introduce DMA burst size support 2019-03-20 17:21:17 +00:00
spi-pxa2xx-pci.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
spi-pxa2xx.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-pxa2xx.h pxa2xx: replace spi_master with spi_controller 2019-01-23 10:59:56 +00:00
spi-qcom-qspi.c
spi-qup.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-rb4xx.c
spi-rockchip.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-rspi.c spi: rspi: Fix handling of QSPI code when transmit and receive 2019-05-02 10:38:44 +09:00
spi-s3c24xx-fiq.h
spi-s3c24xx-fiq.S
spi-s3c24xx.c
spi-s3c64xx.c
spi-sc18is602.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-sh-hspi.c spi: sh-hspi: Replace spi_master by spi_controller 2019-02-08 13:04:19 +00:00
spi-sh-msiof.c spi: sh-msiof: Reduce delays in sh_msiof_modify_ctr_wait() 2019-05-28 15:57:03 +01:00
spi-sh-sci.c
spi-sh.c
spi-sifive.c spi: sifive: Remove redundant dev_err call in sifive_spi_probe() 2019-02-22 15:17:58 +00:00
spi-sirf.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 4 2019-05-21 11:28:40 +02:00
spi-slave-mt27xx.c
spi-slave-system-control.c
spi-slave-time.c
spi-sprd-adi.c
spi-sprd.c Merge branch 'for-5.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-5.1 2019-02-20 17:58:18 +00:00
spi-st-ssc4.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 310 2019-06-05 17:37:04 +02:00
spi-stm32-qspi.c spi: stm32-qspi: manage the get_irq error case 2019-05-02 10:37:56 +09:00
spi-stm32.c spi: stm32: return the get_irq error 2019-05-02 10:38:41 +09:00
spi-sun4i.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-sun6i.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
spi-synquacer.c spi: Add spi driver for Socionext SynQuacer platform 2019-06-04 15:50:33 +01:00
spi-tegra20-sflash.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
spi-tegra20-slink.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 201 2019-05-30 11:29:52 -07:00
spi-tegra114.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00
spi-test.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
spi-ti-qspi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 296 2019-06-05 17:36:38 +02:00
spi-tle62x0.c
spi-topcliff-pch.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 285 2019-06-05 17:36:37 +02:00
spi-txx9.c
spi-uniphier.c
spi-xcomm.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 149 2019-05-30 11:25:18 -07:00
spi-xilinx.c
spi-xlp.c
spi-xtensa-xtfpga.c
spi-zynq-qspi.c spi: spi-mem: zynq-qspi: Fix build error on architectures missing readsl/writesl 2019-05-02 10:37:57 +09:00
spi-zynqmp-gqspi.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 39 2019-05-24 17:27:12 +02:00
spi.c spi/acpi: enumerate all SPI slaves in the namespace 2019-06-13 20:04:32 +01:00
spidev.c Linux 5.2-rc4 2019-06-10 18:52:53 +01:00