#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <media/dvb_frontend.h>
#include "dib7000m.h"
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
#define dprintk(fmt, arg...) …
struct dib7000m_state { … };
enum dib7000m_power_mode { … };
static u16 dib7000m_read_word(struct dib7000m_state *state, u16 reg)
{ … }
static int dib7000m_write_word(struct dib7000m_state *state, u16 reg, u16 val)
{ … }
static void dib7000m_write_tab(struct dib7000m_state *state, u16 *buf)
{ … }
static int dib7000m_set_output_mode(struct dib7000m_state *state, int mode)
{ … }
static void dib7000m_set_power_mode(struct dib7000m_state *state, enum dib7000m_power_mode mode)
{ … }
static int dib7000m_set_adc_state(struct dib7000m_state *state, enum dibx000_adc_states no)
{ … }
static int dib7000m_set_bandwidth(struct dib7000m_state *state, u32 bw)
{ … }
static int dib7000m_set_diversity_in(struct dvb_frontend *demod, int onoff)
{ … }
static int dib7000m_sad_calib(struct dib7000m_state *state)
{ … }
static void dib7000m_reset_pll_common(struct dib7000m_state *state, const struct dibx000_bandwidth_config *bw)
{ … }
static void dib7000m_reset_pll(struct dib7000m_state *state)
{ … }
static void dib7000mc_reset_pll(struct dib7000m_state *state)
{ … }
static int dib7000m_reset_gpio(struct dib7000m_state *st)
{ … }
static u16 dib7000m_defaults_common[] = …;
static u16 dib7000m_defaults[] = …;
static int dib7000m_demod_reset(struct dib7000m_state *state)
{ … }
static void dib7000m_restart_agc(struct dib7000m_state *state)
{ … }
static int dib7000m_agc_soft_split(struct dib7000m_state *state)
{ … }
static int dib7000m_update_lna(struct dib7000m_state *state)
{ … }
static int dib7000m_set_agc_config(struct dib7000m_state *state, u8 band)
{ … }
static void dib7000m_update_timf(struct dib7000m_state *state)
{ … }
static int dib7000m_agc_startup(struct dvb_frontend *demod)
{ … }
static void dib7000m_set_channel(struct dib7000m_state *state, struct dtv_frontend_properties *ch,
u8 seq)
{ … }
static int dib7000m_autosearch_start(struct dvb_frontend *demod)
{ … }
static int dib7000m_autosearch_irq(struct dib7000m_state *state, u16 reg)
{ … }
static int dib7000m_autosearch_is_irq(struct dvb_frontend *demod)
{ … }
static int dib7000m_tune(struct dvb_frontend *demod)
{ … }
static int dib7000m_wakeup(struct dvb_frontend *demod)
{ … }
static int dib7000m_sleep(struct dvb_frontend *demod)
{ … }
static int dib7000m_identify(struct dib7000m_state *state)
{ … }
static int dib7000m_get_frontend(struct dvb_frontend* fe,
struct dtv_frontend_properties *fep)
{ … }
static int dib7000m_set_frontend(struct dvb_frontend *fe)
{ … }
static int dib7000m_read_status(struct dvb_frontend *fe, enum fe_status *stat)
{ … }
static int dib7000m_read_ber(struct dvb_frontend *fe, u32 *ber)
{ … }
static int dib7000m_read_unc_blocks(struct dvb_frontend *fe, u32 *unc)
{ … }
static int dib7000m_read_signal_strength(struct dvb_frontend *fe, u16 *strength)
{ … }
static int dib7000m_read_snr(struct dvb_frontend* fe, u16 *snr)
{ … }
static int dib7000m_fe_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings *tune)
{ … }
static void dib7000m_release(struct dvb_frontend *demod)
{ … }
struct i2c_adapter * dib7000m_get_i2c_master(struct dvb_frontend *demod, enum dibx000_i2c_interface intf, int gating)
{ … }
EXPORT_SYMBOL(…);
int dib7000m_pid_filter_ctrl(struct dvb_frontend *fe, u8 onoff)
{ … }
EXPORT_SYMBOL(…);
int dib7000m_pid_filter(struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
{ … }
EXPORT_SYMBOL(…);
#if 0
int dib7000m_i2c_enumeration(struct i2c_adapter *i2c, int no_of_demods,
u8 default_addr, struct dib7000m_config cfg[])
{
struct dib7000m_state st = { .i2c_adap = i2c };
int k = 0;
u8 new_addr = 0;
for (k = no_of_demods-1; k >= 0; k--) {
st.cfg = cfg[k];
new_addr = (0x40 + k) << 1;
st.i2c_addr = new_addr;
if (dib7000m_identify(&st) != 0) {
st.i2c_addr = default_addr;
if (dib7000m_identify(&st) != 0) {
dprintk("DiB7000M #%d: not identified\n", k);
return -EIO;
}
}
dib7000m_set_output_mode(&st, OUTMODE_DIVERSITY);
dib7000m_write_word(&st, 1796, 0x0);
dib7000m_write_word(&st, 1794, (new_addr << 2) | 0x2);
dprintk("IC %d initialized (to i2c_address 0x%x)\n", k, new_addr);
}
for (k = 0; k < no_of_demods; k++) {
st.cfg = cfg[k];
st.i2c_addr = (0x40 + k) << 1;
dib7000m_write_word(&st,1794, st.i2c_addr << 2);
dib7000m_set_output_mode(&st, OUTMODE_HIGH_Z);
}
return 0;
}
EXPORT_SYMBOL(dib7000m_i2c_enumeration);
#endif
static const struct dvb_frontend_ops dib7000m_ops;
struct dvb_frontend * dib7000m_attach(struct i2c_adapter *i2c_adap, u8 i2c_addr, struct dib7000m_config *cfg)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct dvb_frontend_ops dib7000m_ops = …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;