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

Go to the source code of this file.

Data Structures

struct  i2c_device
 
struct  dib9000_pid_ctrl
 
struct  dib9000_state
 

Macros

#define dprintk(args...)   do { if (debug) { printk(KERN_DEBUG "DiB9000: "); printk(args); printk("\n"); } } while (0)
 
#define MAX_NUMBER_OF_FRONTENDS   6
 
#define DIB9000_PID_FILTER_CTRL   0
 
#define DIB9000_PID_FILTER   1
 
#define DIB9000_GPIO_DEFAULT_DIRECTIONS   0xffff
 
#define DIB9000_GPIO_DEFAULT_VALUES   0x0000
 
#define DIB9000_GPIO_DEFAULT_PWM_POS   0xffff
 
#define MBX_MAX_WORDS   (256 - 200 - 2)
 
#define DIB9000_MSG_CACHE_SIZE   2
 
#define FE_MM_W_CHANNEL   0
 
#define FE_MM_W_FE_INFO   1
 
#define FE_MM_RW_SYNC   2
 
#define FE_SYNC_CHANNEL   1
 
#define FE_SYNC_W_GENERIC_MONIT   2
 
#define FE_SYNC_COMPONENT_ACCESS   3
 
#define FE_MM_R_CHANNEL_SEARCH_STATE   3
 
#define FE_MM_R_CHANNEL_UNION_CONTEXT   4
 
#define FE_MM_R_FE_INFO   5
 
#define FE_MM_R_FE_MONITOR   6
 
#define FE_MM_W_CHANNEL_HEAD   7
 
#define FE_MM_W_CHANNEL_UNION   8
 
#define FE_MM_W_CHANNEL_CONTEXT   9
 
#define FE_MM_R_CHANNEL_UNION   10
 
#define FE_MM_R_CHANNEL_CONTEXT   11
 
#define FE_MM_R_CHANNEL_TUNE_STATE   12
 
#define FE_MM_R_GENERIC_MONITORING_SIZE   13
 
#define FE_MM_W_GENERIC_MONITORING   14
 
#define FE_MM_R_GENERIC_MONITORING   15
 
#define FE_MM_W_COMPONENT_ACCESS   16
 
#define FE_MM_RW_COMPONENT_ACCESS_BUFFER   17
 
#define dib9000_read16_noinc_attr(state, reg, b, len, attribute)   dib9000_read16_attr(state, reg, b, len, (attribute) | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)
 
#define dib9000_write(state, reg, buf, len)   dib9000_write16_attr(state, reg, buf, len, 0)
 
#define dib9000_write16_noinc(state, reg, buf, len)   dib9000_write16_attr(state, reg, buf, len, DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)
 
#define dib9000_write16_noinc_attr(state, reg, buf, len, attribute)   dib9000_write16_attr(state, reg, buf, len, DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT | (attribute))
 
#define dib9000_mbx_send(state, id, data, len)   dib9000_mbx_send_attr(state, id, data, len, 0)
 
#define dib9000_mbx_get_message(state, id, msg, len)   dib9000_mbx_get_message_attr(state, id, msg, len, 0)
 
#define MAC_IRQ   (1 << 1)
 
#define IRQ_POL_MSK   (1 << 4)
 
#define dib9000_risc_mem_read_chunks(state, b, len)   dib9000_read16_attr(state, 1063, b, len, DATA_BUS_ACCESS_MODE_8BIT | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)
 
#define dib9000_risc_mem_write_chunks(state, buf, len)   dib9000_write16_attr(state, 1063, buf, len, DATA_BUS_ACCESS_MODE_8BIT | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)
 
#define MAX_MAILBOX_TRY   100
 

Enumerations

enum  dib9000_power_mode {
  DIB9000_POWER_ALL = 0, DIB9000_POWER_NO, DIB9000_POWER_INTERF_ANALOG_AGC, DIB9000_POWER_COR4_DINTLV_ICIRM_EQUAL_CFROD,
  DIB9000_POWER_COR4_CRY_ESRAM_MOUT_NUD, DIB9000_POWER_INTERFACE_ONLY
}
 
