mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
atv_demod: Add audio carrier offset detect [1/1]
PD#TV-2564 Problem: Torture room teset report SND0810 sound carrier deviation Solution: Add audio carrier offset detect Verify: verified by x301 Change-Id: I2d715891fb268452f95e05f998864e9b7321ff38 Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
committed by
Jianxin Pan
parent
2a95ff7fcd
commit
7068b634a1
@@ -57,6 +57,7 @@
|
||||
DEBUGFS_CREATE_NODE(over_threshold, 0640, dentry, u64)\
|
||||
DEBUGFS_CREATE_NODE(input_amplitude, 0640, dentry, u64)\
|
||||
DEBUGFS_CREATE_NODE(atvaudio_det_outputmode_en, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(audio_carrier_offset_det_en, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(audio_det_en, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(non_std_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_det_nonstd_en, 0640, dentry, bool)\
|
||||
|
||||
@@ -34,6 +34,7 @@ bool atvdemod_det_snr_en = true;
|
||||
bool audio_thd_en = true;
|
||||
bool atvdemod_det_nonstd_en;
|
||||
bool atvaudio_det_outputmode_en = true;
|
||||
bool audio_carrier_offset_det_en;
|
||||
|
||||
unsigned int atvdemod_timer_delay = 100; /* 1s */
|
||||
unsigned int atvdemod_timer_delay2 = 10; /* 100ms */
|
||||
@@ -70,6 +71,9 @@ static void atv_demod_monitor_do_work(struct work_struct *work)
|
||||
if (atvaudio_det_outputmode_en)
|
||||
atvauddemod_set_outputmode();
|
||||
|
||||
if (audio_carrier_offset_det_en)
|
||||
audio_carrier_offset_det();
|
||||
|
||||
if (atvdemod_det_nonstd_en)
|
||||
atv_dmd_non_std_set(true);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,12 @@ static int last_mode = -1;
|
||||
#undef pr_info
|
||||
#define pr_info(args...)\
|
||||
do {\
|
||||
if (ademod_debug_en)\
|
||||
if (ademod_debug_en & 0x1)\
|
||||
printk(args);\
|
||||
} while (0)
|
||||
#define pr_carr(args...)\
|
||||
do {\
|
||||
if (ademod_debug_en & 0x2)\
|
||||
printk(args);\
|
||||
} while (0)
|
||||
#undef pr_dbg
|
||||
@@ -1469,6 +1474,37 @@ void audio_thd_det(void)
|
||||
}
|
||||
}
|
||||
|
||||
void audio_carrier_offset_det(void)
|
||||
{
|
||||
unsigned int carrier_freq = 0, report = 0;
|
||||
int threshold = 0;
|
||||
|
||||
report = adec_rd_reg(DC_REPORT);
|
||||
carrier_freq = adec_rd_reg(ADDR_DDC_FREQ0);
|
||||
|
||||
pr_carr("\n\nreport: 0x%x.\n", report);
|
||||
pr_carr("read carrier_freq: 0x%x.\n", carrier_freq);
|
||||
report = report & 0xFFFF;
|
||||
|
||||
if (report > (1 << 15))
|
||||
threshold = report - (1 << 16);
|
||||
else
|
||||
threshold = report;
|
||||
|
||||
threshold = threshold >> 8;
|
||||
pr_carr("threshold: %d.\n", threshold);
|
||||
|
||||
if (threshold > 30) {
|
||||
carrier_freq = carrier_freq - 0x100;
|
||||
adec_wr_reg(ADDR_DDC_FREQ0, carrier_freq);
|
||||
} else if (threshold < -30) {
|
||||
carrier_freq = carrier_freq + 0x100;
|
||||
adec_wr_reg(ADDR_DDC_FREQ0, carrier_freq);
|
||||
}
|
||||
|
||||
pr_carr("write carrier_freq: 0x%x.\n", carrier_freq);
|
||||
}
|
||||
|
||||
void set_outputmode_status_init(void)
|
||||
{
|
||||
last_nicam_lock = -1;
|
||||
|
||||
@@ -32,6 +32,7 @@ void configure_adec(int Audio_mode);
|
||||
void adec_soft_reset(void);
|
||||
void audio_thd_init(void);
|
||||
void audio_thd_det(void);
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user