Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
mt2063.c File Reference
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/videodev2.h>
#include "mt2063.h"

Go to the source code of this file.

Data Structures

struct  MT2063_ExclZone_t
 
struct  MT2063_AvoidSpursData_t
 
struct  mt2063_state
 
struct  MT2063_FIFZone_t
 

Macros

#define dprintk(level, fmt, arg...)
 
#define MT2063_SPUR_PRESENT_ERR   (0x00800000)
 
#define MT2063_SPUR_CNT_MASK   (0x001f0000)
 
#define MT2063_SPUR_SHIFT   (16)
 
#define MT2063_UPC_RANGE   (0x04000000)
 
#define MT2063_DNC_RANGE   (0x08000000)
 
#define MT2063_DECT_AVOID_US_FREQS   0x00000001
 
#define MT2063_DECT_AVOID_EURO_FREQS   0x00000002
 
#define MT2063_EXCLUDE_US_DECT_FREQUENCIES(s)   (((s) & MT2063_DECT_AVOID_US_FREQS) != 0)
 
#define MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(s)   (((s) & MT2063_DECT_AVOID_EURO_FREQS) != 0)
 
#define MT2063_MAX_ZONES   48
 
#define ceil(n, d)   (((n) < 0) ? (-((-(n))/(d))) : (n)/(d) + ((n)%(d) != 0))
 
#define floor(n, d)   (((n) < 0) ? (-((-(n))/(d))) - ((n)%(d) != 0) : (n)/(d))
 
#define MT2063_REF_FREQ   (16000000UL) /* Reference oscillator Frequency (in Hz) */
 
#define MT2063_IF1_BW   (22000000UL) /* The IF1 filter bandwidth (in Hz) */
 
#define MT2063_TUNE_STEP_SIZE   (50000UL) /* Tune in steps of 50 kHz */
 
#define MT2063_SPUR_STEP_HZ   (250000UL) /* Step size (in Hz) to move IF1 when avoiding spurs */
 
#define MT2063_ZIF_BW   (2000000UL) /* Zero-IF spur-free bandwidth (in Hz) */
 
#define MT2063_MAX_HARMONICS_1   (15UL) /* Highest intra-tuner LO Spur Harmonic to be avoided */
 
#define MT2063_MAX_HARMONICS_2   (5UL) /* Highest inter-tuner LO Spur Harmonic to be avoided */
 
#define MT2063_MIN_LO_SEP   (1000000UL) /* Minimum inter-tuner LO frequency separation */
 
#define MT2063_LO1_FRACN_AVOID   (0UL) /* LO1 FracN numerator avoid region (in Hz) */
 
#define MT2063_LO2_FRACN_AVOID   (199999UL) /* LO2 FracN numerator avoid region (in Hz) */
 
#define MT2063_MIN_FIN_FREQ   (44000000UL) /* Minimum input frequency (in Hz) */
 
#define MT2063_MAX_FIN_FREQ   (1100000000UL) /* Maximum input frequency (in Hz) */
 
#define MT2063_MIN_FOUT_FREQ   (36000000UL) /* Minimum output frequency (in Hz) */
 
#define MT2063_MAX_FOUT_FREQ   (57000000UL) /* Maximum output frequency (in Hz) */
 
#define MT2063_MIN_DNC_FREQ   (1293000000UL) /* Minimum LO2 frequency (in Hz) */
 
#define MT2063_MAX_DNC_FREQ   (1614000000UL) /* Maximum LO2 frequency (in Hz) */
 
#define MT2063_MIN_UPC_FREQ   (1396000000UL) /* Minimum LO1 frequency (in Hz) */
 
#define MT2063_MAX_UPC_FREQ   (2750000000UL) /* Maximum LO1 frequency (in Hz) */
 
#define MT2063_B0   (0x9B)
 
#define MT2063_B1   (0x9C)
 
#define MT2063_B2   (0x9D)
 
#define MT2063_B3   (0x9E)
 
#define MAX_SYMBOL_RATE_6MHz   5217391
 

Enumerations

enum  MT2063_DECT_Avoid_Type { MT2063_NO_DECT_AVOIDANCE = 0, MT2063_AVOID_US_DECT = MT2063_DECT_AVOID_US_FREQS, MT2063_AVOID_EURO_DECT = MT2063_DECT_AVOID_EURO_FREQS, MT2063_AVOID_BOTH }
 