enum  dib9000_out_messages {
  OUT_MSG_HBM_ACK, OUT_MSG_HOST_BUF_FAIL, OUT_MSG_REQ_VERSION, OUT_MSG_BRIDGE_I2C_W,
  OUT_MSG_BRIDGE_I2C_R, OUT_MSG_BRIDGE_APB_W, OUT_MSG_BRIDGE_APB_R, OUT_MSG_SCAN_CHANNEL,
  OUT_MSG_MONIT_DEMOD, OUT_MSG_CONF_GPIO, OUT_MSG_DEBUG_HELP, OUT_MSG_SUBBAND_SEL,
  OUT_MSG_ENABLE_TIME_SLICE, OUT_MSG_FE_FW_DL, OUT_MSG_FE_CHANNEL_SEARCH, OUT_MSG_FE_CHANNEL_TUNE,
  OUT_MSG_FE_SLEEP, OUT_MSG_FE_SYNC, OUT_MSG_CTL_MONIT, OUT_MSG_CONF_SVC,
  OUT_MSG_SET_HBM, OUT_MSG_INIT_DEMOD, OUT_MSG_ENABLE_DIVERSITY, OUT_MSG_SET_OUTPUT_MODE,
  OUT_MSG_SET_PRIORITARY_CHANNEL, OUT_MSG_ACK_FRG, OUT_MSG_INIT_PMU
}
 
enum  dib9000_in_messages {
  IN_MSG_DATA, IN_MSG_FRAME_INFO, IN_MSG_CTL_MONIT, IN_MSG_ACK_FREE_ITEM,
  IN_MSG_DEBUG_BUF, IN_MSG_MPE_MONITOR, IN_MSG_RAWTS_MONITOR, IN_MSG_END_BRIDGE_I2C_RW,
  IN_MSG_END_BRIDGE_APB_RW, IN_MSG_VERSION, IN_MSG_END_OF_SCAN, IN_MSG_MONIT_DEMOD,
  IN_MSG_ERROR, IN_MSG_FE_FW_DL_DONE, IN_MSG_EVENT, IN_MSG_ACK_CHANGE_SVC,
  IN_MSG_HBM_PROF
}
 

Functions

 module_param (debug, int, 0644)
 
 MODULE_PARM_DESC (debug,"turn on debugging (default: 0)")
 
int dib9000_fw_set_component_bus_speed (struct dvb_frontend *fe, u16 speed)
 
 EXPORT_SYMBOL (dib9000_fw_set_component_bus_speed)
 
struct i2c_adapterdib9000_get_tuner_interface (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib9000_get_tuner_interface)
 
struct i2c_adapterdib9000_get_component_bus_interface (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib9000_get_component_bus_interface)
 
struct i2c_adapterdib9000_get_i2c_master (struct dvb_frontend *fe, enum dibx000_i2c_interface intf, int gating)
 
 EXPORT_SYMBOL (dib9000_get_i2c_master)
 
int dib9000_set_i2c_adapter (struct dvb_frontend *fe, struct i2c_adapter *i2c)
 
 EXPORT_SYMBOL (dib9000_set_i2c_adapter)
 
int dib9000_set_gpio (struct dvb_frontend *fe, u8 num, u8 dir, u8 val)
 
 EXPORT_SYMBOL (dib9000_set_gpio)
 
int dib9000_fw_pid_filter_ctrl (struct dvb_frontend *fe, u8 onoff)
 
 EXPORT_SYMBOL (dib9000_fw_pid_filter_ctrl)
 
int dib9000_fw_pid_filter (struct dvb_frontend *fe, u8 id, u16 pid, u8 onoff)
 
 EXPORT_SYMBOL (dib9000_fw_pid_filter)
 
int dib9000_firmware_post_pll_init (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib9000_firmware_post_pll_init)
 
int dib9000_i2c_enumeration (struct i2c_adapter *i2c, int no_of_demods, u8 default_addr, u8 first_addr)
 
 EXPORT_SYMBOL (dib9000_i2c_enumeration)
 
int dib9000_set_slave_frontend (struct dvb_frontend *fe, struct dvb_frontend *fe_slave)
 
 EXPORT_SYMBOL (dib9000_set_slave_frontend)
 
