Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dib0090.c File Reference
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include "dvb_frontend.h"
#include "dib0090.h"
#include "dibx000_common.h"

Go to the source code of this file.

Data Structures

struct  dib0090_tuning
 
struct  dib0090_pll
 
struct  dib0090_identity
 
struct  dib0090_state
 
struct  dib0090_fw_state
 
struct  slope
 
struct  dc_calibration
 

Macros

#define dprintk(args...)
 
#define CONFIG_SYS_DVBT
 
#define CONFIG_SYS_ISDBT
 
#define CONFIG_BAND_CBAND
 
#define CONFIG_BAND_VHF
 
#define CONFIG_BAND_UHF
 
#define CONFIG_DIB0090_USE_PWM_AGC
 
#define EN_LNA0   0x8000
 
#define EN_LNA1   0x4000
 
#define EN_LNA2   0x2000
 
#define EN_LNA3   0x1000
 
#define EN_MIX0   0x0800
 
#define EN_MIX1   0x0400
 
#define EN_MIX2   0x0200
 
#define EN_MIX3   0x0100
 
#define EN_IQADC   0x0040
 
#define EN_PLL   0x0020
 
#define EN_TX   0x0010
 
#define EN_BB   0x0008
 
#define EN_LO   0x0004
 
#define EN_BIAS   0x0001
 
#define EN_IQANA   0x0002
 
#define EN_DIGCLK   0x0080 /* not in the 0x24 reg, only in 0x1b */
 
#define EN_CRYSTAL   0x0002
 
#define EN_UHF   0x22E9
 
#define EN_VHF   0x44E9
 
#define EN_LBD   0x11E9
 
#define EN_SBD   0x44E9
 
#define EN_CAB   0x88E9
 
#define DC_CAL   0x1
 
#define WBD_CAL   0x2
 
#define TEMP_CAL   0x4
 
#define CAPTRIM_CAL   0x8
 
#define KROSUS_PLL_LOCKED   0x800
 
#define KROSUS   0x2
 
#define SOC   0x02
 
#define SOC_7090_P1G_11R1   0x82
 
#define SOC_7090_P1G_21R1   0x8a
 
#define SOC_8090_P1G_11R1   0x86
 
#define SOC_8090_P1G_21R1   0x8e
 
#define P1A_B   0x0
 
#define P1C   0x1
 
#define P1D_E_F   0x3
 
#define P1G   0x7
 
#define P1G_21R2   0xf
 
#define MP001   0x1 /* Single 9090/8096 */
 
#define MP005   0x4 /* Single Sband */
 
#define MP008   0x6 /* Dual diversity VHF-UHF-LBAND */
 
#define MP009   0x7 /* Dual diversity 29098 CBAND-UHF-LBAND-SBAND */
 
#define pgm_read_word(w)   (*w)
 
#define HARD_RESET(state)   do { if (cfg->reset) { if (cfg->sleep) cfg->sleep(fe, 0); msleep(10); cfg->reset(fe, 1); msleep(10); cfg->reset(fe, 0); msleep(10); } } while (0)
 
#define ADC_TARGET   -220
 
#define GAIN_ALPHA   5
 
#define WBD_ALPHA   6
 
#define LPF   100
 
#define CAP_VALUE_MIN   (u8) 9
 
#define CAP_VALUE_MAX   (u8) 40
 
#define HR_MIN   (u8) 25
 
#define HR_MAX   (u8) 40
 
#define POLY_MIN   (u8) 0
 
#define POLY_MAX   (u8) 8
 
#define steps(u)   (((u) > 15) ? ((u)-16) : (u))
 
#define INTERN_WAIT   10
 
#define WBD   0x781 /* 1 1 1 1 0000 0 0 1 */
 
#define WBD   0x781 /* 1 1 1 1 0000 0 0 1 */
 

Functions

 module_param (debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"turn on debugging (default: 0)")
 
void dib0090_dcc_freq (struct dvb_frontend *fe, u8 fast)
 
 EXPORT_SYMBOL (dib0090_dcc_freq)
 
void dib0090_pwm_gain_reset (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib0090_pwm_gain_reset)
 
void dib0090_set_dc_servo (struct dvb_frontend *fe, u8 DC_servo_cutoff)
 
 EXPORT_SYMBOL (dib0090_set_dc_servo)
 
int dib0090_gain_control (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib0090_gain_control)
 
void dib0090_get_current_gain (struct dvb_frontend *fe, u16 *rf, u16 *bb, u16 *rf_gain_limit, u16 *rflt)
 
 EXPORT_SYMBOL (dib0090_get_current_gain)
 
u16 dib0090_get_wbd_target (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib0090_get_wbd_target)
 
u16 dib0090_get_wbd_offset (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib0090_get_wbd_offset)
 
int dib0090_set_switch (struct dvb_frontend *fe, u8 sw1, u8 sw2, u8 sw3)
 
 EXPORT_SYMBOL (dib0090_set_switch)
 
int dib0090_set_vga (struct dvb_frontend *fe, u8 onoff)
 
 EXPORT_SYMBOL (dib0090_set_vga)
 
int dib0090_update_rframp_7090 (struct dvb_frontend *fe, u8 cfg_sensitivity)
 
 EXPORT_SYMBOL (dib0090_update_rframp_7090)
 
int dib0090_update_tuning_table_7090 (struct dvb_frontend *fe, u8 cfg_sensitivity)
 
 EXPORT_SYMBOL (dib0090_update_tuning_table_7090)
 
enum frontend_tune_state dib0090_get_tune_state (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib0090_get_tune_state)
 
int dib0090_set_tune_state (struct dvb_frontend *fe, enum frontend_tune_state tune_state)
 
 EXPORT_SYMBOL (dib0090_set_tune_state)
 
struct dvb_frontenddib0090_register (struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config)
 
 EXPORT_SYMBOL (dib0090_register)
 
struct dvb_frontenddib0090_fw_register (struct dvb_frontend *fe, struct i2c_adapter *i2c, const struct dib0090_config *config)
 
 EXPORT_SYMBOL (dib0090_fw_register)
 
 MODULE_AUTHOR ("Patrick Boettcher <[email protected]>")
 
 MODULE_AUTHOR ("Olivier Grenie <[email protected]>")
 
 MODULE_DESCRIPTION ("Driver for the DiBcom 0090 base-band RF Tuner")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ADC_TARGET   -220

Definition at line 332 of file dib0090.c.

#define CAP_VALUE_MAX   (u8) 40

Definition at line 1519 of file dib0090.c.

#define CAP_VALUE_MIN   (u8) 9

Definition at line 1518 of file dib0090.c.

#define CAPTRIM_CAL   0x8

Definition at line 85 of file dib0090.c.

#define CONFIG_BAND_CBAND

Definition at line 51 of file dib0090.c.

#define CONFIG_BAND_UHF

Definition at line 53 of file dib0090.c.

#define CONFIG_BAND_VHF

Definition at line 52 of file dib0090.c.

#define CONFIG_DIB0090_USE_PWM_AGC

Definition at line 54 of file dib0090.c.

#define CONFIG_SYS_DVBT

Definition at line 49 of file dib0090.c.

#define CONFIG_SYS_ISDBT

Definition at line 50 of file dib0090.c.

#define DC_CAL   0x1

Definition at line 82 of file dib0090.c.

#define dprintk (   args...)
Value:
do { \
if (debug) { \
printk(KERN_DEBUG "DiB0090: "); \
printk(args); \
printk("\n"); \
} \
} while (0)

Definition at line 41 of file dib0090.c.

#define EN_BB   0x0008

Definition at line 67 of file dib0090.c.

#define EN_BIAS   0x0001

Definition at line 69 of file dib0090.c.

#define EN_CAB   0x88E9

Definition at line 79 of file dib0090.c.

#define EN_CRYSTAL   0x0002

Definition at line 73 of file dib0090.c.

#define EN_DIGCLK   0x0080 /* not in the 0x24 reg, only in 0x1b */

Definition at line 72 of file dib0090.c.

#define EN_IQADC   0x0040

Definition at line 64 of file dib0090.c.

#define EN_IQANA   0x0002

Definition at line 71 of file dib0090.c.

#define EN_LBD   0x11E9

Definition at line 77 of file dib0090.c.

#define EN_LNA0   0x8000

Definition at line 56 of file dib0090.c.

#define EN_LNA1   0x4000

Definition at line 57 of file dib0090.c.

#define EN_LNA2   0x2000

Definition at line 58 of file dib0090.c.

#define EN_LNA3   0x1000

Definition at line 59 of file dib0090.c.

#define EN_LO   0x0004

Definition at line 68 of file dib0090.c.

#define EN_MIX0   0x0800

Definition at line 60 of file dib0090.c.

#define EN_MIX1   0x0400

Definition at line 61 of file dib0090.c.

#define EN_MIX2   0x0200

Definition at line 62 of file dib0090.c.

#define EN_MIX3   0x0100

Definition at line 63 of file dib0090.c.

#define EN_PLL   0x0020

Definition at line 65 of file dib0090.c.

#define EN_SBD   0x44E9

Definition at line 78 of file dib0090.c.

#define EN_TX   0x0010

Definition at line 66 of file dib0090.c.

#define EN_UHF   0x22E9

Definition at line 75 of file dib0090.c.

#define EN_VHF   0x44E9

Definition at line 76 of file dib0090.c.

#define GAIN_ALPHA   5

Definition at line 333 of file dib0090.c.

#define HARD_RESET (   state)    do { if (cfg->reset) { if (cfg->sleep) cfg->sleep(fe, 0); msleep(10); cfg->reset(fe, 1); msleep(10); cfg->reset(fe, 0); msleep(10); } } while (0)

Definition at line 331 of file dib0090.c.

#define HR_MAX   (u8) 40

Definition at line 1521 of file dib0090.c.

#define HR_MIN   (u8) 25

Definition at line 1520 of file dib0090.c.

#define INTERN_WAIT   10

Definition at line 1615 of file dib0090.c.

#define KROSUS   0x2

Definition at line 88 of file dib0090.c.

#define KROSUS_PLL_LOCKED   0x800

Definition at line 87 of file dib0090.c.

#define LPF   100

Definition at line 335 of file dib0090.c.

#define MP001   0x1 /* Single 9090/8096 */

Definition at line 104 of file dib0090.c.

#define MP005   0x4 /* Single Sband */

Definition at line 105 of file dib0090.c.

#define MP008   0x6 /* Dual diversity VHF-UHF-LBAND */

Definition at line 106 of file dib0090.c.

#define MP009   0x7 /* Dual diversity 29098 CBAND-UHF-LBAND-SBAND */

Definition at line 107 of file dib0090.c.

#define P1A_B   0x0

Definition at line 98 of file dib0090.c.

#define P1C   0x1

Definition at line 99 of file dib0090.c.

#define P1D_E_F   0x3

Definition at line 100 of file dib0090.c.

#define P1G   0x7

Definition at line 101 of file dib0090.c.

#define P1G_21R2   0xf

Definition at line 102 of file dib0090.c.

#define pgm_read_word (   w)    (*w)

Definition at line 109 of file dib0090.c.

#define POLY_MAX   (u8) 8

Definition at line 1523 of file dib0090.c.

#define POLY_MIN   (u8) 0

Definition at line 1522 of file dib0090.c.

#define SOC   0x02

Definition at line 91 of file dib0090.c.

#define SOC_7090_P1G_11R1   0x82

Definition at line 92 of file dib0090.c.

#define SOC_7090_P1G_21R1   0x8a

Definition at line 93 of file dib0090.c.

#define SOC_8090_P1G_11R1   0x86

Definition at line 94 of file dib0090.c.

#define SOC_8090_P1G_21R1   0x8e

Definition at line 95 of file dib0090.c.

#define steps (   u)    (((u) > 15) ? ((u)-16) : (u))

Definition at line 1614 of file dib0090.c.

#define TEMP_CAL   0x4

Definition at line 84 of file dib0090.c.

