tegra-alt: adsp: get/put from compress open/free

During device switch, runtime count becomes zero and
runtime_suspend gets called which suspends ADSP OS.
ADSP OS is resume immediately when resuming playback
on new device. ADSP OS suspend/resume can happen while
ADMA is running, which disturbs SW/HW sync causing
noisy output.

Prevent ADSP OS suspend as long as compress stream
is open by acquiring a runtime get() from stream open
and releasing it in stream free.

Bug 200100093

Change-Id: Id0da81c16efa3682131e98f6132aa02c8e7cfcab
Signed-off-by: Viraj Karandikar <vkarandikar@nvidia.com>
Reviewed-on: http://git-master/r/742105
(cherry picked from commit 6f11140bb41166a9797b2d7fe3bfb1610b55b513)
Reviewed-on: http://git-master/r/747319
This commit is contained in:
Viraj Karandikar
2015-05-13 14:12:44 +05:30
committed by Sameer Pujar
parent a04f788834
commit 1a83c79388

View File

@@ -953,6 +953,7 @@ static int tegra210_adsp_compr_open(struct snd_compr_stream *cstream)
prtd->cstream = cstream; prtd->cstream = cstream;
prtd->dev = adsp->dev; prtd->dev = adsp->dev;
cstream->runtime->private_data = prtd; cstream->runtime->private_data = prtd;
pm_runtime_get_sync(adsp->dev);
return 0; return 0;
} }
@@ -966,6 +967,8 @@ static int tegra210_adsp_compr_free(struct snd_compr_stream *cstream)
tegra210_adsp_send_reset_msg(prtd->fe_apm, tegra210_adsp_send_reset_msg(prtd->fe_apm,
TEGRA210_ADSP_MSG_FLAG_SEND); TEGRA210_ADSP_MSG_FLAG_SEND);
pm_runtime_put(prtd->dev);
prtd->fe_apm->fe = 0; prtd->fe_apm->fe = 0;
cstream->runtime->private_data = NULL; cstream->runtime->private_data = NULL;
devm_kfree(prtd->dev, prtd); devm_kfree(prtd->dev, prtd);