int dib9000_remove_slave_frontend (struct dvb_frontend *fe)
 
 EXPORT_SYMBOL (dib9000_remove_slave_frontend)
 
struct dvb_frontenddib9000_get_slave_frontend (struct dvb_frontend *fe, int slave_index)
 
 EXPORT_SYMBOL (dib9000_get_slave_frontend)
 
struct dvb_frontenddib9000_attach (struct i2c_adapter *i2c_adap, u8 i2c_addr, const struct dib9000_config *cfg)
 
 EXPORT_SYMBOL (dib9000_attach)
 
 MODULE_AUTHOR ("Patrick Boettcher <[email protected]>")
 
 MODULE_AUTHOR ("Olivier Grenie <[email protected]>")
 
 MODULE_DESCRIPTION ("Driver for the DiBcom 9000 COFDM demodulator")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DIB9000_GPIO_DEFAULT_DIRECTIONS   0xffff

Definition at line 59 of file dib9000.c.

#define DIB9000_GPIO_DEFAULT_PWM_POS   0xffff

Definition at line 63 of file dib9000.c.

#define DIB9000_GPIO_DEFAULT_VALUES   0x0000

Definition at line 61 of file dib9000.c.

#define dib9000_mbx_get_message (   state,
  id,
  msg,
  len 
)    dib9000_mbx_get_message_attr(state, id, msg, len, 0)

Definition at line 388 of file dib9000.c.

#define dib9000_mbx_send (   state,
  id,
  data,
  len 
)    dib9000_mbx_send_attr(state, id, data, len, 0)

Definition at line 387 of file dib9000.c.

#define DIB9000_MSG_CACHE_SIZE   2

Definition at line 85 of file dib9000.c.

#define DIB9000_PID_FILTER   1

Definition at line 36 of file dib9000.c.

#define DIB9000_PID_FILTER_CTRL   0

Definition at line 35 of file dib9000.c.

#define dib9000_read16_noinc_attr (   state,
  reg,
  b,
  len,
  attribute 
)    dib9000_read16_attr(state, reg, b, len, (attribute) | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)

Definition at line 310 of file dib9000.c.

#define dib9000_risc_mem_read_chunks (   state,
  b,
  len 
)    dib9000_read16_attr(state, 1063, b, len, DATA_BUS_ACCESS_MODE_8BIT | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)

Definition at line 393 of file dib9000.c.

#define dib9000_risc_mem_write_chunks (   state,
  buf,
  len 
)    dib9000_write16_attr(state, 1063, buf, len, DATA_BUS_ACCESS_MODE_8BIT | DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)

Definition at line 394 of file dib9000.c.

#define dib9000_write (   state,
  reg,
  buf,
  len 
)    dib9000_write16_attr(state, reg, buf, len, 0)

Definition at line 383 of file dib9000.c.

#define dib9000_write16_noinc (   state,
  reg,
  buf,
  len 
)    dib9000_write16_attr(state, reg, buf, len, DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT)

Definition at line 384 of file dib9000.c.

#define dib9000_write16_noinc_attr (   state,
  reg,
  buf,
  len,
  attribute 
)    dib9000_write16_attr(state, reg, buf, len, DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT | (attribute))

Definition at line 385 of file dib9000.c.

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

Definition at line 24 of file dib9000.c.

#define FE_MM_R_CHANNEL_CONTEXT   11

Definition at line 194 of file dib9000.c.

#define FE_MM_R_CHANNEL_SEARCH_STATE   3

Definition at line 185 of file dib9000.c.

#define FE_MM_R_CHANNEL_TUNE_STATE   12

Definition at line 195 of file dib9000.c.

#define FE_MM_R_CHANNEL_UNION   10

Definition at line 193 of file dib9000.c.

#define FE_MM_R_CHANNEL_UNION_CONTEXT   4

Definition at line 186 of file dib9000.c.

#define FE_MM_R_FE_INFO   5

Definition at line 187 of file dib9000.c.

#define FE_MM_R_FE_MONITOR   6

Definition at line 188 of file dib9000.c.

#define FE_MM_R_GENERIC_MONITORING   15

Definition at line 199 of file dib9000.c.

