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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    Conexant cx24117/cx24132 - Dual DVBS/S2 Satellite demod/tuner driver

    Copyright (C) 2013 Luis Alves <[email protected]>
	July, 6th 2013
	    First release based on cx24116 driver by:
	    Steven Toth and Georg Acher, Darron Broad, Igor Liplianin
	    Cards currently supported:
		TBS6980 - Dual DVBS/S2 PCIe card
		TBS6981 - Dual DVBS/S2 PCIe card

*/

#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 "tuner-i2c.h"
#include <media/dvb_frontend.h>
#include "cx24117.h"


#define CX24117_DEFAULT_FIRMWARE
#define CX24117_SEARCH_RANGE_KHZ

/* known registers */
#define CX24117_REG_COMMAND
#define CX24117_REG_EXECUTE

#define CX24117_REG_FREQ3_0
#define CX24117_REG_FREQ2_0
#define CX24117_REG_FREQ1_0
#define CX24117_REG_STATE0
#define CX24117_REG_SSTATUS0
#define CX24117_REG_SIGNAL0
#define CX24117_REG_FREQ5_0
#define CX24117_REG_FREQ6_0
#define CX24117_REG_SRATE2_0
#define CX24117_REG_SRATE1_0
#define CX24117_REG_QUALITY2_0
#define CX24117_REG_QUALITY1_0

#define CX24117_REG_BER4_0
#define CX24117_REG_BER3_0
#define CX24117_REG_BER2_0
#define CX24117_REG_BER1_0
#define CX24117_REG_DVBS_UCB2_0
#define CX24117_REG_DVBS_UCB1_0
#define CX24117_REG_DVBS2_UCB2_0
#define CX24117_REG_DVBS2_UCB1_0
#define CX24117_REG_QSTATUS0
#define CX24117_REG_CLKDIV0
#define CX24117_REG_RATEDIV0


#define CX24117_REG_FREQ3_1
#define CX24117_REG_FREQ2_1
#define CX24117_REG_FREQ1_1
#define CX24117_REG_STATE1
#define CX24117_REG_SSTATUS1
#define CX24117_REG_SIGNAL1
#define CX24117_REG_FREQ5_1
#define CX24117_REG_FREQ4_1
#define CX24117_REG_SRATE2_1
#define CX24117_REG_SRATE1_1
#define CX24117_REG_QUALITY2_1
#define CX24117_REG_QUALITY1_1
#define CX24117_REG_BER4_1
#define CX24117_REG_BER3_1
#define CX24117_REG_BER2_1
#define CX24117_REG_BER1_1
#define CX24117_REG_DVBS_UCB2_1
#define CX24117_REG_DVBS_UCB1_1
#define CX24117_REG_DVBS2_UCB2_1
#define CX24117_REG_DVBS2_UCB1_1
#define CX24117_REG_QSTATUS1
#define CX24117_REG_CLKDIV1
#define CX24117_REG_RATEDIV1


/* arg buffer size */
#define CX24117_ARGLEN

/* rolloff */
#define CX24117_ROLLOFF_020
#define CX24117_ROLLOFF_025
#define CX24117_ROLLOFF_035

/* pilot bit */
#define CX24117_PILOT_OFF
#define CX24117_PILOT_ON
#define CX24117_PILOT_AUTO

/* signal status */
#define CX24117_HAS_SIGNAL
#define CX24117_HAS_CARRIER
#define CX24117_HAS_VITERBI
#define CX24117_HAS_SYNCLOCK
#define CX24117_STATUS_MASK
#define CX24117_SIGNAL_MASK


/* arg offset for DiSEqC */
#define CX24117_DISEQC_DEMOD
#define CX24117_DISEQC_BURST
#define CX24117_DISEQC_ARG3_2
#define CX24117_DISEQC_ARG4_0
#define CX24117_DISEQC_ARG5_0
#define CX24117_DISEQC_MSGLEN
#define CX24117_DISEQC_MSGOFS

