Lines Matching +full:audio +full:- +full:core
1 // SPDX-License-Identifier: GPL-2.0-or-later
9 #include "cx88-reg.h"
27 * based on the the sampling rate of the audio rds fifo.
38 * for the input of the audio rds fifo, and measure it's sampling rate to
62 MODULE_PARM_DESC(dsp_debug, "enable audio dsp debug messages");
77 return -int_cos(x - INT_PI); in int_cos()
80 return -int_cos(INT_PI / 2 - (x % (INT_PI / 2))); in int_cos()
89 ret = 32768 - t2 + t4 - t6 + t8; in int_cos()
108 s32 s = x[i] + ((s64)coeff * s_prev / 32768) - s_prev2; in int_goertzel()
114 tmp = (s64)s_prev2 * s_prev2 + (s64)s_prev * s_prev - in int_goertzel()
143 x += (N - 192); in noise_magnitude()
147 freq_step = (freq_end - freq_start) / (samples - 1); in noise_magnitude()
157 static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N) in detect_a2_a2m_eiaj() argument
163 switch (core->tvaudio) { in detect_a2_a2m_eiaj()
181 pr_warn("unsupported audio mode %d for %s\n", in detect_a2_a2m_eiaj()
182 core->tvaudio, __func__); in detect_a2_a2m_eiaj()
200 if (core->tvaudio == WW_EIAJ) { in detect_a2_a2m_eiaj()
224 static s32 detect_btsc(struct cx88_core *core, s16 x[], u32 N) in detect_btsc() argument
237 static s16 *read_rds_samples(struct cx88_core *core, u32 *N) in read_rds_samples() argument
243 unsigned int bpl = srch->fifo_size / AUD_RDS_LINES; in read_rds_samples()
245 unsigned int sample_count = spl * (AUD_RDS_LINES - 1); in read_rds_samples()
247 u32 current_address = cx_read(srch->ptr1_reg); in read_rds_samples()
248 u32 offset = (current_address - srch->fifo_start + bpl); in read_rds_samples()
253 current_address - srch->fifo_start, sample_count, in read_rds_samples()
263 samples[i] = cx_read(srch->fifo_start + offset); in read_rds_samples()
272 s32 cx88_dsp_detect_stereo_sap(struct cx88_core *core) in cx88_dsp_detect_stereo_sap() argument
278 /* If audio RDS fifo is disabled, we can't read the samples */ in cx88_dsp_detect_stereo_sap()
284 /* Wait at least 500 ms after an audio standard change */ in cx88_dsp_detect_stereo_sap()
285 if (time_before(jiffies, core->last_change + msecs_to_jiffies(500))) in cx88_dsp_detect_stereo_sap()
288 samples = read_rds_samples(core, &N); in cx88_dsp_detect_stereo_sap()
293 switch (core->tvaudio) { in cx88_dsp_detect_stereo_sap()
298 ret = detect_a2_a2m_eiaj(core, samples, N); in cx88_dsp_detect_stereo_sap()
301 ret = detect_btsc(core, samples, N); in cx88_dsp_detect_stereo_sap()