tvafe: fix pali recognize for palcn [1/1]
authorNian Jing <nian.jing@amlogic.com>
Thu, 28 Feb 2019 12:00:22 +0000 (20:00 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 7 Mar 2019 12:23:20 +0000 (04:23 -0800)
PD#SWPL-3395

Problem:
recognized fsc358 flag when signal weak

Solution:
increase fsc358-flag recognized threshold
avoid fsc443 be recognized as fsc358

Verify:
verify on x301

Change-Id: I7b759bd0621c153e5abd3dee8fdf55a2426400a7
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
drivers/amlogic/atv_demod/atv_demod_ops.c
drivers/amlogic/atv_demod/atvdemod_func.c
drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c

index 0dedd6f..76cf2a1 100644 (file)
@@ -252,7 +252,8 @@ static void atv_demod_set_params(struct dvb_frontend *fe,
         * but when the input signal frequency offset -0.25MHz,
         * demod will be unlocked. That's very strange.
         */
-       if (reconfig || amlatvdemod_devp->std != p->param.std ||
+       if (reconfig || !priv->scanning ||
+               amlatvdemod_devp->std != p->param.std ||
                amlatvdemod_devp->audmode != p->param.audmode ||
                amlatvdemod_devp->if_freq != p->if_freq ||
                amlatvdemod_devp->if_inv != p->if_inv ||
@@ -664,7 +665,8 @@ static void atvdemod_fe_try_analog_format(struct v4l2_frontend *v4l2_fe,
 #endif
        } else {
                /* V4L2_COLOR_STD_PAL */
-               if (cvbs_std == TVIN_SIG_FMT_CVBS_PAL_M) {
+               if (cvbs_std == TVIN_SIG_FMT_CVBS_PAL_M ||
+                       cvbs_std == TVIN_SIG_FMT_CVBS_PAL_CN) {
                        broad_std = AML_ATV_DEMOD_VIDEO_MODE_PROP_PAL_M;
                        audio = V4L2_STD_PAL_M;
                } else {
index 1ab6df4..e6da878 100644 (file)
@@ -311,9 +311,24 @@ void atv_dmd_ring_filter(bool on)
                atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x30, 0x1d175c);
                atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x34, 0x2d19e4);
 
+               /* enable filter */
                atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x4c, 0x1);
-       } else
+       } else {
+               /* default value */
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x10, 0x8423F6);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x14, 0xFF86A967);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x18, 0x37FE45);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x1c, 0xFF86A967);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x20, 0x3C223B);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x24, 0x8423F6);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x28, 0xFF86A967);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x2c, 0x37FE45);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x30, 0xFF86A967);
+               atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x34, 0x3C223B);
+
+               /* disable filter */
                atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x4c, 0x0);
+       }
 
        pr_dbg("%s do atv_dmd_ring_filter %d ...\n", __func__, on);
 }
index dc3977e..5f6a80e 100644 (file)
@@ -920,19 +920,14 @@ void tvafe_cvd2_get_signal_status(struct tvafe_cvd2_s *cvd2)
                !cvd2->hw_data[2].secam_detected)
                cvd2->hw.secam_detected = false;
 
-       if (cnt_dbg_en) {
-
-               tvafe_pr_info("[%d]:cvd2->hw.acc3xx_cnt =%d,cvd2->hw.acc4xx_cnt=%d,acc425_cnt=%d\n",
-                       __LINE__,
-               cvd2->hw.acc3xx_cnt, cvd2->hw.acc4xx_cnt, cvd2->hw.acc425_cnt);
-               tvafe_pr_info("[%d]:cvd2->hw.fsc_358=%d,cvd2->hw.fsc_425=%d,cvd2->hw.fsc_443 =%d\n",
-                       __LINE__,
-               cvd2->hw.fsc_358, cvd2->hw.fsc_425, cvd2->hw.fsc_443);
-               }
+       if (cnt_dbg_en & 1)
+               tvafe_pr_info("acc4xx_cnt=%d,acc425_cnt=%d,acc3xx_cnt=%d,acc358_cnt=%d\n",
+                       cvd2->hw.acc4xx_cnt, cvd2->hw.acc425_cnt,
+                       cvd2->hw.acc3xx_cnt, cvd2->hw.acc358_cnt);
        if (cvd2->hw.acc3xx_cnt > CNT_VLD_TH) {
 
                if (cvd2->hw.acc358_cnt >
-                       (cvd2->hw.acc3xx_cnt - (cvd2->hw.acc3xx_cnt>>2))) {
+                       (cvd2->hw.acc3xx_cnt - (cvd2->hw.acc3xx_cnt>>3))) {
 
                        cvd2->hw.fsc_358 = true;
                        cvd2->hw.fsc_425 = false;
@@ -958,8 +953,8 @@ void tvafe_cvd2_get_signal_status(struct tvafe_cvd2_s *cvd2)
        }
        if (++ cvd2->hw_data_cur >= 3)
                cvd2->hw_data_cur = 0;
-       if (cnt_dbg_en)
-               tvafe_pr_info("[%d]:cvd2->hw.fsc_358=%d,cvd2->hw.fsc_425=%d,cvd2->hw.fsc_443 =%d\n",
+       if (cnt_dbg_en & 2)
+               tvafe_pr_info("[%d]:hw.fsc_358=%d,hw.fsc_425=%d,hw.fsc_443 =%d\n",
                __LINE__, cvd2->hw.fsc_358,
                cvd2->hw.fsc_425, cvd2->hw.fsc_443);