audio: atv source selected by atv demod [1/1]

PD#TV-6044, PD#TV-6047

Problem:
ATV sound output has noise when input non standard signal.

Solution:
release atv source select function to atv demod

Verify:
x301.

Change-Id: I96e58531150c3f20946ab636d701296328215686
Signed-off-by: Zhe Wang <Zhe.Wang@amlogic.com>
This commit is contained in:
Zhe Wang
2019-06-12 14:28:10 +08:00
committed by Luke Go
parent dc0e01a87c
commit 2ef271dfb3
5 changed files with 38 additions and 6 deletions

View File

@@ -961,9 +961,14 @@ void fratv_enable(bool enable)
* 0: select from ATV;
* 1: select from ADEC;
*/
void fratv_src_select(int src)
void fratv_src_select(bool src)
{
audiobus_update_bits(EE_AUDIO_FRATV_CTRL0, 0x1 << 20, (bool)src << 20);
audiobus_update_bits(EE_AUDIO_FRATV_CTRL0, 0x1 << 20, src << 20);
}
void fratv_LR_swap(bool swap)
{
audiobus_update_bits(EE_AUDIO_FRATV_CTRL0, 0x1 << 19, swap << 19);
}
void cec_arc_enable(int src, bool enable)

View File

@@ -27,7 +27,10 @@ extern void audio_locker_set(int enable);
extern int audio_locker_get(void);
extern void fratv_enable(bool enable);
extern void fratv_src_select(int src);
extern void fratv_src_select(bool src);
extern void fratv_LR_swap(bool swap);
extern void cec_arc_enable(int src, bool enable);
#endif

View File

@@ -460,7 +460,10 @@ static int extn_dai_prepare(
msb = 15;
lsb = 0;
fratv_src_select(1);
/* commented it, selected by atv demod,
* select 0 for non standard signal.
*/
/* fratv_src_select(1); */
} else if (src == FRHDMIRX) {
if (p_extn->hdmirx_mode) { /* PAO */

View File

@@ -434,8 +434,10 @@ static void i2sin_fifo2_set_buf(u32 addr, u32 size, u32 src, u32 ch)
);
if (audio_in_source == 1) {
/* ATV from adec */
aml_audin_write(AUDIN_ATV_DEMOD_CTRL, 7);
/* commented it, selected by atv demod,
* select 0 for non standard signal.
*/
/*aml_audin_write(AUDIN_ATV_DEMOD_CTRL, 7);*/
aml_audin_update_bits(AUDIN_FIFO2_CTRL,
(0x7 << AUDIN_FIFO_DIN_SEL),
(ATV_ADEC << AUDIN_FIFO_DIN_SEL));
@@ -459,6 +461,22 @@ static void i2sin_fifo2_set_buf(u32 addr, u32 size, u32 src, u32 ch)
}
/* source select
* 0: select from ATV;
* 1: select from ADEC;
*/
void atv_src_select(bool src)
{
aml_audin_update_bits(AUDIN_ATV_DEMOD_CTRL,
0x3, (src << 1) && src);
}
void atv_LR_swap(bool swap)
{
aml_audin_update_bits(AUDIN_ATV_DEMOD_CTRL,
0x1 << 2, swap << 2);
}
static void spdifin_reg_set(void)
{
/* get clk81 clk_rate */

View File

@@ -198,6 +198,9 @@ extern bool is_audin_lr_invert_check(void);
extern bool is_audbuf_gate_rm(void);
extern void chipset_set_spdif_pao(void);
extern void atv_src_select(bool src);
extern void atv_LR_swap(bool swap);
extern unsigned int IEC958_mode_codec;
extern unsigned int clk81;