soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming
authorBard Liao <yung-chuan.liao@linux.intel.com>
Mon, 17 Aug 2020 15:29:16 +0000 (23:29 +0800)
committerVinod Koul <vkoul@kernel.org>
Tue, 18 Aug 2020 06:31:05 +0000 (12:01 +0530)
commita5a0239c27fe1125826c5cad4dec9cd1fd960d4a
treee16c0ef92fc49397d78afdc16b3520433abe5d2b
parent99b6a30f9f9995be3698f59df9882490d604f5d1
soundwire: intel: reinitialize IP+DSP in .prepare(), but only when resuming

The .prepare() callback is invoked for normal streaming, underflows or
during the system resume transition. In the latter case, the context
for the ALH PDIs is lost, and the DSP is not initialized properly
either, but the bus parameters don't need to be recomputed.

Conversely, when doing a regular .prepare() during an underflow, the
ALH/SHIM registers shall not be changed as the hardware cannot be
reprogrammed after the DMA started (hardware spec requirement).

This patch adds storage of PDI and hw_params in the DAI dma context,
and the difference between the types of .prepare() usages is handled
via a simple boolean, updated when suspending, and tested for in the
.prepare() case.

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