soundwire: intel: transition to 3 steps initialization
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Sun, 31 May 2020 18:21:02 +0000 (02:21 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 22 Jun 2020 11:51:36 +0000 (17:21 +0530)
commit6d2c66695bf30355bacceb2b0635d3ddaf26cce4
treec13397afaeccc3a2c7cba12fa9abc455066684b7
parent4ab34412fc62fba29ba00d76cf2c46585b3e5ba3
soundwire: intel: transition to 3 steps initialization

Rather than a plain-vanilla init/exit, this patch provides 3 steps in
the initialization needed for driver selection, machine driver
selection and deal with power rail dependencies.

- ACPI scan: this step is done at a very early stage to detect the
presence of a SoundWire Controller and enabled links at the BIOS
level. This step may be called from the legacy HDaudio driver, which
will abort its probe to let the Sound Open Firmware (SOF) handle the
hardware.

- probe: this step allocates all the required memory and will add a
sdw_bus, which in turn will result in identifying all possible Slaves
listed below the Controller ACPI companion device. All the information
is reported to the parent PCI driver which will select the relevant
machine driver.

- startup: this last step starts the bus reset, which results in Slave
devices reporting as ATTACHED and being enumerated. This step is only
done during the card creation stage, after the DSP is powered to
account for internal power rail dependencies.

These 3 steps are already supported in the Sound Open firmware
drivers and upstream.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Link: https://lore.kernel.org/r/20200531182102.27840-7-yung-chuan.liao@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/soundwire/intel.c
drivers/soundwire/intel.h
drivers/soundwire/intel_init.c