#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/videodev2.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/dvb/frontend.h>
#include <linux/i2c.h>
#include <media/dvb_frontend.h>
#include "xc5000.h"
#include "tuner-i2c.h"
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
static int no_poweroff;
module_param(no_poweroff, int, 0644);
MODULE_PARM_DESC(…) …;
static DEFINE_MUTEX(xc5000_list_mutex);
static LIST_HEAD(hybrid_tuner_instance_list);
#define dprintk(level, fmt, arg...) …
struct xc5000_priv { … };
#define MAX_TV_STANDARD …
#define XC_MAX_I2C_WRITE_LENGTH …
#define XC5000_SLEEP_TIME …
#define XC_RF_MODE_AIR …
#define XC_RF_MODE_CABLE …
#define XC_PRODUCT_ID_FW_NOT_LOADED …
#define XC_PRODUCT_ID_FW_LOADED …
#define XREG_INIT …
#define XREG_VIDEO_MODE …
#define XREG_AUDIO_MODE …
#define XREG_RF_FREQ …
#define XREG_D_CODE …
#define XREG_IF_OUT …
#define XREG_SEEK_MODE …
#define XREG_POWER_DOWN …
#define XREG_OUTPUT_AMP …
#define XREG_SIGNALSOURCE …
#define XREG_SMOOTHEDCVBS …
#define XREG_XTALFREQ …
#define XREG_FINERFREQ …
#define XREG_DDIMODE …
#define XREG_ADC_ENV …
#define XREG_QUALITY …
#define XREG_FRAME_LINES …
#define XREG_HSYNC_FREQ …
#define XREG_LOCK …
#define XREG_FREQ_ERROR …
#define XREG_SNR …
#define XREG_VERSION …
#define XREG_PRODUCT_ID …
#define XREG_BUSY …
#define XREG_BUILD …
#define XREG_TOTALGAIN …
#define XREG_FW_CHECKSUM …
#define XREG_INIT_STATUS …
struct XC_TV_STANDARD { … };
#define MN_NTSC_PAL_BTSC …
#define MN_NTSC_PAL_A2 …
#define MN_NTSC_PAL_EIAJ …
#define MN_NTSC_PAL_MONO …
#define BG_PAL_A2 …
#define BG_PAL_NICAM …
#define BG_PAL_MONO …
#define I_PAL_NICAM …
#define I_PAL_NICAM_MONO …
#define DK_PAL_A2 …
#define DK_PAL_NICAM …
#define DK_PAL_MONO …
#define DK_SECAM_A2DK1 …
#define DK_SECAM_A2LDK3 …
#define DK_SECAM_A2MONO …
#define L_SECAM_NICAM …
#define LC_SECAM_NICAM …
#define DTV6 …
#define DTV8 …
#define DTV7_8 …
#define DTV7 …
#define FM_RADIO_INPUT2 …
#define FM_RADIO_INPUT1 …
#define FM_RADIO_INPUT1_MONO …
static struct XC_TV_STANDARD xc5000_standard[MAX_TV_STANDARD] = …;
struct xc5000_fw_cfg { … };
#define XC5000A_FIRMWARE …
static const struct xc5000_fw_cfg xc5000a_1_6_114 = …;
#define XC5000C_FIRMWARE …
static const struct xc5000_fw_cfg xc5000c_41_024_5 = …;
static inline const struct xc5000_fw_cfg *xc5000_assign_firmware(int chip_id)
{ … }
static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force);
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe);
static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val);
static int xc5000_tuner_reset(struct dvb_frontend *fe);
static int xc_send_i2c_data(struct xc5000_priv *priv, u8 *buf, int len)
{ … }
#if 0
static int xc_read_i2c_data(struct xc5000_priv *priv, u8 *buf, int len)
{
struct i2c_msg msg = { .addr = priv->i2c_props.addr,
.flags = I2C_M_RD, .buf = buf, .len = len };
if (i2c_transfer(priv->i2c_props.adap, &msg, 1) != 1) {
printk(KERN_ERR "xc5000 I2C read failed (len=%i)\n", len);
return -EREMOTEIO;
}
return 0;
}
#endif
static int xc5000_readreg(struct xc5000_priv *priv, u16 reg, u16 *val)
{ … }
static int xc5000_tuner_reset(struct dvb_frontend *fe)
{ … }
static int xc_write_reg(struct xc5000_priv *priv, u16 reg_addr, u16 i2c_data)
{ … }
static int xc_load_i2c_sequence(struct dvb_frontend *fe, const u8 *i2c_sequence)
{ … }
static int xc_initialize(struct xc5000_priv *priv)
{ … }
static int xc_set_tv_standard(struct xc5000_priv *priv,
u16 video_mode, u16 audio_mode, u8 radio_mode)
{ … }
static int xc_set_signal_source(struct xc5000_priv *priv, u16 rf_mode)
{ … }
static const struct dvb_tuner_ops xc5000_tuner_ops;
static int xc_set_rf_frequency(struct xc5000_priv *priv, u32 freq_hz)
{ … }
static int xc_set_IF_frequency(struct xc5000_priv *priv, u32 freq_khz)
{ … }
static int xc_get_adc_envelope(struct xc5000_priv *priv, u16 *adc_envelope)
{ … }
static int xc_get_frequency_error(struct xc5000_priv *priv, u32 *freq_error_hz)
{ … }
static int xc_get_lock_status(struct xc5000_priv *priv, u16 *lock_status)
{ … }
static int xc_get_version(struct xc5000_priv *priv,
u8 *hw_majorversion, u8 *hw_minorversion,
u8 *fw_majorversion, u8 *fw_minorversion)
{ … }
static int xc_get_buildversion(struct xc5000_priv *priv, u16 *buildrev)
{ … }
static int xc_get_hsync_freq(struct xc5000_priv *priv, u32 *hsync_freq_hz)
{ … }
static int xc_get_frame_lines(struct xc5000_priv *priv, u16 *frame_lines)
{ … }
static int xc_get_quality(struct xc5000_priv *priv, u16 *quality)
{ … }
static int xc_get_analogsnr(struct xc5000_priv *priv, u16 *snr)
{ … }
static int xc_get_totalgain(struct xc5000_priv *priv, u16 *totalgain)
{ … }
#define XC_TUNE_ANALOG …
#define XC_TUNE_DIGITAL …
static int xc_tune_channel(struct xc5000_priv *priv, u32 freq_hz, int mode)
{ … }
static int xc_set_xtal(struct dvb_frontend *fe)
{ … }
static int xc5000_fwupload(struct dvb_frontend *fe,
const struct xc5000_fw_cfg *desired_fw,
const struct firmware *fw)
{ … }
static void xc_debug_dump(struct xc5000_priv *priv)
{ … }
static int xc5000_tune_digital(struct dvb_frontend *fe)
{ … }
static int xc5000_set_digital_params(struct dvb_frontend *fe)
{ … }
static int xc5000_is_firmware_loaded(struct dvb_frontend *fe)
{ … }
static void xc5000_config_tv(struct dvb_frontend *fe,
struct analog_parameters *params)
{ … }
static int xc5000_set_tv_freq(struct dvb_frontend *fe)
{ … }
static int xc5000_config_radio(struct dvb_frontend *fe,
struct analog_parameters *params)
{ … }
static int xc5000_set_radio_freq(struct dvb_frontend *fe)
{ … }
static int xc5000_set_params(struct dvb_frontend *fe)
{ … }
static int xc5000_set_analog_params(struct dvb_frontend *fe,
struct analog_parameters *params)
{ … }
static int xc5000_get_frequency(struct dvb_frontend *fe, u32 *freq)
{ … }
static int xc5000_get_if_frequency(struct dvb_frontend *fe, u32 *freq)
{ … }
static int xc5000_get_bandwidth(struct dvb_frontend *fe, u32 *bw)
{ … }
static int xc5000_get_status(struct dvb_frontend *fe, u32 *status)
{ … }
static int xc_load_fw_and_init_tuner(struct dvb_frontend *fe, int force)
{ … }
static void xc5000_do_timer_sleep(struct work_struct *timer_sleep)
{ … }
static int xc5000_sleep(struct dvb_frontend *fe)
{ … }
static int xc5000_suspend(struct dvb_frontend *fe)
{ … }
static int xc5000_resume(struct dvb_frontend *fe)
{ … }
static int xc5000_init(struct dvb_frontend *fe)
{ … }
static void xc5000_release(struct dvb_frontend *fe)
{ … }
static int xc5000_set_config(struct dvb_frontend *fe, void *priv_cfg)
{ … }
static const struct dvb_tuner_ops xc5000_tuner_ops = …;
struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
struct i2c_adapter *i2c,
const struct xc5000_config *cfg)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_FIRMWARE(…);
MODULE_FIRMWARE(…);