audio: fixed kernel panic when resample is disabled [1/1]

PD#SWPL-7039

Problem:
Kernel Panic when resample A is disabled

Solution:
When resample is disabled,don't init resample

Verify:
Verified on T962e2_ab311

Change-Id: Id9552ffc6be40f133b828dbded4ad3f15d177ab0
Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
This commit is contained in:
Zhe Wang
2019-04-12 10:51:00 +08:00
committed by Jianxin Pan
parent 1f8aa33a79
commit 758b24b3ce
3 changed files with 6 additions and 2 deletions

View File

@@ -372,7 +372,9 @@ static int extn_dai_startup(
struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
resample_set_inner_rate(RESAMPLE_A);
if (get_audioresample(RESAMPLE_A))
resample_set_inner_rate(RESAMPLE_A);
return 0;
}

View File

@@ -75,7 +75,7 @@ struct audioresample *s_resample_a;
struct audioresample *s_resample_b;
static struct audioresample *get_audioresample(enum resample_idx id)
struct audioresample *get_audioresample(enum resample_idx id)
{
struct audioresample *p_resample;

View File

@@ -29,4 +29,6 @@ int set_resample_source(enum resample_idx id, enum toddr_src src);
int resample_set_inner_rate(enum resample_idx id);
struct audioresample *get_audioresample(enum resample_idx id);
#endif