diff options
author | qctecmdr <qctecmdr@localhost> | 2019-10-30 01:15:01 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2019-10-30 01:15:01 -0700 |
commit | 60fbb5570c8a920f0c4b4e9acb98ee11ddb9110e (patch) | |
tree | fa549746c5f8278ccaef432ef7a65af0d56956e0 | |
parent | a52e59a89d24ca8bd74444aa601b2faabd4b30c7 (diff) | |
parent | 4ce3a2c7d21bfde9e6a79b7a35071bdd483311d9 (diff) | |
download | msm-extra-60fbb5570c8a920f0c4b4e9acb98ee11ddb9110e.tar.gz |
Merge "ASoC: Check for adsp state before setting lpass clock"
-rw-r--r-- | asoc/codecs/audio-ext-clk-up.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/asoc/codecs/audio-ext-clk-up.c b/asoc/codecs/audio-ext-clk-up.c index e12581c3..cca08983 100644 --- a/asoc/codecs/audio-ext-clk-up.c +++ b/asoc/codecs/audio-ext-clk-up.c @@ -23,6 +23,7 @@ #include <linux/of_gpio.h> #include <dt-bindings/clock/qcom,audio-ext-clk.h> #include <dsp/q6afe-v2.h> +#include <dsp/q6core.h> #include "audio-ext-clk-up.h" enum audio_clk_mux { @@ -176,6 +177,20 @@ static int audio_ext_lpass_mclk_prepare(struct clk_hw *hw) struct audio_ext_lpass_mclk *audio_lpass_mclk = to_audio_lpass_mclk(hw); struct pinctrl_info *pnctrl_info = &audio_lpass_mclk->pnctrl_info; int ret; + unsigned long timeout; + + if (!q6core_is_adsp_ready()) { + pr_debug("ADSP isn't ready\n"); + timeout = jiffies + + msecs_to_jiffies(2 * 100); + while (!time_after(jiffies, timeout)) { + if (!q6core_is_adsp_ready()) { + pr_info("ADSP isn't ready\n"); + } else { + pr_debug("ADSP is ready\n"); + } + } + } lpass_mclk.enable = 1; ret = afe_set_lpass_clock_v2(AFE_PORT_ID_PRIMARY_MI2S_RX, |