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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
	STB0899 Multistandard Frontend driver
	Copyright (C) Manu Abraham ([email protected])

	Copyright (C) ST Microelectronics

*/

#include <linux/init.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>

#include <linux/dvb/frontend.h>
#include <media/dvb_frontend.h>

#include "stb0899_drv.h"
#include "stb0899_priv.h"
#include "stb0899_reg.h"

/* Max transfer size done by I2C transfer functions */
#define MAX_XFER_SIZE

static unsigned int verbose =;//1;
module_param(verbose, int, 0644);

/* C/N in dB/10, NIRM/NIRL */
static const struct stb0899_tab stb0899_cn_tab[] =;

/* DVB-S AGCIQ_VALUE vs. signal level in dBm/10.
 * As measured, connected to a modulator.
 * -8.0 to -50.0 dBm directly connected,
 * -52.0 to -74.8 with extra attenuation.
 * Cut-off to AGCIQ_VALUE = 0x80 below -74.8dBm.
 * Crude linear extrapolation below -84.8dBm and above -8.0dBm.
 */
static const struct stb0899_tab stb0899_dvbsrf_tab[] =;

/* DVB-S2 IF_AGC_GAIN vs. signal level in dBm/10.
 * As measured, connected to a modulator.
 * -8.0 to -50.1 dBm directly connected,
 * -53.0 to -76.6 with extra attenuation.
 * Cut-off to IF_AGC_GAIN = 0x3fff below -76.6dBm.
 * Crude linear extrapolation below -76.6dBm and above -8.0dBm.
 */
static const struct stb0899_tab stb0899_dvbs2rf_tab[] =;

/* DVB-S2 Es/N0 quant in dB/100 vs read value * 100*/
static struct stb0899_tab stb0899_quant_tab[] =;

/* DVB-S2 Es/N0 estimate in dB/100 vs read value */
static struct stb0899_tab stb0899_est_tab[] =;

static int _stb0899_read_reg(struct stb0899_state *state, unsigned int reg)
{}

int stb0899_read_reg(struct stb0899_state *state, unsigned int reg)
{}

u32 _stb0899_read_s2reg(struct stb0899_state *state,
			u32 stb0899_i2cdev,
			u32 stb0899_base_addr,
			u16 stb0899_reg_offset)
{}

int stb0899_write_s2reg(struct stb0899_state *state,
			u32 stb0899_i2cdev,
			u32 stb0899_base_addr,
			u16 stb0899_reg_offset,
			u32 stb0899_data)
{}

int stb0899_read_regs(struct stb0899_state *state, unsigned int reg, u8 *buf, u32 count)
{}

int stb0899_write_regs(struct stb0899_state *state, unsigned int reg, u8 *data, u32 count)
{}

int stb0899_write_reg(struct stb0899_state *state, unsigned int reg, u8 data)
{}

/*
 * stb0899_get_mclk
 * Get STB0899 master clock frequency
 * ExtClk: external clock frequency (Hz)
 */
static u32 stb0899_get_mclk(struct stb0899_state *state)
{}

/*
 * stb0899_set_mclk
 * Set STB0899 master Clock frequency
 * Mclk: demodulator master clock
 * ExtClk: external clock frequency (Hz)
 */
static void stb0899_set_mclk(struct stb0899_state *state, u32 Mclk)
{}

static int stb0899_postproc(struct stb0899_state *state, u8 ctl, int enable)
{}

static void stb0899_detach(struct dvb_frontend *fe)
{}

static void stb0899_release(struct dvb_frontend *fe)
{}

/*
 * stb0899_get_alpha
 * return: rolloff
 */
static int stb0899_get_alpha(struct stb0899_state *state)
{}

/*
 * stb0899_init_calc
 */
static void stb0899_init_calc(struct stb0899_state *state)
{}

static int stb0899_wait_diseqc_fifo_empty(struct stb0899_state *state, int timeout)
{}

static int stb0899_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *cmd)
{}

static int stb0899_wait_diseqc_rxidle(struct stb0899_state *state, int timeout)
{}

static int stb0899_recv_slave_reply(struct dvb_frontend *fe, struct dvb_diseqc_slave_reply *reply)
{}

static int stb0899_wait_diseqc_txidle(struct stb0899_state *state, int timeout)
{}

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

static int stb0899_diseqc_init(struct stb0899_state *state)
{}

static int stb0899_sleep(struct dvb_frontend *fe)
{}

static int stb0899_wakeup(struct dvb_frontend *fe)
{}

static int stb0899_init(struct dvb_frontend *fe)
{}

static int stb0899_table_lookup(const struct stb0899_tab *tab, int max, int val)
{}

static int stb0899_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{}

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

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

/*
 * stb0899_get_error
 * viterbi error for DVB-S/DSS
 * packet error for DVB-S2
 * Bit Error Rate or Packet Error Rate * 10 ^ 7
 */
static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber)
{}

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

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

int stb0899_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{}


static inline void CONVERT32(u32 x, char *str)
{}

static int stb0899_get_dev_id(struct stb0899_state *state)
{}

static void stb0899_set_delivery(struct stb0899_state *state)
{}

/*
 * stb0899_set_iterations
 * set the LDPC iteration scale function
 */
static void stb0899_set_iterations(struct stb0899_state *state)
{}

static enum dvbfe_search stb0899_search(struct dvb_frontend *fe)
{}

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

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

static const struct dvb_frontend_ops stb0899_ops =;

struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_adapter *i2c)
{}
EXPORT_SYMBOL_GPL();
MODULE_PARM_DESC();
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();