diff --git a/sound/soc/amlogic/auge/resample.c b/sound/soc/amlogic/auge/resample.c index f3a99483eec3..6b2fb6da8298 100644 --- a/sound/soc/amlogic/auge/resample.c +++ b/sound/soc/amlogic/auge/resample.c @@ -274,6 +274,11 @@ int resample_set(enum resample_idx id, enum samplerate_index index) if (!p_resample) return 0; + if (index < RATE_OFF || index > RATE_192K) { + pr_err("%s(), invalid index %d\n", __func__, index); + return 0; + } + pr_info("%s resample_%c to %s, last %s\n", __func__, (id == RESAMPLE_A) ? 'a' : 'b', @@ -284,7 +289,7 @@ int resample_set(enum resample_idx id, enum samplerate_index index) if (index == p_resample->asrc_rate_idx) return 0; #endif - p_resample->asrc_rate_idx = index; + set_resample_rate_index(id, index); resample_rate = resample_idx2rate(index); ret = audio_resample_set(p_resample, (bool)index, resample_rate); diff --git a/sound/soc/amlogic/auge/spdif.c b/sound/soc/amlogic/auge/spdif.c index 520c982a031c..ab79a49b7c1a 100644 --- a/sound/soc/amlogic/auge/spdif.c +++ b/sound/soc/amlogic/auge/spdif.c @@ -1492,6 +1492,12 @@ static int aml_spdif_parse_of(struct platform_device *pdev) if (ret < 0) p_spdif->auto_asrc = 0; + if (p_spdif->auto_asrc < RATE_OFF || + p_spdif->auto_asrc > RATE_192K) { + pr_info("%s(), inval asrc setting %d\n", + __func__, p_spdif->auto_asrc); + p_spdif->auto_asrc = RATE_OFF; + } pr_debug("SPDIF id %d asrc_id:%d auto_asrc:%d\n", p_spdif->id, p_spdif->asrc_id,