tvafe: fix pali recognize for palcn [1/1]

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>

Conflicts:
	drivers/amlogic/atv_demod/atv_demod_ops.c
	drivers/amlogic/atv_demod/atvdemod_func.c
This commit is contained in:
Nian Jing
2019-02-28 20:00:22 +08:00
committed by Dongjin Kim
parent fb722a947a
commit 564ce6cd68
3 changed files with 79 additions and 16 deletions

View 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 ||
@@ -653,9 +654,16 @@ static void atvdemod_fe_try_analog_format(struct v4l2_frontend *v4l2_fe,
#endif
} else {
/* V4L2_COLOR_STD_PAL */
amlatvdemod_set_std(AML_ATV_DEMOD_VIDEO_MODE_PROP_PAL_DK);
broad_std = aml_audiomode_autodet(v4l2_fe);
audio = atvdemod_fmt_2_v4l2_std(broad_std);
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 {
amlatvdemod_set_std(
AML_ATV_DEMOD_VIDEO_MODE_PROP_PAL_DK);
broad_std = aml_audiomode_autodet(v4l2_fe);
audio = atvdemod_fmt_2_v4l2_std(broad_std);
}
#if 0 /* Why do this to me? We need support PAL_M.*/
if (audio == V4L2_STD_PAL_M) {
audio = atvdemod_fmt_2_v4l2_std(broad_std_except_pal_m);

View File

@@ -261,6 +261,66 @@ void atv_dmd_misc(void)
carrier_amplif_val);
}
if (audio_atv_ov) {
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x14, 0x8000015);
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x18, 0x7ffff);
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x1c, 0x0f000);
atvaudio_ctrl_read(&reg);
atvaudio_ctrl_write(reg & (~0x3));
audio_atv_ov_flag = 1;
} else {
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x14, 0xf400000);
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x18, 0xc000);
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2,
0x1c, 0x1f000);
atvaudio_ctrl_read(&reg);
atvaudio_ctrl_write(reg | 0x3);
audio_atv_ov_flag = 0;
}
}
void atv_dmd_ring_filter(bool on)
{
if (!is_meson_tl1_cpu())
return;
if (on) {
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x10, 0x8274bf);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x14, 0x1d175c);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x18, 0x2aa526);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x1c, 0x1d175c);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x20, 0x2d19e4);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x24, 0x8274bf);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x28, 0x1d175c);
atv_dmd_wr_long(APB_BLOCK_ADDR_GDE_EQUAL, 0x2c, 0x2aa526);
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 {
/* 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);
}
void atv_dmd_non_std_set(bool enable)

View 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);