ASoC: Intel: Restore Baytrail ADSP streams only when ADSP was in reset
ASoC: Intel: Restore Baytrail ADSP streams only when ADSP was in reset

There is no need to restore and restart PCM streams in case ADSP didn't
reach reset and power off state during system suspend/resume cycle. In that
case stream is still active but paused and firmware doesn't allow allocating
a new stream before paused stream is freed.

ADSP remains active in case suspend sequence didn't go to suspend_late
stage. This can happen when either suspend sequence is aborted by a wakeup
or by letting only devices suspend by "echo devices >/sys/power/pm_test".

Currently stream restoring fails in these suspend cases. Fix this by adding
a flag that indicates is complete stream reinitialization needed or is it
enough to resume paused stream. Flag is set when we know that ADSP reached
suspend_late.

Initial fix to this issue came from Fang Yang. I modified it a little and
forward ported it to top of two other suspend/resume patches from me.

Signed-off-by: Jarkko Nikula <ed47dfa4cd43d03d92ccc66ffdb9609c96fcf22b@linux.intel.com>
Tested-by: Borun Fu <50b40dff20865899950f2d5515ef8e2b16aa8c4d@intel.com>
Cc: yang fang <64970d799dae4b072c7e9f48aacc13707983c54b@intel.com>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@linaro.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs