#include <linux/module.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <linux/math64.h>
#include <linux/log2.h>
#include <linux/dynamic_debug.h>
#include <linux/kernel.h>
#include <linux/int_log.h>
#include <media/dvb_frontend.h>
#include "cxd2841er.h"
#include "cxd2841er_priv.h"
#define MAX_WRITE_REGSIZE …
#define LOG2_E_100X …
#define INTLOG10X100(x) …
enum sony_dvbc_constellation_t { … };
enum cxd2841er_state { … };
struct cxd2841er_priv { … };
static const struct cxd2841er_cnr_data s_cn_data[] = …;
static const struct cxd2841er_cnr_data s2_cn_data[] = …;
static int cxd2841er_freeze_regs(struct cxd2841er_priv *priv);
static int cxd2841er_unfreeze_regs(struct cxd2841er_priv *priv);
static void cxd2841er_i2c_debug(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 write,
const u8 *data, u32 len)
{ … }
static int cxd2841er_write_regs(struct cxd2841er_priv *priv,
u8 addr, u8 reg, const u8 *data, u32 len)
{ … }
static int cxd2841er_write_reg(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 val)
{ … }
static int cxd2841er_read_regs(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 *val, u32 len)
{ … }
static int cxd2841er_read_reg(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 *val)
{ … }
static int cxd2841er_set_reg_bits(struct cxd2841er_priv *priv,
u8 addr, u8 reg, u8 data, u8 mask)
{ … }
static u32 cxd2841er_calc_iffreq_xtal(enum cxd2841er_xtal xtal, u32 ifhz)
{ … }
static u32 cxd2841er_calc_iffreq(u32 ifhz)
{ … }
static int cxd2841er_get_if_hz(struct cxd2841er_priv *priv, u32 def_hz)
{ … }
static int cxd2841er_tuner_set(struct dvb_frontend *fe)
{ … }
static int cxd2841er_dvbs2_set_symbol_rate(struct cxd2841er_priv *priv,
u32 symbol_rate)
{ … }
static void cxd2841er_set_ts_clock_mode(struct cxd2841er_priv *priv,
u8 system);
static int cxd2841er_sleep_s_to_active_s(struct cxd2841er_priv *priv,
u8 system, u32 symbol_rate)
{ … }
static int cxd2841er_sleep_tc_to_active_t_band(struct cxd2841er_priv *priv,
u32 bandwidth);
static int cxd2841er_sleep_tc_to_active_t2_band(struct cxd2841er_priv *priv,
u32 bandwidth);
static int cxd2841er_sleep_tc_to_active_c_band(struct cxd2841er_priv *priv,
u32 bandwidth);
static int cxd2841er_sleep_tc_to_active_i(struct cxd2841er_priv *priv,
u32 bandwidth);
static int cxd2841er_active_i_to_sleep_tc(struct cxd2841er_priv *priv);
static int cxd2841er_sleep_tc_to_shutdown(struct cxd2841er_priv *priv);
static int cxd2841er_shutdown_to_sleep_tc(struct cxd2841er_priv *priv);
static int cxd2841er_sleep_tc(struct dvb_frontend *fe);
static int cxd2841er_retune_active(struct cxd2841er_priv *priv,
struct dtv_frontend_properties *p)
{ … }
static int cxd2841er_active_s_to_sleep_s(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_sleep_s_to_shutdown(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_sleep_tc_to_shutdown(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_active_t_to_sleep_tc(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_active_t2_to_sleep_tc(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_active_c_to_sleep_tc(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_active_i_to_sleep_tc(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_shutdown_to_sleep_s(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_shutdown_to_sleep_tc(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_tune_done(struct cxd2841er_priv *priv)
{ … }
static void cxd2841er_set_ts_clock_mode(struct cxd2841er_priv *priv,
u8 system)
{ … }
static u8 cxd2841er_chip_id(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_read_status_s(struct dvb_frontend *fe,
enum fe_status *status)
{ … }
static int cxd2841er_read_status_t_t2(struct cxd2841er_priv *priv,
u8 *sync, u8 *tslock, u8 *unlock)
{ … }
static int cxd2841er_read_status_c(struct cxd2841er_priv *priv, u8 *tslock)
{ … }
static int cxd2841er_read_status_i(struct cxd2841er_priv *priv,
u8 *sync, u8 *tslock, u8 *unlock)
{ … }
static int cxd2841er_read_status_tc(struct dvb_frontend *fe,
enum fe_status *status)
{ … }
static int cxd2841er_get_carrier_offset_s_s2(struct cxd2841er_priv *priv,
int *offset)
{ … }
static int cxd2841er_get_carrier_offset_i(struct cxd2841er_priv *priv,
u32 bandwidth, int *offset)
{ … }
static int cxd2841er_get_carrier_offset_t(struct cxd2841er_priv *priv,
u32 bandwidth, int *offset)
{ … }
static int cxd2841er_get_carrier_offset_t2(struct cxd2841er_priv *priv,
u32 bandwidth, int *offset)
{ … }
static int cxd2841er_get_carrier_offset_c(struct cxd2841er_priv *priv,
int *offset)
{ … }
static int cxd2841er_read_packet_errors_c(
struct cxd2841er_priv *priv, u32 *penum)
{ … }
static int cxd2841er_read_packet_errors_t(
struct cxd2841er_priv *priv, u32 *penum)
{ … }
static int cxd2841er_read_packet_errors_t2(
struct cxd2841er_priv *priv, u32 *penum)
{ … }
static int cxd2841er_read_packet_errors_i(
struct cxd2841er_priv *priv, u32 *penum)
{ … }
static int cxd2841er_read_ber_c(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_read_ber_i(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_mon_read_ber_s(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_mon_read_ber_s2(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_read_ber_t2(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_read_ber_t(struct cxd2841er_priv *priv,
u32 *bit_error, u32 *bit_count)
{ … }
static int cxd2841er_freeze_regs(struct cxd2841er_priv *priv)
{ … }
static int cxd2841er_unfreeze_regs(struct cxd2841er_priv *priv)
{ … }
static u32 cxd2841er_dvbs_read_snr(struct cxd2841er_priv *priv,
u8 delsys, u32 *snr)
{ … }
static uint32_t sony_log(uint32_t x)
{ … }
static int cxd2841er_read_snr_c(struct cxd2841er_priv *priv, u32 *snr)
{ … }
static int cxd2841er_read_snr_t(struct cxd2841er_priv *priv, u32 *snr)
{ … }
static int cxd2841er_read_snr_t2(struct cxd2841er_priv *priv, u32 *snr)
{ … }
static int cxd2841er_read_snr_i(struct cxd2841er_priv *priv, u32 *snr)
{ … }
static u16 cxd2841er_read_agc_gain_c(struct cxd2841er_priv *priv,
u8 delsys)
{ … }
static u16 cxd2841er_read_agc_gain_t_t2(struct cxd2841er_priv *priv,
u8 delsys)
{ … }
static u16 cxd2841er_read_agc_gain_i(struct cxd2841er_priv *priv,
u8 delsys)
{ … }
static u16 cxd2841er_read_agc_gain_s(struct cxd2841er_priv *priv)
{ … }
static void cxd2841er_read_ber(struct dvb_frontend *fe)
{ … }
static void cxd2841er_read_signal_strength(struct dvb_frontend *fe)
{ … }
static void cxd2841er_read_snr(struct dvb_frontend *fe)
{ … }
static void cxd2841er_read_ucblocks(struct dvb_frontend *fe)
{ … }
static int cxd2841er_dvbt2_set_profile(
struct cxd2841er_priv *priv, enum cxd2841er_dvbt2_profile_t profile)
{ … }
static int cxd2841er_dvbt2_set_plp_config(struct cxd2841er_priv *priv,
u8 is_auto, u8 plp_id)
{ … }
static int cxd2841er_sleep_tc_to_active_t2_band(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_t_band(
struct cxd2841er_priv *priv, u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_i_band(
struct cxd2841er_priv *priv, u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_c_band(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_t(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_t2(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_i(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_sleep_tc_to_active_c(struct cxd2841er_priv *priv,
u32 bandwidth)
{ … }
static int cxd2841er_get_frontend(struct dvb_frontend *fe,
struct dtv_frontend_properties *p)
{ … }
static int cxd2841er_set_frontend_s(struct dvb_frontend *fe)
{ … }
static int cxd2841er_set_frontend_tc(struct dvb_frontend *fe)
{ … }
static int cxd2841er_tune_s(struct dvb_frontend *fe,
bool re_tune,
unsigned int mode_flags,
unsigned int *delay,
enum fe_status *status)
{ … }
static int cxd2841er_tune_tc(struct dvb_frontend *fe,
bool re_tune,
unsigned int mode_flags,
unsigned int *delay,
enum fe_status *status)
{ … }
static int cxd2841er_sleep_s(struct dvb_frontend *fe)
{ … }
static int cxd2841er_sleep_tc(struct dvb_frontend *fe)
{ … }
static int cxd2841er_shutdown_tc(struct dvb_frontend *fe)
{ … }
static int cxd2841er_send_burst(struct dvb_frontend *fe,
enum fe_sec_mini_cmd burst)
{ … }
static int cxd2841er_set_tone(struct dvb_frontend *fe,
enum fe_sec_tone_mode tone)
{ … }
static int cxd2841er_send_diseqc_msg(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *cmd)
{ … }
static void cxd2841er_release(struct dvb_frontend *fe)
{ … }
static int cxd2841er_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{ … }
static enum dvbfe_algo cxd2841er_get_algo(struct dvb_frontend *fe)
{ … }
static void cxd2841er_init_stats(struct dvb_frontend *fe)
{ … }
static int cxd2841er_init_s(struct dvb_frontend *fe)
{ … }
static int cxd2841er_init_tc(struct dvb_frontend *fe)
{ … }
static const struct dvb_frontend_ops cxd2841er_dvbs_s2_ops;
static struct dvb_frontend_ops cxd2841er_t_c_ops;
static struct dvb_frontend *cxd2841er_attach(struct cxd2841er_config *cfg,
struct i2c_adapter *i2c,
u8 system)
{ … }
struct dvb_frontend *cxd2841er_attach_s(struct cxd2841er_config *cfg,
struct i2c_adapter *i2c)
{ … }
EXPORT_SYMBOL_GPL(…);
struct dvb_frontend *cxd2841er_attach_t_c(struct cxd2841er_config *cfg,
struct i2c_adapter *i2c)
{ … }
EXPORT_SYMBOL_GPL(…);
static const struct dvb_frontend_ops cxd2841er_dvbs_s2_ops = …;
static struct dvb_frontend_ops cxd2841er_t_c_ops = …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;