CHROMIUM: ASoC: Intel: Reset hw_ptr on resume trigger

Reset the hw_ptr before queuing the restore_stream_context
work to eradicate a nasty white audio noise on resume.

In commit d1cca28b (Fixed audio noise after resume), the hw_ptr
was effectively reset to 0 on S3 resume in byt_pcm_pointer which
causes the queued restore_stream_context work to always set the
stream offset to 0.  This implicit detail is what eradicated the
annoying white audio noise on S3 resume.

However, commit d1cca28b essentially undoes what commit 522dfe4983
(Sample Baytrail DSP DMA pointer only after each period) was trying
to avoid.  Additionally, both byt_pcm_pointer and byt_notify_pointer
were now both sampling the DSP DMA pointer.  As a result, the
hw_ptr would occasionally drop-back a period and cause repeated
audio when recording.

This commit is the follow-up solution to d1cca28b after reverting
it in previous commit.

BUG=chrome-os-partner:29906,chrome-os-partner:36453
TEST=No serious white noise on resume during audio playback.
TEST=No repeated audio when recording.

Change-Id: Ic3705b5eb8819a0796312b2d2fe839c65130cb5b
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/252664
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Tested-by: Matthew E Hiltner <matthew.e.hiltner@intel.com>
(cherry picked from commit d1484eea7a328bfdd10b454dbbb12048254d58eb)
Reviewed-on: https://chromium-review.googlesource.com/257314
Reviewed-by: Hsinyu Chao <hychao@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
1 file changed