diff options
author | Olivier Grenie <Olivier.Grenie@dibcom.fr> | 2009-12-04 11:27:57 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:18:16 -0500 |
commit | 03245a5ee69a5faa99b020fe1aca9bafe10c46a9 (patch) | |
tree | 0937b4966ff1f5e09bfcd38fd38bc55e7ac2abef /drivers/media/dvb/frontends/dibx000_common.h | |
parent | 20232c4791507189d4e9499f81632a1ce434f2a4 (diff) |
V4L/DVB (13583): DiB8090: Add the DiB0090 tuner driver and STK8096GP-board
This patchs adds support for the DiBcom DiB0090 RF tuner and for
DiBcom's reference design STK8096GP. Small extracts of the DiB0070 and
the DiB8000-driver into a common codebase.
Signed-off-by: Patrick Boettcher <pboettcher@kernellabs.com>
Signed-off-by: Olivier Grenie <Olivier.Grenie@dibcom.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/dibx000_common.h')
-rw-r--r-- | drivers/media/dvb/frontends/dibx000_common.h | 71 |
1 files changed, 69 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/dibx000_common.h b/drivers/media/dvb/frontends/dibx000_common.h index 5be10eca07c0..06328d8742f8 100644 --- a/drivers/media/dvb/frontends/dibx000_common.h +++ b/drivers/media/dvb/frontends/dibx000_common.h | |||
@@ -36,13 +36,17 @@ extern struct i2c_adapter *dibx000_get_i2c_adapter(struct dibx000_i2c_master | |||
36 | extern void dibx000_exit_i2c_master(struct dibx000_i2c_master *mst); | 36 | extern void dibx000_exit_i2c_master(struct dibx000_i2c_master *mst); |
37 | extern void dibx000_reset_i2c_master(struct dibx000_i2c_master *mst); | 37 | extern void dibx000_reset_i2c_master(struct dibx000_i2c_master *mst); |
38 | 38 | ||
39 | extern u32 systime(void); | ||
40 | |||
39 | #define BAND_LBAND 0x01 | 41 | #define BAND_LBAND 0x01 |
40 | #define BAND_UHF 0x02 | 42 | #define BAND_UHF 0x02 |
41 | #define BAND_VHF 0x04 | 43 | #define BAND_VHF 0x04 |
42 | #define BAND_SBAND 0x08 | 44 | #define BAND_SBAND 0x08 |
43 | #define BAND_FM 0x10 | 45 | #define BAND_FM 0x10 |
46 | #define BAND_CBAND 0x20 | ||
44 | 47 | ||
45 | #define BAND_OF_FREQUENCY(freq_kHz) ( (freq_kHz) <= 115000 ? BAND_FM : \ | 48 | #define BAND_OF_FREQUENCY(freq_kHz) ( (freq_kHz) <= 170000 ? BAND_CBAND : \ |
49 | (freq_kHz) <= 115000 ? BAND_FM : \ | ||
46 | (freq_kHz) <= 250000 ? BAND_VHF : \ | 50 | (freq_kHz) <= 250000 ? BAND_VHF : \ |
47 | (freq_kHz) <= 863000 ? BAND_UHF : \ | 51 | (freq_kHz) <= 863000 ? BAND_UHF : \ |
48 | (freq_kHz) <= 2000000 ? BAND_LBAND : BAND_SBAND ) | 52 | (freq_kHz) <= 2000000 ? BAND_LBAND : BAND_SBAND ) |
@@ -149,4 +153,67 @@ enum dibx000_adc_states { | |||
149 | #define OUTMODE_MPEG2_FIFO 5 | 153 | #define OUTMODE_MPEG2_FIFO 5 |
150 | #define OUTMODE_ANALOG_ADC 6 | 154 | #define OUTMODE_ANALOG_ADC 6 |
151 | 155 | ||
156 | enum frontend_tune_state { | ||
157 | CT_TUNER_START = 10, | ||
158 | CT_TUNER_STEP_0, | ||
159 | CT_TUNER_STEP_1, | ||
160 | CT_TUNER_STEP_2, | ||
161 | CT_TUNER_STEP_3, | ||
162 | CT_TUNER_STEP_4, | ||
163 | CT_TUNER_STEP_5, | ||
164 | CT_TUNER_STEP_6, | ||
165 | CT_TUNER_STEP_7, | ||
166 | CT_TUNER_STOP, | ||
167 | |||
168 | CT_AGC_START = 20, | ||
169 | CT_AGC_STEP_0, | ||
170 | CT_AGC_STEP_1, | ||
171 | CT_AGC_STEP_2, | ||
172 | CT_AGC_STEP_3, | ||
173 | CT_AGC_STEP_4, | ||
174 | CT_AGC_STOP, | ||
175 | |||
176 | CT_DEMOD_START = 30, | ||
177 | CT_DEMOD_STEP_1, | ||
178 | CT_DEMOD_STEP_2, | ||
179 | CT_DEMOD_STEP_3, | ||
180 | CT_DEMOD_STEP_4, | ||
181 | CT_DEMOD_STEP_5, | ||
182 | CT_DEMOD_STEP_6, | ||
183 | CT_DEMOD_STEP_7, | ||
184 | CT_DEMOD_STEP_8, | ||
185 | CT_DEMOD_STEP_9, | ||
186 | CT_DEMOD_STEP_10, | ||
187 | CT_DEMOD_SEARCH_NEXT = 41, | ||
188 | CT_DEMOD_STEP_LOCKED, | ||
189 | CT_DEMOD_STOP, | ||
190 | |||
191 | CT_DONE = 100, | ||
192 | CT_SHUTDOWN, | ||
193 | |||
194 | }; | ||
195 | |||
196 | struct dvb_frontend_parametersContext { | ||
197 | #define CHANNEL_STATUS_PARAMETERS_UNKNOWN 0x01 | ||
198 | #define CHANNEL_STATUS_PARAMETERS_SET 0x02 | ||
199 | u8 status; | ||
200 | u32 tune_time_estimation[2]; | ||
201 | s32 tps_available; | ||
202 | u16 tps[9]; | ||
203 | }; | ||
204 | |||
205 | #define FE_STATUS_TUNE_FAILED 0 | ||
206 | #define FE_STATUS_TUNE_TIMED_OUT -1 | ||
207 | #define FE_STATUS_TUNE_TIME_TOO_SHORT -2 | ||
208 | #define FE_STATUS_TUNE_PENDING -3 | ||
209 | #define FE_STATUS_STD_SUCCESS -4 | ||
210 | #define FE_STATUS_FFT_SUCCESS -5 | ||
211 | #define FE_STATUS_DEMOD_SUCCESS -6 | ||
212 | #define FE_STATUS_LOCKED -7 | ||
213 | #define FE_STATUS_DATA_LOCKED -8 | ||
214 | |||
215 | #define FE_CALLBACK_TIME_NEVER 0xffffffff | ||
216 | |||
217 | #define ABS(x) ((x<0)?(-x):(x)) | ||
218 | |||
152 | #endif | 219 | #endif |