From 42644bc4ab6114a817530af39366a0a7e7fa72d6 Mon Sep 17 00:00:00 2001 From: "nengwen.chen" Date: Tue, 21 May 2019 16:12:40 +0800 Subject: [PATCH] atv_demod: fix nicam audio [1/1] PD#TV-5660 Problem: fix nicam audio. Solution: 1.fix nicam audio. Verify: Verified by x301 Change-Id: I35d508d1772b9c37ad71a62c2844e1776e81fd09 Signed-off-by: nengwen.chen --- drivers/amlogic/atv_demod/atvauddemod_func.c | 37 +++++++++++++++++----------- drivers/amlogic/atv_demod/aud_demod_reg.h | 5 ++++ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/drivers/amlogic/atv_demod/atvauddemod_func.c b/drivers/amlogic/atv_demod/atvauddemod_func.c index 616adb9..d8b2882 100644 --- a/drivers/amlogic/atv_demod/atvauddemod_func.c +++ b/drivers/amlogic/atv_demod/atvauddemod_func.c @@ -648,8 +648,9 @@ void set_nicam_dk(void) { int aa; - adec_wr_reg(0x103, 0x1000000); - adec_wr_reg(0x115, 0x1503d); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x1000000); + adec_wr_reg(NICAM_DAGC1, 0x1180E); + adec_wr_reg(NICAM_EQ_ERR_MODE, 0xAAF040A); adec_wr_reg(ADDR_ADEC_CTRL, AUDIO_STANDARD_NICAM_DK); @@ -663,19 +664,20 @@ void set_nicam_dk(void) set_deem(2); - adec_wr_reg(0x103, 0x7f); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x7f); aa = (int)((FCLK-5.85e6)/FCLK*1024.0*1024.0*16.0); - adec_wr_reg(0x110, aa); + adec_wr_reg(NICAM_DDC_ROLLOFF, aa); } void set_nicam_i(void) { int aa; - adec_wr_reg(0x103, 0x1000000); - adec_wr_reg(0x110, 0xcb9581); - adec_wr_reg(0x115, 0x1503d); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x1000000); + adec_wr_reg(NICAM_DDC_ROLLOFF, 0xcb9581); + adec_wr_reg(NICAM_DAGC1, 0x1180E); + adec_wr_reg(NICAM_EQ_ERR_MODE, 0xAAF040A); adec_wr_reg(ADDR_ADEC_CTRL, AUDIO_STANDARD_NICAM_I); @@ -687,18 +689,19 @@ void set_nicam_i(void) adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x200); set_deem(2); - adec_wr_reg(0x103, 0x7f); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x7f); aa = (int)((FCLK-6.552e6)/FCLK*1024.0*1024.0*16.0); - adec_wr_reg(0x110, aa); + adec_wr_reg(NICAM_DDC_ROLLOFF, aa); } void set_nicam_bg(void) { int aa; - adec_wr_reg(0x103, 0x1000000); - adec_wr_reg(0x115, 0x1503d); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x1000000); + adec_wr_reg(NICAM_DAGC1, 0x1180E); + adec_wr_reg(NICAM_EQ_ERR_MODE, 0xAAF040A); adec_wr_reg(ADDR_ADEC_CTRL, AUDIO_STANDARD_NICAM_BG); @@ -710,16 +713,20 @@ void set_nicam_bg(void) adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x200); set_deem(2); - adec_wr_reg(0x103, 0x7f); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x7f); aa = (int)((FCLK-5.85e6)/FCLK*1024.0*1024.0*16.0); - adec_wr_reg(0x110, aa); + adec_wr_reg(NICAM_DDC_ROLLOFF, aa); } void set_nicam_l(void) { int aa; + adec_wr_reg(NICAM_CTRL_ENABLE, 0x1000000); + adec_wr_reg(NICAM_DAGC1, 0x1180E); + adec_wr_reg(NICAM_EQ_ERR_MODE, 0xAAF040A); + adec_wr_reg(ADDR_ADEC_CTRL, AUDIO_STANDARD_NICAM_L); set_filter(filter_100k, ADDR_DDC_FIR0_COEF, 65); @@ -730,10 +737,10 @@ void set_nicam_l(void) adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x200); set_deem(2); - adec_wr_reg(0x103, 0x7f); + adec_wr_reg(NICAM_CTRL_ENABLE, 0x7f); aa = (int)((FCLK-5.85e6)/FCLK*1024.0*1024.0*16.0); - adec_wr_reg(0x110, aa); + adec_wr_reg(NICAM_DDC_ROLLOFF, aa); } void set_mono_m(void) diff --git a/drivers/amlogic/atv_demod/aud_demod_reg.h b/drivers/amlogic/atv_demod/aud_demod_reg.h index a1b4963..d44b98a 100644 --- a/drivers/amlogic/atv_demod/aud_demod_reg.h +++ b/drivers/amlogic/atv_demod/aud_demod_reg.h @@ -218,6 +218,11 @@ #define CARRIER_MAG_REPORT 0x0f6 #define BTSC_AB_REPORT 0x0f7 #define AUDIO_MODE_REPORT 0x0f8 + +#define NICAM_CTRL_ENABLE 0x103 +#define NICAM_DDC_ROLLOFF 0x110 +#define NICAM_DAGC1 0x115 +#define NICAM_EQ_ERR_MODE 0x17c #define NICAM_LEVEL_REPORT 0x1a3 #define NICAM_MODE_REPORT 0x1a4 -- 2.7.4