}
+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)
{
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:
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
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);
/*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);
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 */