enum  MT2063_Mask_Bits {
  MT2063_REG_SD = 0x0040, MT2063_SRO_SD = 0x0020, MT2063_AFC_SD = 0x0010, MT2063_PD_SD = 0x0002,
  MT2063_PDADC_SD = 0x0001, MT2063_VCO_SD = 0x8000, MT2063_LTX_SD = 0x4000, MT2063_LT1_SD = 0x2000,
  MT2063_LNA_SD = 0x1000, MT2063_UPC_SD = 0x0800, MT2063_DNC_SD = 0x0400, MT2063_VGA_SD = 0x0200,
  MT2063_AMP_SD = 0x0100, MT2063_ALL_SD = 0xFF73, MT2063_NONE_SD = 0x0000
}
 
enum  MT2063_DNC_Output_Enable { MT2063_DNC_NONE = 0, MT2063_DNC_1, MT2063_DNC_2, MT2063_DNC_BOTH }
 
enum  MT2063_Register_Offsets {
  MT2063_REG_PART_REV = 0, MT2063_REG_LO1CQ_1, MT2063_REG_LO1CQ_2, MT2063_REG_LO2CQ_1,
  MT2063_REG_LO2CQ_2, MT2063_REG_LO2CQ_3, MT2063_REG_RSVD_06, MT2063_REG_LO_STATUS,
  MT2063_REG_FIFFC, MT2063_REG_CLEARTUNE, MT2063_REG_ADC_OUT, MT2063_REG_LO1C_1,
  MT2063_REG_LO1C_2, MT2063_REG_LO2C_1, MT2063_REG_LO2C_2, MT2063_REG_LO2C_3,
  MT2063_REG_RSVD_10, MT2063_REG_PWR_1, MT2063_REG_PWR_2, MT2063_REG_TEMP_STATUS,
  MT2063_REG_XO_STATUS, MT2063_REG_RF_STATUS, MT2063_REG_FIF_STATUS, MT2063_REG_LNA_OV,
  MT2063_REG_RF_OV, MT2063_REG_FIF_OV, MT2063_REG_LNA_TGT, MT2063_REG_PD1_TGT,
  MT2063_REG_PD2_TGT, MT2063_REG_RSVD_1D, MT2063_REG_RSVD_1E, MT2063_REG_RSVD_1F,
  MT2063_REG_RSVD_20, MT2063_REG_BYP_CTRL, MT2063_REG_RSVD_22, MT2063_REG_RSVD_23,
  MT2063_REG_RSVD_24, MT2063_REG_RSVD_25, MT2063_REG_RSVD_26, MT2063_REG_RSVD_27,
  MT2063_REG_FIFF_CTRL, MT2063_REG_FIFF_OFFSET, MT2063_REG_CTUNE_CTRL, MT2063_REG_CTUNE_OV,
  MT2063_REG_CTRL_2C, MT2063_REG_FIFF_CTRL2, MT2063_REG_RSVD_2E, MT2063_REG_DNC_GAIN,
  MT2063_REG_VGA_GAIN, MT2063_REG_RSVD_31, MT2063_REG_TEMP_SEL, MT2063_REG_RSVD_33,
  MT2063_REG_RSVD_34, MT2063_REG_RSVD_35, MT2063_REG_RSVD_36, MT2063_REG_RSVD_37,
  MT2063_REG_RSVD_38, MT2063_REG_RSVD_39, MT2063_REG_RSVD_3A, MT2063_REG_RSVD_3B,
  MT2063_REG_RSVD_3C, MT2063_REG_END_REGS
}
 
enum  mt2063_delivery_sys {
  MT2063_CABLE_QAM = 0, MT2063_CABLE_ANALOG, MT2063_OFFAIR_COFDM, MT2063_OFFAIR_COFDM_SAWLESS,
  MT2063_OFFAIR_ANALOG, MT2063_OFFAIR_8VSB, MT2063_NUM_RCVR_MODES
}
 

Functions

 module_param (debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"Set Verbosity level")
 
struct dvb_frontendmt2063_attach (struct dvb_frontend *fe, struct mt2063_config *config, struct i2c_adapter *i2c)
 
 EXPORT_SYMBOL_GPL (mt2063_attach)
 
 MODULE_AUTHOR ("Mauro Carvalho Chehab <[email protected]>")
 
 MODULE_DESCRIPTION ("MT2063 Silicon tuner")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ceil (   n,
  d 
)    (((n) < 0) ? (-((-(n))/(d))) : (n)/(d) + ((n)%(d) != 0))

Definition at line 363 of file mt2063.c.

#define dprintk (   level,
  fmt,
  arg... 
)
Value:
do { \
if (debug >= level) \
printk(KERN_DEBUG "mt2063 %s: " fmt, __func__, ## arg); \
} while (0)

Definition at line 34 of file mt2063.c.

#define floor (   n,
  d 
)    (((n) < 0) ? (-((-(n))/(d))) - ((n)%(d) != 0) : (n)/(d))

Definition at line 364 of file mt2063.c.

