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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *    Support for LGDT3302 and LGDT3303 - VSB/QAM
 *
 *    Copyright (C) 2005 Wilson Michaels <[email protected]>
 */

/*
 *                      NOTES ABOUT THIS DRIVER
 *
 * This Linux driver supports:
 *   DViCO FusionHDTV 3 Gold-Q
 *   DViCO FusionHDTV 3 Gold-T
 *   DViCO FusionHDTV 5 Gold
 *   DViCO FusionHDTV 5 Lite
 *   DViCO FusionHDTV 5 USB Gold
 *   Air2PC/AirStar 2 ATSC 3rd generation (HD5000)
 *   pcHDTV HD5500
 *
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <asm/byteorder.h>

#include <media/dvb_frontend.h>
#include <linux/int_log.h>
#include "lgdt330x_priv.h"
#include "lgdt330x.h"

/* Use Equalizer Mean Squared Error instead of Phaser Tracker MSE */
/* #define USE_EQMSE */

static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC();

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

struct lgdt330x_state {};

static int i2c_write_demod_bytes(struct lgdt330x_state *state,
				 const u8 *buf, /* data bytes to send */
				 int len  /* number of bytes to send */)
{}

/*
 * This routine writes the register (reg) to the demod bus
 * then reads the data returned for (len) bytes.
 */
static int i2c_read_demod_bytes(struct lgdt330x_state *state,
				enum I2C_REG reg, u8 *buf, int len)
{}

/* Software reset */
static int lgdt3302_sw_reset(struct lgdt330x_state *state)
{}

static int lgdt3303_sw_reset(struct lgdt330x_state *state)
{}

static int lgdt330x_sw_reset(struct lgdt330x_state *state)
{}

static int lgdt330x_init(struct dvb_frontend *fe)
{}

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

static int lgdt330x_set_parameters(struct dvb_frontend *fe)
{}

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

/*
 * Calculate SNR estimation (scaled by 2^24)
 *
 * 8-VSB SNR equations from LGDT3302 and LGDT3303 datasheets, QAM
 * equations from LGDT3303 datasheet.  VSB is the same between the '02
 * and '03, so maybe QAM is too?  Perhaps someone with a newer datasheet
 * that has QAM information could verify?
 *
 * For 8-VSB: (two ways, take your pick)
 * LGDT3302:
 *   SNR_EQ = 10 * log10(25 * 24^2 / EQ_MSE)
 * LGDT3303:
 *   SNR_EQ = 10 * log10(25 * 32^2 / EQ_MSE)
 * LGDT3302 & LGDT3303:
 *   SNR_PT = 10 * log10(25 * 32^2 / PT_MSE)  (we use this one)
 * For 64-QAM:
 *   SNR    = 10 * log10( 688128   / MSEQAM)
 * For 256-QAM:
 *   SNR    = 10 * log10( 696320   / MSEQAM)
 *
 * We re-write the snr equation as:
 *   SNR * 2^24 = 10*(c - intlog10(MSE))
 * Where for 256-QAM, c = log10(696320) * 2^24, and so on.
 */
static u32 calculate_snr(u32 mse, u32 c)
{}

static int lgdt3302_read_snr(struct dvb_frontend *fe)
{}

static int lgdt3303_read_snr(struct dvb_frontend *fe)
{}

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

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


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

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

static int
lgdt330x_get_tune_settings(struct dvb_frontend *fe,
			   struct dvb_frontend_tune_settings *fe_tune_settings)
{}

static void lgdt330x_release(struct dvb_frontend *fe)
{}

static struct dvb_frontend *lgdt330x_get_dvb_frontend(struct i2c_client *client)
{}

static const struct dvb_frontend_ops lgdt3302_ops;
static const struct dvb_frontend_ops lgdt3303_ops;

static int lgdt330x_probe(struct i2c_client *client)
{}
struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *_config,
				     u8 demod_address,
				     struct i2c_adapter *i2c)
{}
EXPORT_SYMBOL_GPL();

static const struct dvb_frontend_ops lgdt3302_ops =;

static const struct dvb_frontend_ops lgdt3303_ops =;

static void lgdt330x_remove(struct i2c_client *client)
{}

static const struct i2c_device_id lgdt330x_id_table[] =;
MODULE_DEVICE_TABLE(i2c, lgdt330x_id_table);

static struct i2c_driver lgdt330x_driver =;

module_i2c_driver();


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