DEBUGFS_CREATE_NODE(atvdemod_timer_delay2, 0640, dentry, u32)\
DEBUGFS_CREATE_NODE(atvdemod_mixer_tune_en, 0640, dentry, bool)\
DEBUGFS_CREATE_NODE(atvdemod_overmodulated_en, 0640, dentry, bool)\
+ DEBUGFS_CREATE_NODE(atv_audio_overmodulated_en, 0640, dentry, bool)\
DEBUGFS_CREATE_NODE(audio_thd_en, 0640, dentry, bool)\
DEBUGFS_CREATE_NODE(pwm_kp, 0640, dentry, u32)\
DEBUGFS_CREATE_NODE(audio_gain_val, 0640, dentry, u32)\
DEBUGFS_CREATE_FILE(sum2_thd_h, 0640, dentry, fops, int)\
DEBUGFS_CREATE_FILE(sum2_thd_l, 0640, dentry, fops, int)\
DEBUGFS_CREATE_FILE(afc_default, 0640, dentry, fops, int)\
+ DEBUGFS_CREATE_FILE(snr_threshold, 0640, dentry, fops, int)\
}
DEBUGFS_DENTRY_DEFINE(sum2_thd_h);
DEBUGFS_DENTRY_DEFINE(sum2_thd_l);
DEBUGFS_DENTRY_DEFINE(afc_default);
+DEBUGFS_DENTRY_DEFINE(snr_threshold);
struct dentry_value *debugfs_dentry[] = {
DEBUGFS_DENTRY_VALUE(non_std_thld_4c_h),
DEBUGFS_DENTRY_VALUE(sum2_thd_h),
DEBUGFS_DENTRY_VALUE(sum2_thd_l),
DEBUGFS_DENTRY_VALUE(afc_default),
+ DEBUGFS_DENTRY_VALUE(snr_threshold),
};
static int debugfs_open(struct inode *node, struct file *file)
bool atvdemod_mixer_tune_en;
bool atvdemod_overmodulated_en;
+bool atv_audio_overmodulated_en;
bool audio_det_en;
bool atvdemod_det_snr_en = true;
bool audio_thd_en = true;
retrieve_vpll_carrier_lock(&vpll_lock);
retrieve_vpll_carrier_line_lock(&line_lock);
- if ((vpll_lock != 0) || (line_lock != 0))
+ if ((vpll_lock != 0) || (line_lock != 0)) {
+ monitor->lock_cnt = 0;
return;
+ }
+
+ monitor->lock_cnt++;
if (atvdemod_mixer_tune_en)
atvdemod_mixer_tune();
if (atvdemod_overmodulated_en)
atvdemod_video_overmodulated();
+ if (atv_audio_overmodulated_en) {
+ if (monitor->lock_cnt % 10 == 0)
+ aml_audio_overmodulation(1);
+ }
+
if (atvdemod_det_snr_en)
atvdemod_det_snr_serice();
ATVDEMOD_INTERVAL * atvdemod_timer_delay;
add_timer(&monitor->timer);
monitor->state = true;
+ monitor->lock_cnt = 0;
}
mutex_unlock(&monitor->mtx);
monitor->state = false;
monitor->lock = false;
+ monitor->lock_cnt = 0;
monitor->disable = atv_demod_monitor_disable;
monitor->enable = atv_demod_monitor_enable;
unsigned int audio_a2_auto = 1;
unsigned int audio_a2_power_threshold = 0x1800;
-unsigned int audio_a2_carrier_report = 0x600;
+unsigned int audio_a2_carrier_report = 0xc00;
static int last_nicam_lock = -1;
static int last_nicam_mono_flag = -1;
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
adec_wr_reg((ADDR_SEL_CTRL), 0x1000);
}
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
}
void set_a2bg(void)
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
}
void set_a2dk1(void)
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
}
void set_a2dk2(void)
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
}
void set_a2dk3(void)
adec_wr_reg(ADDR_LPR_GAIN_ADJ, 0x3e0);
adec_wr_reg(ADDR_LPR_COMP_CTRL, 0x010);
- adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xd65d7f7f);
+ adec_wr_reg(ADDR_IIR_SPEED_CTRL, 0xff5d7f7f/*0xd65d7f7f*/);
+ adec_wr_reg(STEREO_DET_THD, 0x4000);
+ adec_wr_reg(DUAL_DET_THD, 0x4000);
}
void set_eiaj(void)
void update_a2_eiaj_mode(int auto_en, int *stereo_flag, int *dual_flag)
{
- uint32_t reg_value;
- uint32_t stereo_power, dual_power;
+ uint32_t reg_value = 0;
+ uint32_t stereo_power = 0, dual_power = 0;
msleep(a2_detect_delay);
if (auto_en) {
reg_value = adec_rd_reg(CARRIER_MAG_REPORT);
+ pr_info("%s CARRIER_MAG_REPORT: 0x%x [threshold: 0x%x].\n",
+ __func__, reg_value, audio_a2_carrier_report);
if (((reg_value >> 16) & 0xffff) < audio_a2_carrier_report) {
*stereo_flag = 0;
*dual_flag = 0;
}
} else {
reg_value = adec_rd_reg(POWER_REPORT);
+ pr_info("%s POWER_REPORT: 0x%x [threshold: 0x%x].\n",
+ __func__, reg_value, audio_a2_power_threshold);
stereo_power = reg_value & 0xffff;
dual_power = (reg_value >> 16) & 0xffff;