atv_demod: fix non-standard signal [1/1]

PD#TV-7783

Problem:
fix non-standard signal.

Solution:
1.fix non-standard signal when channel scanning and playing.
2.disable demod afc when enable non standard.

Verify:
Verified by x301

Change-Id: I177e6eb5388e554e3166a65e23e3b7bdefac3e97
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
nengwen.chen
2019-08-01 10:40:47 +08:00
committed by Tao Zeng
parent 0acbc9bc4e
commit 433ca76390
3 changed files with 16 additions and 10 deletions

View File

@@ -252,7 +252,7 @@ static void atv_demod_set_params(struct dvb_frontend *fe,
if ((fe->ops.info.type == FE_ANALOG)
&& (priv->scanning == false)
&& (p->param.mode == 0)) {
if (priv->afc.enable)
if (priv->afc.enable && non_std_en == 0)
priv->afc.enable(&priv->afc);
if (priv->monitor.enable)

View File

@@ -195,6 +195,8 @@ void power_on_receiver(void)
void atv_dmd_misc(void)
{
unsigned int reg = 0;
int index = amlatvdemod_devp->tuner_cur;
int tuner_id = amlatvdemod_devp->tuners[index].cfg.id;
if (broad_std == AML_ATV_DEMOD_VIDEO_MODE_PROP_SECAM_L) {
pr_info("broad_std is SECAM_L, no need config misc\n");
@@ -207,10 +209,7 @@ void atv_dmd_misc(void)
atv_dmd_wr_byte(APB_BLOCK_ADDR_VDAGC, 0x45, 0x90); /*zhuangwei*/
atv_dmd_wr_long(APB_BLOCK_ADDR_VDAGC, 0x44, 0x5c8808c1);/*zhuangwei*/
if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
== AM_TUNER_R840 ||
amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
== AM_TUNER_R842) {
if (tuner_id == AM_TUNER_R840 || tuner_id == AM_TUNER_R842) {
/*zhuangwei*/
atv_dmd_wr_long(APB_BLOCK_ADDR_VDAGC, 0x3c, reg_23cf);
/*guanzhong@20150804a*/
@@ -238,15 +237,13 @@ void atv_dmd_misc(void)
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x08, 0x46170200);
}
if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
== AM_TUNER_MXL661) {
if (tuner_id == AM_TUNER_MXL661) {
/*test in sky*/
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x04, 0xbffa0000);
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x00, 0x764000);
/*guanzhong@20151013 fix nonstd def is:0x0c010301;0x0c020601*/
atv_dmd_wr_long(APB_BLOCK_ADDR_CARR_RCVY, 0x24, 0xc030901);
} else if (amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
== AM_TUNER_ATBM2040) {
} else if (tuner_id == AM_TUNER_ATBM2040) {
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x04, 0xc8fa0000);
atv_dmd_wr_long(APB_BLOCK_ADDR_DAC_UPS, 0x00, 0x704000);
} else {
@@ -290,6 +287,13 @@ void atv_dmd_misc(void)
atv_dmd_wr_long(APB_BLOCK_ADDR_VDAGC, 0x0c, 0x387c0831);
atv_dmd_wr_long(APB_BLOCK_ADDR_CARR_RCVY, 0x24, 0xc020901);
} else {
if (tuner_id == AM_TUNER_R840 || tuner_id == AM_TUNER_R842
|| non_std_en == 4) {
/* Reduce target amplitude and response speed */
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x08,
0x17070200);
}
atv_dmd_wr_long(APB_BLOCK_ADDR_SIF_STG_2, 0x00,
extra_input_fil_val);
if (atv_video_gain)
@@ -1999,7 +2003,8 @@ int atvdemod_init(struct atv_demod_priv *priv)
sound_format);
}
if (!priv->scanning)
/* for non standard(non_std_en != 0) signal, need reinit */
if (!priv->scanning || non_std_en)
atv_dmd_misc();
if (!priv->scanning &&

View File

@@ -30,6 +30,7 @@ extern unsigned int aud_mode;
extern bool audio_thd_en;
extern bool aud_reinit;
extern bool atv_audio_overmodulated_en;
extern unsigned int non_std_en;
enum broadcast_standard_e {
ATVDEMOD_STD_NTSC = 0,