From: nengwen.chen Date: Mon, 30 Jul 2018 08:35:18 +0000 (+0800) Subject: atv_demod: modify afc to prevent demod error locking [1/1] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8c9d51363c6b2bfa0f59fb68751dbed2bfc0e21b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git atv_demod: modify afc to prevent demod error locking [1/1] PD#169984: modify afc to prevent demod error locking Change-Id: I02d184309fdeb5696da6158e0f29311cdc7675a5 Signed-off-by: nengwen.chen --- diff --git a/drivers/amlogic/atv_demod/atv_demod_ops.c b/drivers/amlogic/atv_demod/atv_demod_ops.c index 86cf695951d2..23efa99b4dc3 100644 --- a/drivers/amlogic/atv_demod/atv_demod_ops.c +++ b/drivers/amlogic/atv_demod/atv_demod_ops.c @@ -196,7 +196,7 @@ static void aml_afc_do_work(struct work_struct *work) return; } - if (!lock) { + if (!lock || (lock && !field_lock)) { afc_lock_status = AFC_LOCK_STATUS_POST_UNLOCK; afc_pre_lock_cnt = 0; param->frequency -= afc_offset * 1000; diff --git a/drivers/amlogic/atv_demod/atvauddemod_func.c b/drivers/amlogic/atv_demod/atvauddemod_func.c index 5840ab467556..7c0b58bd1b38 100644 --- a/drivers/amlogic/atv_demod/atvauddemod_func.c +++ b/drivers/amlogic/atv_demod/atvauddemod_func.c @@ -594,7 +594,7 @@ void set_eiaj(void) adec_wr_reg(ADDR_DDC_FREQ0, aa); aa = (int)((15.734e3*2)/(FCLK/4/16)*1024.0*1024.0*8.0); - aa = (0x80e40); + /* aa = (0x80e40); */ adec_wr_reg(ADDR_DDC_FREQ1, aa); diff --git a/drivers/amlogic/atv_demod/atvdemod_func.c b/drivers/amlogic/atv_demod/atvdemod_func.c index 3a542f6a8339..153f0809aac6 100644 --- a/drivers/amlogic/atv_demod/atvdemod_func.c +++ b/drivers/amlogic/atv_demod/atvdemod_func.c @@ -128,7 +128,7 @@ void atv_dmd_wr_reg(unsigned char block, unsigned char reg, unsigned long data) unsigned long atv_dmd_rd_reg(unsigned char block, unsigned char reg) { unsigned long data = 0; - unsigned long reg_addr = (block<<8) + reg * 4; + unsigned int reg_addr = (block<<8) + reg * 4; amlatvdemod_reg_read(reg_addr, (unsigned int *)&data); return data; @@ -578,7 +578,7 @@ void configure_receiver(int Broadcast_Standard, unsigned int Tuner_IF_Frequency, int Tuner_Input_IF_inverted, int GDE_Curve, int sound_format) { - int tmp_int; + int tmp_int = 0; int mixer1 = 0; int mixer3 = 0; int mixer3_bypass = 0; @@ -589,8 +589,8 @@ void configure_receiver(int Broadcast_Standard, unsigned int Tuner_IF_Frequency, int super_coef0 = 0; int super_coef1 = 0; int super_coef2 = 0; - int gp_coeff_1[37]; - int gp_coeff_2[37]; + int gp_coeff_1[37] = { 0 }; + int gp_coeff_2[37] = { 0 }; int gp_cv_g1 = 0; int gp_cv_g2 = 0; int crvy_reg_1 = 0; @@ -602,8 +602,8 @@ void configure_receiver(int Broadcast_Standard, unsigned int Tuner_IF_Frequency, int sif_deemp = 0; int sif_cfg_demod = 0; int sif_fm_gain = 0; - int gd_coeff[6]; - int gd_bypass; + int gd_coeff[6] = { 0 }; + int gd_bypass = 0; pr_info("ATV-DMD configure receiver register\n"); @@ -1576,9 +1576,9 @@ int aml_atvdemod_get_snr_ex(void) static enum amlatvdemod_snr_level_e aml_atvdemod_get_snr_level(void) { - unsigned int snr_val, i, snr_d[8]; - enum amlatvdemod_snr_level_e ret; - unsigned long fsnr; + unsigned int snr_val = 0, i = 0, snr_d[8] = { 0 }; + enum amlatvdemod_snr_level_e ret = very_low; + unsigned long fsnr = 0; snr_val = atv_dmd_rd_long(APB_BLOCK_ADDR_VDAGC, 0x50) >> 8; fsnr = snr_val;