dts: tl1: enable resample for tl1 [1/2]

PD#SWPL-3365

Problem:
not resample for audio in, so output in wrong sample rate

Solution:
1. enable resample in dts
2. fix to check whether resample is needed

Verify:
x301

Change-Id: I99238cc21a00ab53df6a1f8ab1703bc9ab48cbaa
Signed-off-by: Xing Wang <xing.wang@amlogic.com>

Conflicts:
	sound/soc/amlogic/auge/ddr_mngr.c
	sound/soc/amlogic/auge/resample.c
	sound/soc/amlogic/auge/spdif.c
This commit is contained in:
Xing Wang
2019-01-15 17:15:34 +08:00
committed by Luke Go
parent c6017751c3
commit 2615bd4e2e
3 changed files with 12 additions and 12 deletions

View File

@@ -494,9 +494,8 @@ unsigned int aml_toddr_read1(struct toddr *to)
unsigned int reg_base = to->reg_base;
unsigned int reg;
reg = calc_toddr_address(EE_AUDIO_TODDR_A_CTRL1, reg_base);
return aml_audiobus_read(actrl, reg);
reg = calc_toddr_address(EE_AUDIO_TODDR_A_CTRL0, reg_base);
aml_audiobus_update_bits(actrl, reg, 1<<30, enable<<30);
}
void aml_toddr_write1(struct toddr *to, unsigned int val)
@@ -578,7 +577,7 @@ static void aml_resample_enable(
pr_info("toddr %d selects data to %s resample_%c for module:%s\n",
to->fifo_id,
enable ? "enable" : "disable",
(p_attach_resample->id == RESAMPLE_A) ? 'a' : 'b',
(p_attach_resample->id == 0) ? 'a' : 'b',
toddr_src_get_str(p_attach_resample->attach_module)
);

View File

@@ -286,10 +286,13 @@ int resample_set(enum resample_idx id, enum samplerate_index index)
#endif
p_resample->asrc_rate_idx = index;
resample_rate = resample_idx2rate(index);
ret = audio_resample_set(p_resample, (bool)index, resample_rate);
if (ret)
return ret;
pr_info("%s resample_%c %s\n",
__func__,
(id == 0) ? 'a' : 'b',
auge_resample_texts[index]);
if (audio_resample_set(p_resample, (bool)index, resample_rate))
return 0;
if (index == RATE_OFF)
resample_disable(p_resample->id);

View File

@@ -51,9 +51,6 @@
/*#define __SPDIFIN_AUDIO_TYPE_HW__*/
static int aml_dai_set_spdif_sysclk(struct snd_soc_dai *cpu_dai,
int clk_id, unsigned int freq, int dir);
struct spdif_chipinfo {
enum SPDIF_ID id;
@@ -708,6 +705,7 @@ static void spdifin_status_event(struct aml_spdif *p_spdif)
if (!spdifin_check_audiotype_by_sw(p_spdif))
resample_set(p_spdif->asrc_id, RATE_OFF);
#endif
#endif
#endif
}
if (intrpt_status & 0x10)
@@ -1131,7 +1129,7 @@ static void aml_dai_spdif_shutdown(
#ifdef __SPDIFIN_AUDIO_TYPE_HW__
/* resample disabled, by hw */
if (!spdifin_check_audiotype_by_sw(p_spdif))
resample_set(p_spdif->asrc_id, RATE_OFF);
resample_set(p_spdif->asrc_id, 0);
#endif
clk_disable_unprepare(p_spdif->clk_spdifin);
clk_disable_unprepare(p_spdif->fixed_clk);