#define FE_MM_R_GENERIC_MONITORING_SIZE   13

Definition at line 197 of file dib9000.c.

#define FE_MM_RW_COMPONENT_ACCESS_BUFFER   17

Definition at line 202 of file dib9000.c.

#define FE_MM_RW_SYNC   2

Definition at line 179 of file dib9000.c.

#define FE_MM_W_CHANNEL   0

Definition at line 177 of file dib9000.c.

#define FE_MM_W_CHANNEL_CONTEXT   9

Definition at line 192 of file dib9000.c.

#define FE_MM_W_CHANNEL_HEAD   7

Definition at line 190 of file dib9000.c.

#define FE_MM_W_CHANNEL_UNION   8

Definition at line 191 of file dib9000.c.

#define FE_MM_W_COMPONENT_ACCESS   16

Definition at line 201 of file dib9000.c.

#define FE_MM_W_FE_INFO   1

Definition at line 178 of file dib9000.c.

#define FE_MM_W_GENERIC_MONITORING   14

Definition at line 198 of file dib9000.c.

#define FE_SYNC_CHANNEL   1

Definition at line 181 of file dib9000.c.

#define FE_SYNC_COMPONENT_ACCESS   3

Definition at line 183 of file dib9000.c.

#define FE_SYNC_W_GENERIC_MONIT   2

Definition at line 182 of file dib9000.c.

#define IRQ_POL_MSK   (1 << 4)

Definition at line 391 of file dib9000.c.

#define MAC_IRQ   (1 << 1)

Definition at line 390 of file dib9000.c.

#define MAX_MAILBOX_TRY   100

Definition at line 521 of file dib9000.c.

#define MAX_NUMBER_OF_FRONTENDS   6

Definition at line 25 of file dib9000.c.

#define MBX_MAX_WORDS   (256 - 200 - 2)

Definition at line 84 of file dib9000.c.

Enumeration Type Documentation

Enumerator:
IN_MSG_DATA 
IN_MSG_FRAME_INFO 
IN_MSG_CTL_MONIT 
IN_MSG_ACK_FREE_ITEM 
IN_MSG_DEBUG_BUF 
IN_MSG_MPE_MONITOR 
IN_MSG_RAWTS_MONITOR 
IN_MSG_END_BRIDGE_I2C_RW 
IN_MSG_END_BRIDGE_APB_RW 
IN_MSG_VERSION 
IN_MSG_END_OF_SCAN 
IN_MSG_MONIT_DEMOD 
IN_MSG_ERROR 
IN_MSG_FE_FW_DL_DONE 
IN_MSG_EVENT 
IN_MSG_ACK_CHANGE_SVC 
IN_MSG_HBM_PROF 

Definition at line 156 of file dib9000.c.

Enumerator:
OUT_MSG_HBM_ACK 
OUT_MSG_HOST_BUF_FAIL 
OUT_MSG_REQ_VERSION 
OUT_MSG_BRIDGE_I2C_W 
OUT_MSG_BRIDGE_I2C_R 
OUT_MSG_BRIDGE_APB_W 
OUT_MSG_BRIDGE_APB_R 
OUT_MSG_SCAN_CHANNEL 
OUT_MSG_MONIT_DEMOD 
OUT_MSG_CONF_GPIO 
OUT_MSG_DEBUG_HELP 
OUT_MSG_SUBBAND_SEL 
OUT_MSG_ENABLE_TIME_SLICE 
OUT_MSG_FE_FW_DL 
OUT_MSG_FE_CHANNEL_SEARCH 
OUT_MSG_FE_CHANNEL_TUNE 
OUT_MSG_FE_SLEEP 
OUT_MSG_FE_SYNC 
OUT_MSG_CTL_MONIT 
OUT_MSG_CONF_SVC 
OUT_MSG_SET_HBM 
OUT_MSG_INIT_DEMOD 
OUT_MSG_ENABLE_DIVERSITY 
OUT_MSG_SET_OUTPUT_MODE 
OUT_MSG_SET_PRIORITARY_CHANNEL 
OUT_MSG_ACK_FRG 
OUT_MSG_INIT_PMU 

Definition at line 125 of file dib9000.c.

