linux/drivers/media/usb/dvb-usb-v2/mxl111sf-demod.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  mxl111sf-demod.c - driver for the MaxLinear MXL111SF DVB-T demodulator
 *
 *  Copyright (C) 2010-2014 Michael Krufky <[email protected]>
 */

#include "mxl111sf-demod.h"
#include "mxl111sf-reg.h"

/* debug */
static int mxl111sf_demod_debug;
module_param_named(debug, mxl111sf_demod_debug, int, 0644);
MODULE_PARM_DESC();

#define mxl_dbg(fmt, arg...)

/* ------------------------------------------------------------------------ */

struct mxl111sf_demod_state {};

/* ------------------------------------------------------------------------ */

static int mxl111sf_demod_read_reg(struct mxl111sf_demod_state *state,
				   u8 addr, u8 *data)
{}

static int mxl111sf_demod_write_reg(struct mxl111sf_demod_state *state,
				    u8 addr, u8 data)
{}

static
int mxl111sf_demod_program_regs(struct mxl111sf_demod_state *state,
				struct mxl111sf_reg_ctrl_info *ctrl_reg_info)
{}

/* ------------------------------------------------------------------------ */
/* TPS */

static
int mxl1x1sf_demod_get_tps_code_rate(struct mxl111sf_demod_state *state,
				     enum fe_code_rate *code_rate)
{}

static
int mxl1x1sf_demod_get_tps_modulation(struct mxl111sf_demod_state *state,
				      enum fe_modulation *modulation)
{}

static
int mxl1x1sf_demod_get_tps_guard_fft_mode(struct mxl111sf_demod_state *state,
					  enum fe_transmit_mode *fft_mode)
{}

static
int mxl1x1sf_demod_get_tps_guard_interval(struct mxl111sf_demod_state *state,
					  enum fe_guard_interval *guard)
{}

static
int mxl1x1sf_demod_get_tps_hierarchy(struct mxl111sf_demod_state *state,
				     enum fe_hierarchy *hierarchy)
{}

/* ------------------------------------------------------------------------ */
/* LOCKS */

static
int mxl1x1sf_demod_get_sync_lock_status(struct mxl111sf_demod_state *state,
					int *sync_lock)
{}

static
int mxl1x1sf_demod_get_rs_lock_status(struct mxl111sf_demod_state *state,
				      int *rs_lock)
{}

static
int mxl1x1sf_demod_get_tps_lock_status(struct mxl111sf_demod_state *state,
				       int *tps_lock)
{}

static
int mxl1x1sf_demod_get_fec_lock_status(struct mxl111sf_demod_state *state,
				       int *fec_lock)
{}

#if 0
static
int mxl1x1sf_demod_get_cp_lock_status(struct mxl111sf_demod_state *state,
				      int *cp_lock)
{
	u8 val = 0;
	int ret = mxl111sf_demod_read_reg(state, V6_CP_LOCK_DET_REG, &val);
	if (mxl_fail(ret))
		goto fail;
	*cp_lock = (val & V6_CP_LOCK_DET_MASK) >> 2;
fail:
	return ret;
}
#endif

static int mxl1x1sf_demod_reset_irq_status(struct mxl111sf_demod_state *state)
{}

/* ------------------------------------------------------------------------ */

static int mxl111sf_demod_set_frontend(struct dvb_frontend *fe)
{}

/* ------------------------------------------------------------------------ */

#if 0
/* resets TS Packet error count */
/* After setting 7th bit of V5_PER_COUNT_RESET_REG, it should be reset to 0. */
static
int mxl1x1sf_demod_reset_packet_error_count(struct mxl111sf_demod_state *state)
{
	struct mxl111sf_reg_ctrl_info reset_per_count[] = {
		{0x20, 0x01, 0x01},
		{0x20, 0x01, 0x00},
		{0,    0,    0}
	};
	return mxl111sf_demod_program_regs(state, reset_per_count);
}
#endif

/* returns TS Packet error count */
/* PER Count = FEC_PER_COUNT * (2 ** (FEC_PER_SCALE * 4)) */
static int mxl111sf_demod_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{}

#ifdef MXL111SF_DEMOD_ENABLE_CALCULATIONS
/* FIXME: leaving this enabled breaks the build on some architectures,
 * and we shouldn't have any floating point math in the kernel, anyway.
 *
 * These macros need to be re-written, but it's harmless to simply
 * return zero for now. */
#define CALCULATE_BER
#define CALCULATE_SNR
#else
#define CALCULATE_BER(avg_errors, count)
#define CALCULATE_SNR(data)
#endif

static int mxl111sf_demod_read_ber(struct dvb_frontend *fe, u32 *ber)
{}

static int mxl111sf_demod_calc_snr(struct mxl111sf_demod_state *state,
				   u16 *snr)
{}

static int mxl111sf_demod_read_snr(struct dvb_frontend *fe, u16 *snr)
{}

static int mxl111sf_demod_read_status(struct dvb_frontend *fe,
				      enum fe_status *status)
{}

static int mxl111sf_demod_read_signal_strength(struct dvb_frontend *fe,
					       u16 *signal_strength)
{}

static int mxl111sf_demod_get_frontend(struct dvb_frontend *fe,
				       struct dtv_frontend_properties *p)
{}

static
int mxl111sf_demod_get_tune_settings(struct dvb_frontend *fe,
				     struct dvb_frontend_tune_settings *tune)
{}

static void mxl111sf_demod_release(struct dvb_frontend *fe)
{}

static const struct dvb_frontend_ops mxl111sf_demod_ops =;

struct dvb_frontend *mxl111sf_demod_attach(struct mxl111sf_state *mxl_state,
				   const struct mxl111sf_demod_config *cfg)
{}
EXPORT_SYMBOL_GPL();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_VERSION();