Path: blob/master/drivers/media/dvb/frontends/dib0090.h
15112 views
/*1* Linux-DVB Driver for DiBcom's DiB0090 base-band RF Tuner.2*3* Copyright (C) 2005-7 DiBcom (http://www.dibcom.fr/)4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public License as7* published by the Free Software Foundation, version 2.8*/9#ifndef DIB0090_H10#define DIB0090_H1112struct dvb_frontend;13struct i2c_adapter;1415#define DEFAULT_DIB0090_I2C_ADDRESS 0x601617struct dib0090_io_config {18u32 clock_khz;1920u8 pll_bypass:1;21u8 pll_range:1;22u8 pll_prediv:6;23u8 pll_loopdiv:6;2425u8 adc_clock_ratio; /* valid is 8, 7 ,6 */26u16 pll_int_loop_filt;27};2829struct dib0090_wbd_slope {30u16 max_freq; /* for every frequency less than or equal to that field: this information is correct */31u16 slope_cold;32u16 offset_cold;33u16 slope_hot;34u16 offset_hot;35u8 wbd_gain;36};3738struct dib0090_low_if_offset_table {39int std;40u32 RF_freq;41s32 offset_khz;42};4344struct dib0090_config {45struct dib0090_io_config io;46int (*reset) (struct dvb_frontend *, int);47int (*sleep) (struct dvb_frontend *, int);4849/* offset in kHz */50int freq_offset_khz_uhf;51int freq_offset_khz_vhf;5253int (*get_adc_power) (struct dvb_frontend *);5455u8 clkouttobamse:1; /* activate or deactivate clock output */56u8 analog_output;5758u8 i2c_address;59/* add drives and other things if necessary */60u16 wbd_vhf_offset;61u16 wbd_cband_offset;62u8 use_pwm_agc;63u8 clkoutdrive;6465u8 ls_cfg_pad_drv;66u8 data_tx_drv;6768u8 in_soc;69const struct dib0090_low_if_offset_table *low_if;70u8 fref_clock_ratio;71u16 force_cband_input;72struct dib0090_wbd_slope *wbd;73};7475#if defined(CONFIG_DVB_TUNER_DIB0090) || (defined(CONFIG_DVB_TUNER_DIB0090_MODULE) && defined(MODULE))76extern struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);77extern struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config);78extern void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast);79extern void dib0090_pwm_gain_reset(struct dvb_frontend *fe);80extern u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner);81extern int dib0090_gain_control(struct dvb_frontend *fe);82extern enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe);83extern int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state);84extern void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt);85#else86static inline struct dvb_frontend *dib0090_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0090_config *config)87{88printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);89return NULL;90}9192static inline struct dvb_frontend *dib0090_fw_register(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dib0090_config *config)93{94printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);95return NULL;96}9798static inline void dib0090_dcc_freq(struct dvb_frontend *fe, u8 fast)99{100printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);101}102103static inline void dib0090_pwm_gain_reset(struct dvb_frontend *fe)104{105printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);106}107108static inline u16 dib0090_get_wbd_offset(struct dvb_frontend *tuner)109{110printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);111return 0;112}113114static inline int dib0090_gain_control(struct dvb_frontend *fe)115{116printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);117return -ENODEV;118}119120static inline enum frontend_tune_state dib0090_get_tune_state(struct dvb_frontend *fe)121{122printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);123return CT_DONE;124}125126static inline int dib0090_set_tune_state(struct dvb_frontend *fe, enum frontend_tune_state tune_state)127{128printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);129return -ENODEV;130}131132static inline void dib0090_get_current_gain(struct dvb_frontend *fe, u16 * rf, u16 * bb, u16 * rf_gain_limit, u16 * rflt)133{134printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);135}136#endif137138#endif139140141