linux/drivers/media/pci/cx88/cx88-dsp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  Stereo and SAP detection for cx88
 *
 *  Copyright (c) 2009 Marton Balint <[email protected]>
 */

#include "cx88.h"
#include "cx88-reg.h"

#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/jiffies.h>
#include <asm/div64.h>

#define INT_PI

#define compat_remainder(a, b)

#define baseband_freq(carrier, srate, tone)

/*
 * We calculate the baseband frequencies of the carrier and the pilot tones
 * based on the sampling rate of the audio rds fifo.
 */

#define FREQ_A2_CARRIER
#define FREQ_A2_DUAL
#define FREQ_A2_STEREO

/*
 * The frequencies below are from the reference driver. They probably need
 * further adjustments, because they are not tested at all. You may even need
 * to play a bit with the registers of the chip to select the proper signal
 * for the input of the audio rds fifo, and measure it's sampling rate to
 * calculate the proper baseband frequencies...
 */

#define FREQ_A2M_CARRIER
#define FREQ_A2M_DUAL
#define FREQ_A2M_STEREO

#define FREQ_EIAJ_CARRIER
#define FREQ_EIAJ_DUAL
#define FREQ_EIAJ_STEREO

#define FREQ_BTSC_DUAL
#define FREQ_BTSC_DUAL_REF

#define FREQ_BTSC_SAP
#define FREQ_BTSC_SAP_REF

/* The spectrum of the signal should be empty between these frequencies. */
#define FREQ_NOISE_START
#define FREQ_NOISE_END

static unsigned int dsp_debug;
module_param(dsp_debug, int, 0644);
MODULE_PARM_DESC();

#define dprintk(level, fmt, arg...)

static s32 int_cos(u32 x)
{}

static u32 int_goertzel(s16 x[], u32 N, u32 freq)
{}

static u32 freq_magnitude(s16 x[], u32 N, u32 freq)
{}

static u32 noise_magnitude(s16 x[], u32 N, u32 freq_start, u32 freq_end)
{}

static s32 detect_a2_a2m_eiaj(struct cx88_core *core, s16 x[], u32 N)
{}

static s32 detect_btsc(struct cx88_core *core, s16 x[], u32 N)
{}

static s16 *read_rds_samples(struct cx88_core *core, u32 *N)
{}

s32 cx88_dsp_detect_stereo_sap(struct cx88_core *core)
{}
EXPORT_SYMBOL();