ASoC: dsp - BE disconnection after pending flag is clear

Currently we can disconnect a BE and have its update flag incorrectly
set after reparenting. Fix this so we always clear the update flag
before any disconnections and reparenting.

dsp_run_update_startup() also called disconnect but this was always
called anyway by its caller soc_dsp_runtime_update() before the update
flag was cleared.

Change-Id: If0cde4c9df845a7189188bb49e6fb4fd496a925d
Signed-off-by: Liam Girdwood <lrg@ti.com>
ASoC: DSP: Split runtime startup/shutdown updates

A FE->BE-1 link can transition to FE->BE-2 in a single widget/kcontrol
change (e.g. Muxes). Currently, DSP framework searches for new and old
paths of the FE, and then perform the startup/shutdown runtime updates.
The single-step FE->BE-1 to FE->BE-2 transition has both: new and old
paths to be updated, hence BE-1 and BE-2 will be marked for runtime
update. However, startup and shutdown updates will both be performed
on BE-1 and BE-2, which is incorect as it would be expected to run
startup update on BE-2 and shutdown update on BE-1.

In order to handle these scenarios, the path search (new and old) is
performed along with its runtime update (startup and shutdown).

Change-Id: I5a687d6fcc51a968d9b0ae52d749935a92f00ef7
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Signed-off-by: Liam Girdwood <lrg@ti.com>
ASoC: DSP: Clear BE runtime in startup unwind

Set BE's runtime to NULL when unwinding after startup errors.

Change-Id: I7fb11dff3e623b79334345e563bb3f0da0c6823c
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: core: Query active DAI links

Query active DAI links (dynamic and legacy frontends) in a SoC card.

Change-Id: Ieaef958833feb40499e0d67f3217f00a19ade87e
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: core: Promote DAI link startup

Promote DAI link startup to the beginning of SoC PCM open(),
required to:

- Prepare machine-level external environment (like clocks, power
  supplies) for CPU DAIs and CODECs
- Some CODECs add hw constraints (e.g. snd_pcm_hw_constraint_list
  for twl6040, wm8523, wm8988, etc) during their startup handler
  which can be dependent on machine level settings (e.g. sysclk).
  Currently, those constraints are honored until next stream
  activity takes place as the DAI link startup occurs after
  CODEC's.

Similarly, DAI link shutdown is now moved to the last position in
SoC PCM close().

Change-Id: Iabf4256be528d1d7befa2e03bfda89a9cafe959a
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
ASoC: core: Remove DAI link pre/post ops

Due to DAI link startup promotion in ASoC PCM open sequence, remove
DAI link pre/post ops sice they are now redundant.

Change-Id: I21b6b4ab9a91b351e6078b69c18b66cae1bf9014
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
Revert audio-changes which do not fix hotword detection

Revert "ASoC: core: Remove DAI link pre/post ops"
This reverts commit d61bfb91bafe63f92aca504dc69b086772a02f19.

Revert "ASoC: core: Promote DAI link startup"
This reverts commit a256c522f09f91ed58034c6d4da850a0fd532f6d.

Revert "ASoC: core: Query active DAI links"
This reverts commit d83635ad1a775889509d03911501bee1f129ba1b.

Revert "ASoC: DSP: Clear BE runtime in startup unwind"
This reverts commit dc3ffd57992a90e84ea43d1b65654e12db91c90a.

Revert "ASoC: DSP: Split runtime startup/shutdown updates"
This reverts commit 697f614b91ec3100ceec725da89434df39035f4a.

Revert "ASoC: dsp - BE disconnection after pending flag is clear"
This reverts commit 0e113cf91a6e65b02000d2e7352d0600d1eb22dc.

Change-Id: I4f126acefcce0506d2ab912a61144a6465502672