atv_demod: modify afc to prevent demod error locking [1/1]
authornengwen.chen <nengwen.chen@amlogic.com>
Mon, 30 Jul 2018 08:35:18 +0000 (16:35 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Wed, 1 Aug 2018 11:32:58 +0000 (04:32 -0700)
PD#169984: modify afc to prevent demod error locking

Change-Id: I02d184309fdeb5696da6158e0f29311cdc7675a5
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
drivers/amlogic/atv_demod/atv_demod_ops.c
drivers/amlogic/atv_demod/atvauddemod_func.c
drivers/amlogic/atv_demod/atvdemod_func.c

index 86cf695951d29c419218b42c55efef5e810f48f4..23efa99b4dc309dfa9f22f96c86395978ee5ed8e 100644 (file)
@@ -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;
index 5840ab4675564d8e73b131e08ad26ab91fe8630d..7c0b58bd1b38966ac54f74590ca69a3d4560298e 100644 (file)
@@ -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);
 
 
index 3a542f6a833933e5a45192c48ec5b1b311221a28..153f0809aac6bdae564013e0b2ed8fabeaaeadcd 100644 (file)
@@ -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;