audio: fixed kernel panic when resample is disabled [1/1]
authorZhe Wang <Zhe.Wang@amlogic.com>
Fri, 12 Apr 2019 02:51:00 +0000 (10:51 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Fri, 12 Apr 2019 03:34:19 +0000 (20:34 -0700)
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>
sound/soc/amlogic/auge/extn.c
sound/soc/amlogic/auge/resample.c
sound/soc/amlogic/auge/resample.h

index 2777612..78ec04f 100644 (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;
 }
 
index aa09607..8678361 100644 (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;
 
index 1c18d11..b82aac3 100644 (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