Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dibx000_common.h
Go to the documentation of this file.
1 #ifndef DIBX000_COMMON_H
2 #define DIBX000_COMMON_H
3 
9 };
10 
12 #define DIB3000MC 1
13 #define DIB7000 2
14 #define DIB7000P 11
15 #define DIB7000MC 12
16 #define DIB8000 13
18 
20 
21 /* struct i2c_adapter tuner_i2c_adap; */
26 
29 
31 
32  /* for the I2C transfer */
33  struct i2c_msg msg[34];
37 };
38 
39 extern int dibx000_init_i2c_master(struct dibx000_i2c_master *mst,
40  u16 device_rev, struct i2c_adapter *i2c_adap,
41  u8 i2c_addr);
43  *mst,
45  intf, int gating);
46 extern void dibx000_exit_i2c_master(struct dibx000_i2c_master *mst);
47 extern void dibx000_reset_i2c_master(struct dibx000_i2c_master *mst);
48 extern int dibx000_i2c_set_speed(struct i2c_adapter *i2c_adap, u16 speed);
49 
50 extern u32 systime(void);
51 
52 #define BAND_LBAND 0x01
53 #define BAND_UHF 0x02
54 #define BAND_VHF 0x04
55 #define BAND_SBAND 0x08
56 #define BAND_FM 0x10
57 #define BAND_CBAND 0x20
58 
59 #define BAND_OF_FREQUENCY(freq_kHz) ((freq_kHz) <= 170000 ? BAND_CBAND : \
60  (freq_kHz) <= 115000 ? BAND_FM : \
61  (freq_kHz) <= 250000 ? BAND_VHF : \
62  (freq_kHz) <= 863000 ? BAND_UHF : \
63  (freq_kHz) <= 2000000 ? BAND_LBAND : BAND_SBAND )
64 
66  /* defines the capabilities of this AGC-setting - using the BAND_-defines */
68 
70 
73 
76 
81 
86 
90 
93 
96 
99 
102 
105 
107 
108  struct {
113  } split;
114 };
115 
117  u32 internal;
119 
125 
131 
133 
136 
138 };
139 
147 };
148 
149 #define BANDWIDTH_TO_KHZ(v) ((v) / 1000)
150 #define BANDWIDTH_TO_HZ(v) ((v) * 1000)
151 
152 /* Chip output mode. */
153 #define OUTMODE_HIGH_Z 0
154 #define OUTMODE_MPEG2_PAR_GATED_CLK 1
155 #define OUTMODE_MPEG2_PAR_CONT_CLK 2
156 #define OUTMODE_MPEG2_SERIAL 7
157 #define OUTMODE_DIVERSITY 4
158 #define OUTMODE_MPEG2_FIFO 5
159 #define OUTMODE_ANALOG_ADC 6
160 
161 #define INPUT_MODE_OFF 0x11
162 #define INPUT_MODE_DIVERSITY 0x12
163 #define INPUT_MODE_MPEG 0x13
164 
176 
184 
199 
200  CT_DONE = 100,
202 
203 };
204 
206 #define CHANNEL_STATUS_PARAMETERS_UNKNOWN 0x01
207 #define CHANNEL_STATUS_PARAMETERS_SET 0x02
211  u16 tps[9];
212 };
213 
214 #define FE_STATUS_TUNE_FAILED 0
215 #define FE_STATUS_TUNE_TIMED_OUT -1
216 #define FE_STATUS_TUNE_TIME_TOO_SHORT -2
217 #define FE_STATUS_TUNE_PENDING -3
218 #define FE_STATUS_STD_SUCCESS -4
219 #define FE_STATUS_FFT_SUCCESS -5
220 #define FE_STATUS_DEMOD_SUCCESS -6
221 #define FE_STATUS_LOCKED -7
222 #define FE_STATUS_DATA_LOCKED -8
223 
224 #define FE_CALLBACK_TIME_NEVER 0xffffffff
225 
226 #define ABS(x) ((x < 0) ? (-x) : (x))
227 
228 #define DATA_BUS_ACCESS_MODE_8BIT 0x01
229 #define DATA_BUS_ACCESS_MODE_16BIT 0x02
230 #define DATA_BUS_ACCESS_MODE_NO_ADDRESS_INCREMENT 0x10
231 
233 #define BOARD_GPIO_COMPONENT_BUS_ADAPTER 1
234 #define BOARD_GPIO_COMPONENT_DEMOD 2
236 
237 #define BOARD_GPIO_FUNCTION_BOARD_ON 1
238 #define BOARD_GPIO_FUNCTION_BOARD_OFF 2
239 #define BOARD_GPIO_FUNCTION_COMPONENT_ON 3
240 #define BOARD_GPIO_FUNCTION_COMPONENT_OFF 4
241 #define BOARD_GPIO_FUNCTION_SUBBAND_PWM 5
242 #define BOARD_GPIO_FUNCTION_SUBBAND_GPIO 6
243  u8 function;
244 
245 /* mask, direction and value are used specify which GPIO to change GPIO0
246  * is LSB and possible GPIO31 is MSB. The same bit-position as in the
247  * mask is used for the direction and the value. Direction == 1 is OUT,
248  * 0 == IN. For direction "OUT" value is either 1 or 0, for direction IN
249  * value has no meaning.
250  *
251  * In case of BOARD_GPIO_FUNCTION_PWM mask is giving the GPIO to be
252  * used to do the PWM. Direction gives the PWModulator to be used.
253  * Value gives the PWM value in device-dependent scale.
254  */
258 };
259 
260 #define MAX_NB_SUBBANDS 8
262  u8 size; /* Actual number of subbands. */
263  struct {
267 };
268 
269 #define DEMOD_TIMF_SET 0x00
270 #define DEMOD_TIMF_GET 0x01
271 #define DEMOD_TIMF_UPDATE 0x02
272 
273 #define MPEG_ON_DIBTX 1
274 #define DIV_ON_DIBTX 2
275 #define ADC_ON_DIBTX 3
276 #define DEMOUT_ON_HOSTBUS 4
277 #define DIBTX_ON_HOSTBUS 5
278 #define MPEG_ON_HOSTBUS 6
279 
280 #endif