#define MAX_SYMBOL_RATE_6MHz   5217391

Definition at line 2127 of file mt2063.c.

#define MT2063_B0   (0x9B)

Definition at line 926 of file mt2063.c.

#define MT2063_B1   (0x9C)

Definition at line 927 of file mt2063.c.

#define MT2063_B2   (0x9D)

Definition at line 928 of file mt2063.c.

#define MT2063_B3   (0x9E)

Definition at line 929 of file mt2063.c.

#define MT2063_DECT_AVOID_EURO_FREQS   0x00000002

Definition at line 67 of file mt2063.c.

#define MT2063_DECT_AVOID_US_FREQS   0x00000001

Definition at line 65 of file mt2063.c.

#define MT2063_DNC_RANGE   (0x08000000)

Definition at line 53 of file mt2063.c.

#define MT2063_EXCLUDE_EURO_DECT_FREQUENCIES (   s)    (((s) & MT2063_DECT_AVOID_EURO_FREQS) != 0)

Definition at line 71 of file mt2063.c.

#define MT2063_EXCLUDE_US_DECT_FREQUENCIES (   s)    (((s) & MT2063_DECT_AVOID_US_FREQS) != 0)

Definition at line 69 of file mt2063.c.

#define MT2063_IF1_BW   (22000000UL) /* The IF1 filter bandwidth (in Hz) */

Definition at line 905 of file mt2063.c.

#define MT2063_LO1_FRACN_AVOID   (0UL) /* LO1 FracN numerator avoid region (in Hz) */

Definition at line 912 of file mt2063.c.

#define MT2063_LO2_FRACN_AVOID   (199999UL) /* LO2 FracN numerator avoid region (in Hz) */

Definition at line 913 of file mt2063.c.

#define MT2063_MAX_DNC_FREQ   (1614000000UL) /* Maximum LO2 frequency (in Hz) */

Definition at line 919 of file mt2063.c.

#define MT2063_MAX_FIN_FREQ   (1100000000UL) /* Maximum input frequency (in Hz) */

Definition at line 915 of file mt2063.c.

#define MT2063_MAX_FOUT_FREQ   (57000000UL) /* Maximum output frequency (in Hz) */

Definition at line 917 of file mt2063.c.

#define MT2063_MAX_HARMONICS_1   (15UL) /* Highest intra-tuner LO Spur Harmonic to be avoided */

Definition at line 909 of file mt2063.c.

#define MT2063_MAX_HARMONICS_2   (5UL) /* Highest inter-tuner LO Spur Harmonic to be avoided */

Definition at line 910 of file mt2063.c.

#define MT2063_MAX_UPC_FREQ   (2750000000UL) /* Maximum LO1 frequency (in Hz) */

Definition at line 921 of file mt2063.c.

#define MT2063_MAX_ZONES   48

Definition at line 80 of file mt2063.c.

#define MT2063_MIN_DNC_FREQ   (1293000000UL) /* Minimum LO2 frequency (in Hz) */

Definition at line 918 of file mt2063.c.

#define MT2063_MIN_FIN_FREQ   (44000000UL) /* Minimum input frequency (in Hz) */

Definition at line 914 of file mt2063.c.

#define MT2063_MIN_FOUT_FREQ   (36000000UL) /* Minimum output frequency (in Hz) */

Definition at line 916 of file mt2063.c.

#define MT2063_MIN_LO_SEP   (1000000UL) /* Minimum inter-tuner LO frequency separation */

Definition at line 911 of file mt2063.c.

#define MT2063_MIN_UPC_FREQ   (1396000000UL) /* Minimum LO1 frequency (in Hz) */

Definition at line 920 of file mt2063.c.

#define MT2063_REF_FREQ   (16000000UL) /* Reference oscillator Frequency (in Hz) */

Definition at line 904 of file mt2063.c.

#define MT2063_SPUR_CNT_MASK   (0x001f0000)

Definition at line 46 of file mt2063.c.

#define MT2063_SPUR_PRESENT_ERR   (0x00800000)

Definition at line 43 of file mt2063.c.

#define MT2063_SPUR_SHIFT   (16)

Definition at line 47 of file mt2063.c.

#define MT2063_SPUR_STEP_HZ   (250000UL) /* Step size (in Hz) to move IF1 when avoiding spurs */

Definition at line 907 of file mt2063.c.

#define MT2063_TUNE_STEP_SIZE   (50000UL) /* Tune in steps of 50 kHz */

Definition at line 906 of file mt2063.c.

#define MT2063_UPC_RANGE   (0x04000000)

Definition at line 50 of file mt2063.c.

#define MT2063_ZIF_BW   (2000000UL) /* Zero-IF spur-free bandwidth (in Hz) */

