#define pr_fmt(fmt) …
#include <asm/div64.h>
#include <linux/kernel.h>
#include <linux/dvb/frontend.h>
#include <linux/int_log.h>
#include "lgdt3306a.h"
#include <linux/i2c-mux.h>
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
static int forced_manual;
module_param(forced_manual, int, 0644);
MODULE_PARM_DESC(…) …;
#define DBG_INFO …
#define DBG_REG …
#define DBG_DUMP …
#define lg_debug(fmt, arg...) …
#define dbg_info(fmt, arg...) …
#define dbg_reg(fmt, arg...) …
#define lg_chkerr(ret) …
struct lgdt3306a_state { … };
enum lgdt3306a_lock_status { … };
enum lgdt3306a_neverlock_status { … };
enum lgdt3306a_modulation { … };
enum lgdt3306a_lock_check { … };
#ifdef DBG_DUMP
static void lgdt3306a_DumpAllRegs(struct lgdt3306a_state *state);
static void lgdt3306a_DumpRegs(struct lgdt3306a_state *state);
#endif
static int lgdt3306a_write_reg(struct lgdt3306a_state *state, u16 reg, u8 val)
{ … }
static int lgdt3306a_read_reg(struct lgdt3306a_state *state, u16 reg, u8 *val)
{ … }
#define read_reg(state, reg) …
static int lgdt3306a_set_reg_bit(struct lgdt3306a_state *state,
u16 reg, int bit, int onoff)
{ … }
static int lgdt3306a_soft_reset(struct lgdt3306a_state *state)
{ … }
static int lgdt3306a_mpeg_mode(struct lgdt3306a_state *state,
enum lgdt3306a_mpeg_mode mode)
{ … }
static int lgdt3306a_mpeg_mode_polarity(struct lgdt3306a_state *state,
enum lgdt3306a_tp_clock_edge edge,
enum lgdt3306a_tp_valid_polarity valid)
{ … }
static int lgdt3306a_mpeg_tristate(struct lgdt3306a_state *state,
int mode)
{ … }
static int lgdt3306a_ts_bus_ctrl(struct dvb_frontend *fe, int acquire)
{ … }
static int lgdt3306a_power(struct lgdt3306a_state *state,
int mode)
{ … }
static int lgdt3306a_set_vsb(struct lgdt3306a_state *state)
{ … }
static int lgdt3306a_set_qam(struct lgdt3306a_state *state, int modulation)
{ … }
static int lgdt3306a_set_modulation(struct lgdt3306a_state *state,
struct dtv_frontend_properties *p)
{ … }
static int lgdt3306a_agc_setup(struct lgdt3306a_state *state,
struct dtv_frontend_properties *p)
{ … }
static int lgdt3306a_set_inversion(struct lgdt3306a_state *state,
int inversion)
{ … }
static int lgdt3306a_set_inversion_auto(struct lgdt3306a_state *state,
int enabled)
{ … }
static int lgdt3306a_set_if(struct lgdt3306a_state *state,
struct dtv_frontend_properties *p)
{ … }
static int lgdt3306a_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{ … }
static int lgdt3306a_sleep(struct lgdt3306a_state *state)
{ … }
static int lgdt3306a_fe_sleep(struct dvb_frontend *fe)
{ … }
static int lgdt3306a_init(struct dvb_frontend *fe)
{ … }
static int lgdt3306a_set_parameters(struct dvb_frontend *fe)
{ … }
static int lgdt3306a_get_frontend(struct dvb_frontend *fe,
struct dtv_frontend_properties *p)
{ … }
static enum dvbfe_algo lgdt3306a_get_frontend_algo(struct dvb_frontend *fe)
{ … }
static int lgdt3306a_monitor_vsb(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_modulation
lgdt3306a_check_oper_mode(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_lock_status
lgdt3306a_check_lock_status(struct lgdt3306a_state *state,
enum lgdt3306a_lock_check whatLock)
{ … }
static enum lgdt3306a_neverlock_status
lgdt3306a_check_neverlock_status(struct lgdt3306a_state *state)
{ … }
static int lgdt3306a_pre_monitoring(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_lock_status
lgdt3306a_sync_lock_poll(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_lock_status
lgdt3306a_fec_lock_poll(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_neverlock_status
lgdt3306a_neverlock_poll(struct lgdt3306a_state *state)
{ … }
static u8 lgdt3306a_get_packet_error(struct lgdt3306a_state *state)
{ … }
static const u32 valx_x10[] = …;
static const u32 log10x_x1000[] = …;
static u32 log10_x1000(u32 x)
{ … }
static u32 lgdt3306a_calculate_snr_x100(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_lock_status
lgdt3306a_vsb_lock_poll(struct lgdt3306a_state *state)
{ … }
static enum lgdt3306a_lock_status
lgdt3306a_qam_lock_poll(struct lgdt3306a_state *state)
{ … }
static int lgdt3306a_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{ … }
static int lgdt3306a_read_snr(struct dvb_frontend *fe, u16 *snr)
{ … }
static int lgdt3306a_read_signal_strength(struct dvb_frontend *fe,
u16 *strength)
{ … }
static int lgdt3306a_read_ber(struct dvb_frontend *fe, u32 *ber)
{ … }
static int lgdt3306a_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{ … }
static int lgdt3306a_tune(struct dvb_frontend *fe, bool re_tune,
unsigned int mode_flags, unsigned int *delay,
enum fe_status *status)
{ … }
static int lgdt3306a_get_tune_settings(struct dvb_frontend *fe,
struct dvb_frontend_tune_settings
*fe_tune_settings)
{ … }
static enum dvbfe_search lgdt3306a_search(struct dvb_frontend *fe)
{ … }
static void lgdt3306a_release(struct dvb_frontend *fe)
{ … }
static const struct dvb_frontend_ops lgdt3306a_ops;
struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
struct i2c_adapter *i2c_adap)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef DBG_DUMP
static const short regtab[] = …;
#define numDumpRegs …
static u8 regval1[numDumpRegs] = …;
static u8 regval2[numDumpRegs] = …;
static void lgdt3306a_DumpAllRegs(struct lgdt3306a_state *state)
{ … }
static void lgdt3306a_DumpRegs(struct lgdt3306a_state *state)
{ … }
#endif
static const struct dvb_frontend_ops lgdt3306a_ops = …;
static int lgdt3306a_select(struct i2c_mux_core *muxc, u32 chan)
{ … }
static int lgdt3306a_deselect(struct i2c_mux_core *muxc, u32 chan)
{ … }
static int lgdt3306a_probe(struct i2c_client *client)
{ … }
static void lgdt3306a_remove(struct i2c_client *client)
{ … }
static const struct i2c_device_id lgdt3306a_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, lgdt3306a_id_table);
static struct i2c_driver lgdt3306a_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…) …;