#define WBD   0x781 /* 1 1 1 1 0000 0 0 1 */

Definition at line 2250 of file dib0090.c.

#define WBD   0x781 /* 1 1 1 1 0000 0 0 1 */

Definition at line 2250 of file dib0090.c.

#define WBD_ALPHA   6

Definition at line 334 of file dib0090.c.

#define WBD_CAL   0x2

Definition at line 83 of file dib0090.c.

Function Documentation

void dib0090_dcc_freq ( struct dvb_frontend fe,
u8  fast 
)

Definition at line 685 of file dib0090.c.

struct dvb_frontend* dib0090_fw_register ( struct dvb_frontend fe,
struct i2c_adapter i2c,
const struct dib0090_config config 
)
read

Definition at line 2657 of file dib0090.c.

int dib0090_gain_control ( struct dvb_frontend fe)

Definition at line 1174 of file dib0090.c.

void dib0090_get_current_gain ( struct dvb_frontend fe,
u16 rf,
u16 bb,
u16 rf_gain_limit,
u16 rflt 
)

Definition at line 1337 of file dib0090.c.

enum frontend_tune_state dib0090_get_tune_state ( struct dvb_frontend fe)

Definition at line 2542 of file dib0090.c.

u16 dib0090_get_wbd_offset ( struct dvb_frontend fe)

Definition at line 1391 of file dib0090.c.

u16 dib0090_get_wbd_target ( struct dvb_frontend fe)

Definition at line 1352 of file dib0090.c.

void dib0090_pwm_gain_reset ( struct dvb_frontend fe)

Definition at line 1089 of file dib0090.c.

struct dvb_frontend* dib0090_register ( struct dvb_frontend fe,
struct i2c_adapter i2c,
const struct dib0090_config config 
)
read

Definition at line 2625 of file dib0090.c.

void dib0090_set_dc_servo ( struct dvb_frontend fe,
u8  DC_servo_cutoff 
)

Definition at line 1158 of file dib0090.c.

int dib0090_set_switch ( struct dvb_frontend fe,
u8  sw1,
u8  sw2,
u8  sw3 
)

Definition at line 1398 of file dib0090.c.

int dib0090_set_tune_state ( struct dvb_frontend fe,
enum frontend_tune_state  tune_state 
)

Definition at line 2551 of file dib0090.c.

int dib0090_set_vga ( struct dvb_frontend fe,
u8  onoff 
)

Definition at line 1409 of file dib0090.c.

int dib0090_update_rframp_7090 ( struct dvb_frontend fe,
u8  cfg_sensitivity 
)

Definition at line 1419 of file dib0090.c.

int dib0090_update_tuning_table_7090 ( struct dvb_frontend fe,
u8  cfg_sensitivity 
)

Definition at line 2060 of file dib0090.c.

EXPORT_SYMBOL ( dib0090_dcc_freq  )
EXPORT_SYMBOL ( dib0090_pwm_gain_reset  )
EXPORT_SYMBOL ( dib0090_set_dc_servo  )
EXPORT_SYMBOL ( dib0090_gain_control  )
EXPORT_SYMBOL ( dib0090_get_current_gain  )
EXPORT_SYMBOL ( dib0090_get_wbd_target  )
EXPORT_SYMBOL ( dib0090_get_wbd_offset  )
EXPORT_SYMBOL ( dib0090_set_switch  )
EXPORT_SYMBOL ( dib0090_set_vga  )
EXPORT_SYMBOL ( dib0090_update_rframp_7090  )
EXPORT_SYMBOL ( dib0090_update_tuning_table_7090  )
EXPORT_SYMBOL ( dib0090_get_tune_state  )
EXPORT_SYMBOL ( dib0090_set_tune_state  )
EXPORT_SYMBOL ( dib0090_register  )
EXPORT_SYMBOL ( dib0090_fw_register  )
MODULE_AUTHOR ( "Patrick Boettcher <[email protected]>"  )
MODULE_AUTHOR ( "Olivier Grenie <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for the DiBcom 0090 base-band RF Tuner"  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"turn on debugging (default: 0)"   
)