From 758b24b3ce340d677fd66db97a20ef0e146d09e7 Mon Sep 17 00:00:00 2001 From: Zhe Wang Date: Fri, 12 Apr 2019 10:51:00 +0800 Subject: [PATCH] audio: fixed kernel panic when resample is disabled [1/1] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sound/soc/amlogic/auge/extn.c | 4 +++- sound/soc/amlogic/auge/resample.c | 2 +- sound/soc/amlogic/auge/resample.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sound/soc/amlogic/auge/extn.c b/sound/soc/amlogic/auge/extn.c index 277761265e07..78ec04f952bd 100644 --- a/sound/soc/amlogic/auge/extn.c +++ b/sound/soc/amlogic/auge/extn.c @@ -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; } diff --git a/sound/soc/amlogic/auge/resample.c b/sound/soc/amlogic/auge/resample.c index aa096072e838..8678361c51c5 100644 --- a/sound/soc/amlogic/auge/resample.c +++ b/sound/soc/amlogic/auge/resample.c @@ -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; diff --git a/sound/soc/amlogic/auge/resample.h b/sound/soc/amlogic/auge/resample.h index 1c18d11066d2..b82aac34fc82 100644 --- a/sound/soc/amlogic/auge/resample.h +++ b/sound/soc/amlogic/auge/resample.h @@ -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