mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
atv_demod: add nicam detection when current signal fm-mono change to nicam [1/1]
PD#TV-7335 Problem: add nicam detection when current signal fm-mono change to nicam. Solution: 1.add nicam detection when current signal fm-mono change to nicam. Verify: Verified by x301 Change-Id: If2e35d018d2df803c5458cc93974352b06e90a11 Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
@@ -1100,6 +1100,17 @@ void update_btsc_mode(int auto_en, int *stereo_flag, int *sap_flag)
|
||||
|
||||
}
|
||||
|
||||
int get_nicam_lock_status(void)
|
||||
{
|
||||
uint32_t reg_value = 0;
|
||||
|
||||
reg_value = adec_rd_reg(NICAM_LEVEL_REPORT);
|
||||
|
||||
pr_info("%s nicam_lock:%d\n", __func__, ((reg_value >> 28) & 1));
|
||||
|
||||
return ((reg_value >> 28) & 1);
|
||||
}
|
||||
|
||||
void update_nicam_mode(int *nicam_flag, int *nicam_mono_flag,
|
||||
int *nicam_stereo_flag, int *nicam_dual_flag)
|
||||
{
|
||||
@@ -1545,6 +1556,18 @@ void set_outputmode(uint32_t standard, uint32_t outmode)
|
||||
adec_wr_reg(DUAL_DET_THD, 0x4000);
|
||||
}
|
||||
|
||||
/* for FM MONO system to detection nicam status */
|
||||
if (!aud_reinit && get_nicam_lock_status()) {
|
||||
if (standard == AUDIO_STANDARD_A2_DK1
|
||||
|| standard == AUDIO_STANDARD_A2_DK1
|
||||
|| standard == AUDIO_STANDARD_A2_DK3)
|
||||
aud_std = AUDIO_STANDARD_NICAM_DK;
|
||||
else if (standard == AUDIO_STANDARD_A2_BG)
|
||||
aud_std = AUDIO_STANDARD_NICAM_BG;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
set_a2_eiaj_outputmode(outmode);
|
||||
break;
|
||||
case AUDIO_STANDARD_NICAM_DK:
|
||||
@@ -1552,6 +1575,17 @@ void set_outputmode(uint32_t standard, uint32_t outmode)
|
||||
case AUDIO_STANDARD_NICAM_BG:
|
||||
case AUDIO_STANDARD_NICAM_L:
|
||||
set_nicam_outputmode(outmode);
|
||||
break;
|
||||
case AUDIO_STANDARD_MONO_I:
|
||||
case AUDIO_STANDARD_MONO_L:
|
||||
/* for FM MONO system to detection nicam status */
|
||||
if (!aud_reinit && get_nicam_lock_status()) {
|
||||
if (standard == AUDIO_STANDARD_MONO_I)
|
||||
aud_std = AUDIO_STANDARD_NICAM_I;
|
||||
else if (standard == AUDIO_STANDARD_MONO_L)
|
||||
aud_std = AUDIO_STANDARD_NICAM_L;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,7 @@ void audio_carrier_offset_det(void);
|
||||
void set_nicam_outputmode(uint32_t outmode);
|
||||
void set_a2_eiaj_outputmode(uint32_t outmode);
|
||||
void set_btsc_outputmode(uint32_t outmode);
|
||||
int get_nicam_lock_status(void);
|
||||
void update_nicam_mode(int *nicam_flag, int *nicam_mono_flag,
|
||||
int *nicam_stereo_flag, int *nicam_dual_flag);
|
||||
void update_btsc_mode(int auto_en, int *stereo_flag, int *sap_flag);
|
||||
|
||||
@@ -1321,7 +1321,7 @@ void configure_receiver(int Broadcast_Standard, unsigned int Tuner_IF_Frequency,
|
||||
|
||||
/*PWM*/
|
||||
pr_dbg("ATV-DMD configure pwm\n");
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x00, 0x1f40); /*4KHz*/
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x00, 0x1f40); /*4KHz*/
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x04, 0xc8);
|
||||
/*26 dB dynamic range*/
|
||||
atv_dmd_wr_byte(APB_BLOCK_ADDR_AGC_PWM, 0x09, 0xa);
|
||||
@@ -1330,7 +1330,7 @@ void configure_receiver(int Broadcast_Standard, unsigned int Tuner_IF_Frequency,
|
||||
amlatvdemod_devp->tuners[amlatvdemod_devp->tuner_cur].cfg.id
|
||||
== AM_TUNER_R842) {
|
||||
/*config pwm for tuner r840*/
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0, 0xc80);
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0, 0xc80); /*10KHz*/
|
||||
/* guanzhong for Tuner AGC shock */
|
||||
atv_dmd_wr_long(APB_BLOCK_ADDR_AGC_PWM, 0x08, 0x46180200);
|
||||
/* atv_dmd_wr_byte(APB_BLOCK_ADDR_ADC_SE,1,0xf);//Kd = 0xf */
|
||||
|
||||
Reference in New Issue
Block a user