linux/drivers/media/dvb-frontends/cx24120.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    Conexant cx24120/cx24118 - DVBS/S2 Satellite demod/tuner driver

    Copyright (C) 2008 Patrick Boettcher <[email protected]>
    Copyright (C) 2009 Sergey Tyurin <forum.free-x.de>
    Updated 2012 by Jannis Achstetter <[email protected]>
    Copyright (C) 2015 Jemma Denson <[email protected]>
	April 2015
	    Refactored & simplified driver
	    Updated to work with delivery system supplied by DVBv5
	    Add frequency, fec & pilot to get_frontend

	Cards supported: Technisat Skystar S2

*/

#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/firmware.h>
#include <media/dvb_frontend.h>
#include "cx24120.h"

#define CX24120_SEARCH_RANGE_KHZ
#define CX24120_FIRMWARE

/* cx24120 i2c registers  */
#define CX24120_REG_CMD_START
#define CX24120_REG_CMD_ARGS
#define CX24120_REG_CMD_END

#define CX24120_REG_MAILBOX
#define CX24120_REG_FREQ3
#define CX24120_REG_FREQ2
#define CX24120_REG_FREQ1

#define CX24120_REG_FECMODE
#define CX24120_REG_STATUS
#define CX24120_REG_SIGSTR_H
#define CX24120_REG_SIGSTR_L
#define CX24120_REG_QUALITY_H
#define CX24120_REG_QUALITY_L

#define CX24120_REG_BER_HH
#define CX24120_REG_BER_HL
#define CX24120_REG_BER_LH
#define CX24120_REG_BER_LL

#define CX24120_REG_UCB_H
#define CX24120_REG_UCB_L

#define CX24120_REG_CLKDIV
#define CX24120_REG_RATEDIV

#define CX24120_REG_REVISION

/* Command messages */
enum command_message_id {};

#define CX24120_MAX_CMD_LEN

/* pilot mask */
#define CX24120_PILOT_OFF
#define CX24120_PILOT_ON
#define CX24120_PILOT_AUTO

/* signal status */
#define CX24120_HAS_SIGNAL
#define CX24120_HAS_CARRIER
#define CX24120_HAS_VITERBI
#define CX24120_HAS_LOCK
#define CX24120_HAS_UNK1
#define CX24120_HAS_UNK2
#define CX24120_STATUS_MASK
#define CX24120_SIGNAL_MASK

/* ber window */
#define CX24120_BER_WINDOW
#define CX24120_BER_WSIZE

#define info(args...)
#define err(args...)

/* The Demod/Tuner can't easily provide these, we cache them */
struct cx24120_tuning {};

/* Private state */
struct cx24120_state {};

/* Command message to firmware */
struct cx24120_cmd {};

/* Read single register */
static int cx24120_readreg(struct cx24120_state *state, u8 reg)
{}

/* Write single register */
static int cx24120_writereg(struct cx24120_state *state, u8 reg, u8 data)
{}

/* Write multiple registers in chunks of i2c_wr_max-sized buffers */
static int cx24120_writeregs(struct cx24120_state *state,
			     u8 reg, const u8 *values, u16 len, u8 incr)
{}

static const struct dvb_frontend_ops cx24120_ops;

struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
				    struct i2c_adapter *i2c)
{}
EXPORT_SYMBOL_GPL();

static int cx24120_test_rom(struct cx24120_state *state)
{}

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

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

static int cx24120_msg_mpeg_output_global_config(struct cx24120_state *state,
						 u8 flag);

/* Check if we're running a command that needs to disable mpeg out */
static void cx24120_check_cmd(struct cx24120_state *state, u8 id)
{}

/* Send a message to the firmware */
static int cx24120_message_send(struct cx24120_state *state,
				struct cx24120_cmd *cmd)
{}

/* Send a message and fill arg[] with the results */
static int cx24120_message_sendrcv(struct cx24120_state *state,
				   struct cx24120_cmd *cmd, u8 numreg)
{}

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

static int cx24120_msg_mpeg_output_global_config(struct cx24120_state *state,
						 u8 enable)
{}

static int cx24120_msg_mpeg_output_config(struct cx24120_state *state, u8 seq)
{}

static int cx24120_diseqc_send_burst(struct dvb_frontend *fe,
				     enum fe_sec_mini_cmd burst)
{}

static int cx24120_set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone)
{}

static int cx24120_set_voltage(struct dvb_frontend *fe,
			       enum fe_sec_voltage voltage)
{}

static int cx24120_send_diseqc_msg(struct dvb_frontend *fe,
				   struct dvb_diseqc_master_cmd *d)
{}

static void cx24120_get_stats(struct cx24120_state *state)
{}

static void cx24120_set_clock_ratios(struct dvb_frontend *fe);

/* Read current tuning status */
static int cx24120_read_status(struct dvb_frontend *fe, enum fe_status *status)
{}

/*
 * FEC & modulation lookup table
 * Used for decoding the REG_FECMODE register
 * once tuned in.
 */
struct cx24120_modfec {};

static const struct cx24120_modfec modfec_lookup_table[] =;

/* Retrieve current fec, modulation & pilot values */
static int cx24120_get_fec(struct dvb_frontend *fe)
{}

/* Calculate ber window time */
static void cx24120_calculate_ber_window(struct cx24120_state *state, u32 rate)
{}

/*
 * Clock ratios lookup table
 *
 * Values obtained from much larger table in old driver
 * which had numerous entries which would never match.
 *
 * There's probably some way of calculating these but I
 * can't determine the pattern
 */
struct cx24120_clock_ratios_table {};

static const struct cx24120_clock_ratios_table clock_ratios_table[] =;

/* Set clock ratio from lookup table */
static void cx24120_set_clock_ratios(struct dvb_frontend *fe)
{}

/* Set inversion value */
static int cx24120_set_inversion(struct cx24120_state *state,
				 enum fe_spectral_inversion inversion)
{}

/* FEC lookup table for tuning */
struct cx24120_modfec_table {};

static const struct cx24120_modfec_table modfec_table[] =;

/* Set fec_val & fec_mask values from delsys, modulation & fec */
static int cx24120_set_fec(struct cx24120_state *state, enum fe_modulation mod,
			   enum fe_code_rate fec)
{}

/* Set pilot */
static int cx24120_set_pilot(struct cx24120_state *state, enum fe_pilot pilot)
{}

/* Set symbol rate */
static int cx24120_set_symbolrate(struct cx24120_state *state, u32 rate)
{}

/* Overwrite the current tuning params, we are about to tune */
static void cx24120_clone_params(struct dvb_frontend *fe)
{}

static int cx24120_set_frontend(struct dvb_frontend *fe)
{}

/* Set vco from config */
static int cx24120_set_vco(struct cx24120_state *state)
{}

static int cx24120_init(struct dvb_frontend *fe)
{}

static int cx24120_tune(struct dvb_frontend *fe, bool re_tune,
			unsigned int mode_flags, unsigned int *delay,
			enum fe_status *status)
{}

static enum dvbfe_algo cx24120_get_algo(struct dvb_frontend *fe)
{}

static int cx24120_sleep(struct dvb_frontend *fe)
{}

static int cx24120_get_frontend(struct dvb_frontend *fe,
				struct dtv_frontend_properties *c)
{}

static void cx24120_release(struct dvb_frontend *fe)
{}

static int cx24120_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{}

static const struct dvb_frontend_ops cx24120_ops =;

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