diff options
author | Alex Woods <linux-dvb@giblets.org> | 2006-01-09 12:25:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2006-01-09 12:25:24 -0500 |
commit | f961e71a0a96b4a992210b7dd46d837d78b162c6 (patch) | |
tree | d94b7c40c7364ae8999881ced89888fba9febfec | |
parent | e4acba3c01ca8b275dda22664191c30ee352a38e (diff) |
V4L/DVB (3154): TTUSB DEC driver patch roundup
- Collection of patches from Peter Beutner addressing:
- add symbolrates to the DVB-S frontend description
- fix capability flags in DVB-S frontend describtion
- remove some void casts
- disable zig-zag scanning as it makes no sense for DVB-T
- set sensible min_delay value
- return an error for requested filter types the driver can't handle
Signed-off-by: Peter Beutner <p.beutner@gmx.net>
Signed-off-by: Alex Woods <linux-dvb@giblets.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusb_dec.c | 15 | ||||
-rw-r--r-- | drivers/media/dvb/ttusb-dec/ttusbdecfe.c | 53 |
2 files changed, 56 insertions, 12 deletions
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 8abc21890129..36bc9838cf17 100644 --- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c | |||
@@ -369,7 +369,7 @@ static int ttusb_dec_get_stb_state (struct ttusb_dec *dec, unsigned int *mode, | |||
369 | 369 | ||
370 | static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data) | 370 | static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data) |
371 | { | 371 | { |
372 | struct ttusb_dec *dec = (struct ttusb_dec *)priv; | 372 | struct ttusb_dec *dec = priv; |
373 | 373 | ||
374 | dec->audio_filter->feed->cb.ts(data, 188, NULL, 0, | 374 | dec->audio_filter->feed->cb.ts(data, 188, NULL, 0, |
375 | &dec->audio_filter->feed->feed.ts, | 375 | &dec->audio_filter->feed->feed.ts, |
@@ -380,7 +380,7 @@ static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data) | |||
380 | 380 | ||
381 | static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data) | 381 | static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data) |
382 | { | 382 | { |
383 | struct ttusb_dec *dec = (struct ttusb_dec *)priv; | 383 | struct ttusb_dec *dec = priv; |
384 | 384 | ||
385 | dec->video_filter->feed->cb.ts(data, 188, NULL, 0, | 385 | dec->video_filter->feed->cb.ts(data, 188, NULL, 0, |
386 | &dec->video_filter->feed->feed.ts, | 386 | &dec->video_filter->feed->feed.ts, |
@@ -965,8 +965,8 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
965 | 965 | ||
966 | case DMX_TS_PES_TELETEXT: | 966 | case DMX_TS_PES_TELETEXT: |
967 | dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid; | 967 | dec->pid[DMX_PES_TELETEXT] = dvbdmxfeed->pid; |
968 | dprintk(" pes_type: DMX_TS_PES_TELETEXT\n"); | 968 | dprintk(" pes_type: DMX_TS_PES_TELETEXT(not supported)\n"); |
969 | break; | 969 | return -ENOSYS; |
970 | 970 | ||
971 | case DMX_TS_PES_PCR: | 971 | case DMX_TS_PES_PCR: |
972 | dprintk(" pes_type: DMX_TS_PES_PCR\n"); | 972 | dprintk(" pes_type: DMX_TS_PES_PCR\n"); |
@@ -975,8 +975,8 @@ static int ttusb_dec_start_ts_feed(struct dvb_demux_feed *dvbdmxfeed) | |||
975 | break; | 975 | break; |
976 | 976 | ||
977 | case DMX_TS_PES_OTHER: | 977 | case DMX_TS_PES_OTHER: |
978 | dprintk(" pes_type: DMX_TS_PES_OTHER\n"); | 978 | dprintk(" pes_type: DMX_TS_PES_OTHER(not supported)\n"); |
979 | break; | 979 | return -ENOSYS; |
980 | 980 | ||
981 | default: | 981 | default: |
982 | dprintk(" pes_type: unknown (%d)\n", dvbdmxfeed->pes_type); | 982 | dprintk(" pes_type: unknown (%d)\n", dvbdmxfeed->pes_type); |
@@ -1395,6 +1395,7 @@ static int ttusb_dec_init_stb(struct ttusb_dec *dec) | |||
1395 | /* We can't trust the USB IDs that some firmwares | 1395 | /* We can't trust the USB IDs that some firmwares |
1396 | give the box */ | 1396 | give the box */ |
1397 | switch (model) { | 1397 | switch (model) { |
1398 | case 0x00070001: | ||
1398 | case 0x00070008: | 1399 | case 0x00070008: |
1399 | case 0x0007000c: | 1400 | case 0x0007000c: |
1400 | ttusb_dec_set_model(dec, TTUSB_DEC3000S); | 1401 | ttusb_dec_set_model(dec, TTUSB_DEC3000S); |
@@ -1588,7 +1589,7 @@ static int fe_send_command(struct dvb_frontend* fe, const u8 command, | |||
1588 | int param_length, const u8 params[], | 1589 | int param_length, const u8 params[], |
1589 | int *result_length, u8 cmd_result[]) | 1590 | int *result_length, u8 cmd_result[]) |
1590 | { | 1591 | { |
1591 | struct ttusb_dec* dec = (struct ttusb_dec*) fe->dvb->priv; | 1592 | struct ttusb_dec* dec = fe->dvb->priv; |
1592 | return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result); | 1593 | return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result); |
1593 | } | 1594 | } |
1594 | 1595 | ||
diff --git a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c index 725af3af5b27..a5a46175fa09 100644 --- a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c +++ b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c | |||
@@ -42,8 +42,39 @@ struct ttusbdecfe_state { | |||
42 | 42 | ||
43 | static int ttusbdecfe_read_status(struct dvb_frontend* fe, fe_status_t* status) | 43 | static int ttusbdecfe_read_status(struct dvb_frontend* fe, fe_status_t* status) |
44 | { | 44 | { |
45 | *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | | 45 | struct ttusbdecfe_state* state = fe->demodulator_priv; |
46 | FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK; | 46 | u8 b[] = { 0x00, 0x00, 0x00, 0x00, |
47 | 0x00, 0x00, 0x00, 0x00 }; | ||
48 | u8 result[4]; | ||
49 | int len, ret; | ||
50 | |||
51 | *status=0; | ||
52 | |||
53 | ret=state->config->send_command(fe, 0x73, sizeof(b), b, &len, result); | ||
54 | if(ret) | ||
55 | return ret; | ||
56 | |||
57 | if(len != 4) { | ||
58 | printk(KERN_ERR "%s: unexpected reply\n", __FUNCTION__); | ||
59 | return -EIO; | ||
60 | } | ||
61 | |||
62 | switch(result[3]) { | ||
63 | case 1: /* not tuned yet */ | ||
64 | case 2: /* no signal/no lock*/ | ||
65 | break; | ||
66 | case 3: /* signal found and locked*/ | ||
67 | *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | | ||
68 | FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK; | ||
69 | break; | ||
70 | case 4: | ||
71 | *status = FE_TIMEDOUT; | ||
72 | break; | ||
73 | default: | ||
74 | pr_info("%s: returned unknown value: %d\n", | ||
75 | __FUNCTION__, result[3]); | ||
76 | return -EIO; | ||
77 | } | ||
47 | 78 | ||
48 | return 0; | 79 | return 0; |
49 | } | 80 | } |
@@ -64,6 +95,16 @@ static int ttusbdecfe_dvbt_set_frontend(struct dvb_frontend* fe, struct dvb_fron | |||
64 | return 0; | 95 | return 0; |
65 | } | 96 | } |
66 | 97 | ||
98 | static int ttusbdecfe_dvbt_get_tune_settings(struct dvb_frontend* fe, | ||
99 | struct dvb_frontend_tune_settings* fesettings) | ||
100 | { | ||
101 | fesettings->min_delay_ms = 1500; | ||
102 | /* Drift compensation makes no sense for DVB-T */ | ||
103 | fesettings->step_size = 0; | ||
104 | fesettings->max_drift = 0; | ||
105 | return 0; | ||
106 | } | ||
107 | |||
67 | static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 108 | static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
68 | { | 109 | { |
69 | struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; | 110 | struct ttusbdecfe_state* state = (struct ttusbdecfe_state*) fe->demodulator_priv; |
@@ -212,6 +253,8 @@ static struct dvb_frontend_ops ttusbdecfe_dvbt_ops = { | |||
212 | 253 | ||
213 | .set_frontend = ttusbdecfe_dvbt_set_frontend, | 254 | .set_frontend = ttusbdecfe_dvbt_set_frontend, |
214 | 255 | ||
256 | .get_tune_settings = ttusbdecfe_dvbt_get_tune_settings, | ||
257 | |||
215 | .read_status = ttusbdecfe_read_status, | 258 | .read_status = ttusbdecfe_read_status, |
216 | }; | 259 | }; |
217 | 260 | ||
@@ -223,11 +266,11 @@ static struct dvb_frontend_ops ttusbdecfe_dvbs_ops = { | |||
223 | .frequency_min = 950000, | 266 | .frequency_min = 950000, |
224 | .frequency_max = 2150000, | 267 | .frequency_max = 2150000, |
225 | .frequency_stepsize = 125, | 268 | .frequency_stepsize = 125, |
269 | .symbol_rate_min = 1000000, /* guessed */ | ||
270 | .symbol_rate_max = 45000000, /* guessed */ | ||
226 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | 271 | .caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | |
227 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | 272 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | |
228 | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO | | 273 | FE_CAN_QPSK |
229 | FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO | | ||
230 | FE_CAN_HIERARCHY_AUTO, | ||
231 | }, | 274 | }, |
232 | 275 | ||
233 | .release = ttusbdecfe_release, | 276 | .release = ttusbdecfe_release, |