Definition at line 908 of file mt2063.c.

Enumeration Type Documentation

Enumerator:
MT2063_NO_DECT_AVOIDANCE 
MT2063_AVOID_US_DECT 
MT2063_AVOID_EURO_DECT 
MT2063_AVOID_BOTH 

Definition at line 73 of file mt2063.c.

Enumerator:
MT2063_CABLE_QAM 
MT2063_CABLE_ANALOG 
MT2063_OFFAIR_COFDM 
MT2063_OFFAIR_COFDM_SAWLESS 
MT2063_OFFAIR_ANALOG 
MT2063_OFFAIR_8VSB 
MT2063_NUM_RCVR_MODES 

Definition at line 1010 of file mt2063.c.

Enumerator:
MT2063_DNC_NONE 
MT2063_DNC_1 
MT2063_DNC_2 
MT2063_DNC_BOTH 

Definition at line 144 of file mt2063.c.

Enumerator:
MT2063_REG_SD 
MT2063_SRO_SD 
MT2063_AFC_SD 
MT2063_PD_SD 
MT2063_PDADC_SD 
MT2063_VCO_SD 
MT2063_LTX_SD 
MT2063_LT1_SD 
MT2063_LNA_SD 
MT2063_UPC_SD 
MT2063_DNC_SD 
MT2063_VGA_SD 
MT2063_AMP_SD 
MT2063_ALL_SD 
MT2063_NONE_SD 

Definition at line 123 of file mt2063.c.

Enumerator:
MT2063_REG_PART_REV 
MT2063_REG_LO1CQ_1 
MT2063_REG_LO1CQ_2 
MT2063_REG_LO2CQ_1 
MT2063_REG_LO2CQ_2 
MT2063_REG_LO2CQ_3 
MT2063_REG_RSVD_06 
MT2063_REG_LO_STATUS 
MT2063_REG_FIFFC 
MT2063_REG_CLEARTUNE 
MT2063_REG_ADC_OUT 
MT2063_REG_LO1C_1 
MT2063_REG_LO1C_2 
MT2063_REG_LO2C_1 
MT2063_REG_LO2C_2 
MT2063_REG_LO2C_3 
MT2063_REG_RSVD_10 
MT2063_REG_PWR_1 
MT2063_REG_PWR_2 
MT2063_REG_TEMP_STATUS 
MT2063_REG_XO_STATUS 
MT2063_REG_RF_STATUS 
MT2063_REG_FIF_STATUS 
MT2063_REG_LNA_OV 
MT2063_REG_RF_OV 
MT2063_REG_FIF_OV 
MT2063_REG_LNA_TGT 
MT2063_REG_PD1_TGT 
MT2063_REG_PD2_TGT 
MT2063_REG_RSVD_1D 
MT2063_REG_RSVD_1E 
MT2063_REG_RSVD_1F 
MT2063_REG_RSVD_20 
MT2063_REG_BYP_CTRL 
MT2063_REG_RSVD_22 
MT2063_REG_RSVD_23 
MT2063_REG_RSVD_24 
MT2063_REG_RSVD_25 
MT2063_REG_RSVD_26 
MT2063_REG_RSVD_27 
MT2063_REG_FIFF_CTRL 
MT2063_REG_FIFF_OFFSET 
MT2063_REG_CTUNE_CTRL 
MT2063_REG_CTUNE_OV 
MT2063_REG_CTRL_2C 
MT2063_REG_FIFF_CTRL2 
MT2063_REG_RSVD_2E 
MT2063_REG_DNC_GAIN 
MT2063_REG_VGA_GAIN 
MT2063_REG_RSVD_31 
MT2063_REG_TEMP_SEL 
MT2063_REG_RSVD_33 
MT2063_REG_RSVD_34 
MT2063_REG_RSVD_35 
MT2063_REG_RSVD_36 
MT2063_REG_RSVD_37 
MT2063_REG_RSVD_38 
MT2063_REG_RSVD_39 
MT2063_REG_RSVD_3A 
MT2063_REG_RSVD_3B 
MT2063_REG_RSVD_3C 
MT2063_REG_END_REGS 

Definition at line 155 of file mt2063.c.

Function Documentation

EXPORT_SYMBOL_GPL ( mt2063_attach  )
MODULE_AUTHOR ( "Mauro Carvalho Chehab <[email protected]>"  )
MODULE_DESCRIPTION ( "MT2063 Silicon tuner )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"Set Verbosity level  
)
struct dvb_frontend* mt2063_attach ( struct dvb_frontend fe,
struct mt2063_config config,
struct i2c_adapter i2c 
)
read

Definition at line 2243 of file mt2063.c.