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)\
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 */
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);
}
#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
}
}
+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;
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);