ASoC: SOF: ACPI: avoid reverse module dependency
authorArnd Bergmann <arnd@arndb.de>
Tue, 2 Mar 2021 00:31:20 +0000 (18:31 -0600)
committerTakashi Iwai <tiwai@suse.de>
Tue, 2 Mar 2021 14:31:40 +0000 (15:31 +0100)
commit8a49cd11e68ed0e6a687de04d25c06553bf96b0c
tree530b6b7de841a16a4750b59e77f0451533f804a0
parentc7929b15b6e926c7150d9ec64844aceecf8a7a4a
ASoC: SOF: ACPI: avoid reverse module dependency

The SOF-ACPI driver is backwards from the normal Linux model, it has a
generic driver that knows about all the specific drivers, as opposed to
having hardware specific drivers that link against a common framework.

This requires ugly Kconfig magic and leads to missed dependencies as
seen in this link error:

arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_acpi_probe':
sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe'

Change it to use the normal probe order of starting with a specific
device in a driver, turning the sof-acpi-dev.c driver into a
library (exported symbols are name-spaced to avoid symbol pollution).

For backwards-compatibility with previous Kconfigs, the default values
for platform drivers uses the top-level ACPI configurations. The
modules were also renamed to allow for gradual transitions in test
scripts.

Co-developed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Bard Liao <bard.liao@intel.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210302003125.1178419-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/sof/Kconfig
sound/soc/sof/Makefile
sound/soc/sof/intel/Kconfig
sound/soc/sof/intel/Makefile
sound/soc/sof/intel/bdw.c
sound/soc/sof/intel/byt.c
sound/soc/sof/intel/shim.h
sound/soc/sof/sof-acpi-dev.c
sound/soc/sof/sof-acpi-dev.h [new file with mode: 0644]