Enumerator:
DIB9000_POWER_ALL 
DIB9000_POWER_NO 
DIB9000_POWER_INTERF_ANALOG_AGC 
DIB9000_POWER_COR4_DINTLV_ICIRM_EQUAL_CFROD 
DIB9000_POWER_COR4_CRY_ESRAM_MOUT_NUD 
DIB9000_POWER_INTERFACE_ONLY 

Definition at line 115 of file dib9000.c.

Function Documentation

struct dvb_frontend* dib9000_attach ( struct i2c_adapter i2c_adap,
u8  i2c_addr,
const struct dib9000_config cfg 
)
read

Definition at line 2481 of file dib9000.c.

int dib9000_firmware_post_pll_init ( struct dvb_frontend fe)

Definition at line 1831 of file dib9000.c.

int dib9000_fw_pid_filter ( struct dvb_frontend fe,
u8  id,
u16  pid,
u8  onoff 
)

Definition at line 1800 of file dib9000.c.

int dib9000_fw_pid_filter_ctrl ( struct dvb_frontend fe,
u8  onoff 
)

Definition at line 1769 of file dib9000.c.

int dib9000_fw_set_component_bus_speed ( struct dvb_frontend fe,
u16  speed 
)

Definition at line 1635 of file dib9000.c.

struct i2c_adapter* dib9000_get_component_bus_interface ( struct dvb_frontend fe)
read

Definition at line 1722 of file dib9000.c.

struct i2c_adapter* dib9000_get_i2c_master ( struct dvb_frontend fe,
enum dibx000_i2c_interface  intf,
int  gating 
)
read

Definition at line 1729 of file dib9000.c.

struct dvb_frontend* dib9000_get_slave_frontend ( struct dvb_frontend fe,
int  slave_index 
)
read

Definition at line 2470 of file dib9000.c.

struct i2c_adapter* dib9000_get_tuner_interface ( struct dvb_frontend fe)
read

Definition at line 1715 of file dib9000.c.

int dib9000_i2c_enumeration ( struct i2c_adapter i2c,
int  no_of_demods,
u8  default_addr,
u8  first_addr 
)

Definition at line 2365 of file dib9000.c.

int dib9000_remove_slave_frontend ( struct dvb_frontend fe)

Definition at line 2452 of file dib9000.c.

int dib9000_set_gpio ( struct dvb_frontend fe,
u8  num,
u8  dir,
u8  val 
)

Definition at line 1762 of file dib9000.c.

int dib9000_set_i2c_adapter ( struct dvb_frontend fe,
struct i2c_adapter i2c 
)

Definition at line 1736 of file dib9000.c.

int dib9000_set_slave_frontend ( struct dvb_frontend fe,
struct dvb_frontend fe_slave 
)

Definition at line 2434 of file dib9000.c.

EXPORT_SYMBOL ( dib9000_get_tuner_interface  )
EXPORT_SYMBOL ( dib9000_get_i2c_master  )
EXPORT_SYMBOL ( dib9000_set_i2c_adapter  )
EXPORT_SYMBOL ( dib9000_set_gpio  )
EXPORT_SYMBOL ( dib9000_fw_pid_filter_ctrl  )
EXPORT_SYMBOL ( dib9000_fw_pid_filter  )
EXPORT_SYMBOL ( dib9000_firmware_post_pll_init  )
EXPORT_SYMBOL ( dib9000_i2c_enumeration  )
EXPORT_SYMBOL ( dib9000_set_slave_frontend  )
EXPORT_SYMBOL ( dib9000_remove_slave_frontend  )
EXPORT_SYMBOL ( dib9000_get_slave_frontend  )
EXPORT_SYMBOL ( dib9000_attach  )
MODULE_AUTHOR ( "Patrick Boettcher <[email protected]>"  )
MODULE_AUTHOR ( "Olivier Grenie <[email protected]>"  )
MODULE_DESCRIPTION ( "Driver for the DiBcom 9000 COFDM demodulator"  )
MODULE_LICENSE ( "GPL"  )
module_param ( debug  ,
int  ,
0644   
)
MODULE_PARM_DESC ( debug  ,
"turn on debugging (default: 0)"   
)