/* DiSEqC burst */
#define CX24117_DISEQC_MINI_A
#define CX24117_DISEQC_MINI_B


#define CX24117_PNE
#define CX24117_OCC


enum cmds {};

static LIST_HEAD(hybrid_tuner_instance_list);
static DEFINE_MUTEX(cx24117_list_mutex);

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

/* Basic commands that are sent to the firmware */
struct cx24117_cmd {};

/* common to both fe's */
struct cx24117_priv {};

/* one per each fe */
struct cx24117_state {};

/* modfec (modulation and FEC) lookup table */
/* Check cx24116.c for a detailed description of each field */
static struct cx24117_modfec {} cx24117_modfec_modes[] =;


static int cx24117_writereg(struct cx24117_state *state, u8 reg, u8 data)
{}

static int cx24117_writecmd(struct cx24117_state *state,
	struct cx24117_cmd *cmd)
{}

static int cx24117_readreg(struct cx24117_state *state, u8 reg)
{}

static int cx24117_readregN(struct cx24117_state *state,
	u8 reg, u8 *buf, int len)
{}

static int cx24117_set_inversion(struct cx24117_state *state,
	enum fe_spectral_inversion inversion)
{}

static int cx24117_lookup_fecmod(struct cx24117_state *state,
	enum fe_delivery_system d, enum fe_modulation m, enum fe_code_rate f)
{}

static int cx24117_set_fec(struct cx24117_state *state,
			   enum fe_delivery_system delsys,
			   enum fe_modulation mod,
			   enum fe_code_rate fec)
{}

static int cx24117_set_symbolrate(struct cx24117_state *state, u32 rate)
{}

static int cx24117_load_firmware(struct dvb_frontend *fe,
	const struct firmware *fw);

static int cx24117_firmware_ondemand(struct dvb_frontend *fe)
{}

/* Take a basic firmware command structure, format it
 * and forward it for processing
 */
static int cx24117_cmd_execute_nolock(struct dvb_frontend *fe,
	struct cx24117_cmd *cmd)
{}

static int cx24117_cmd_execute(struct dvb_frontend *fe, struct cx24117_cmd *cmd)
{}

static int cx24117_load_firmware(struct dvb_frontend *fe,
	const struct firmware *fw)
{}

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

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

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

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

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

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

/* Wait for LNB */
static int cx24117_wait_for_lnb(struct dvb_frontend *fe)
{}

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

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

/* Initialise DiSEqC */
static int cx24117_diseqc_init(struct dvb_frontend *fe)
{}

/* Send DiSEqC message */
static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
	struct dvb_diseqc_master_cmd *d)
{}

/* Send DiSEqC burst */
static int cx24117_diseqc_send_burst(struct dvb_frontend *fe,
	enum fe_sec_mini_cmd burst)
{}

static int cx24117_get_priv(struct cx24117_priv **priv,
	struct i2c_adapter *i2c, u8 client_address)
{}

static void cx24117_release_priv(struct cx24117_priv *priv)
{}

static void cx24117_release(struct dvb_frontend *fe)
{}

static const struct dvb_frontend_ops cx24117_ops;

struct dvb_frontend *cx24117_attach(const struct cx24117_config *config,
	struct i2c_adapter *i2c)
{}
EXPORT_SYMBOL_GPL();

/*
 * Initialise or wake up device
 *
 * Power config will reset and load initial firmware if required
 */
static int cx24117_initfe(struct dvb_frontend *fe)
{}

/*
 * Put device to sleep
 */
static int cx24117_sleep(struct dvb_frontend *fe)
{}

/* dvb-core told us to tune, the tv property cache will be complete,
 * it's safe for is to pull values and use them for tuning purposes.
 */
static int cx24117_set_frontend(struct dvb_frontend *fe)
{}

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

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

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

static const struct dvb_frontend_ops cx24117_ops =;


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