From 93b24a451e8a657b260aaf88de339b6bf61e4bb4 Mon Sep 17 00:00:00 2001 From: Viswanath L Date: Wed, 9 Mar 2016 13:01:40 +0530 Subject: [PATCH] tegra-alt:adsp: Allow "Min ADSP Clock" ctl always "Min ADSP Clock" for the APM is set at the widget ON event, which sometimes occurs immediately on closing the APM connections (like for SPKPROT); allowing "Min ADSP Clock" setting only if APM is initialized causes this to be missed at times Allowing to set "Min ADSP Clock" before APM is initialized will ensure that it's always available at the subsequent widget event Bug 200170455 Change-Id: I5500484f42a23abb290431a8e329e57e741a0e14 Signed-off-by: Viswanath L Reviewed-on: http://git-master/r/1027039 (cherry picked from commit a3ceb08c60ecb398a192dc607c1587b797ca79b7) Reviewed-on: http://git-master/r/1029374 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Ravindra Lokhande --- sound/soc/tegra-alt/tegra210_adsp_alt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/tegra-alt/tegra210_adsp_alt.c b/sound/soc/tegra-alt/tegra210_adsp_alt.c index 92c4f52f..c1bd6878 100644 --- a/sound/soc/tegra-alt/tegra210_adsp_alt.c +++ b/sound/soc/tegra-alt/tegra210_adsp_alt.c @@ -2722,6 +2722,13 @@ static int tegra210_adsp_apm_put(struct snd_kcontrol *kcontrol, return -EPERM; } + /* Controls here may execute whether or not APM is initialized */ + if (strstr(kcontrol->id.name, "Min ADSP Clock")) { + app->min_adsp_clock = ucontrol->value.integer.value[0]; + return 0; + } + + /* Check for APM initialized */ if (!app->plugin) { dev_warn(adsp->dev, "Unable to set %s, APM %d not initialized\n", kcontrol->id.name, mc->reg); @@ -2736,8 +2743,6 @@ static int tegra210_adsp_apm_put(struct snd_kcontrol *kcontrol, ucontrol->value.integer.value[0]; app->priority = ucontrol->value.integer.value[0]; send_msg = true; - } else if (strstr(kcontrol->id.name, "Min ADSP Clock")) { - app->min_adsp_clock = ucontrol->value.integer.value[0]; } else if (strstr(kcontrol->id.name, "Input Mode")) { apm_msg.msgq_msg.size = MSGQ_MSG_WSIZE(apm_set_input_mode_params_t);