aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-dec
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttusb-dec')
-rw-r--r--drivers/media/dvb/ttusb-dec/Kconfig13
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c20
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusbdecfe.c53
3 files changed, 65 insertions, 21 deletions
diff --git a/drivers/media/dvb/ttusb-dec/Kconfig b/drivers/media/dvb/ttusb-dec/Kconfig
index c334526af66f..83611012ef34 100644
--- a/drivers/media/dvb/ttusb-dec/Kconfig
+++ b/drivers/media/dvb/ttusb-dec/Kconfig
@@ -8,14 +8,15 @@ config DVB_TTUSB_DEC
8 produced by Hauppauge, shipped under the brand name 'DEC2000-t' 8 produced by Hauppauge, shipped under the brand name 'DEC2000-t'
9 and 'DEC3000-s'. 9 and 'DEC3000-s'.
10 10
11 Even if these devices have a MPEG decoder built in, they transmit 11 Even if these devices have a MPEG decoder built in, they transmit
12 only compressed MPEG data over the USB bus, so you need 12 only compressed MPEG data over the USB bus, so you need
13 an external software decoder to watch TV on your computer. 13 an external software decoder to watch TV on your computer.
14 14
15 This driver needs external firmware. Please use the commands 15 This driver needs external firmware. Please use the commands
16 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2000t", 16 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2000t",
17 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2540t", 17 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec2540t",
18 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec3000s", 18 "<kerneldir>/Documentation/dvb/get_dvb_firmware dec3000s",
19 download/extract them, and then copy them to /usr/lib/hotplug/firmware. 19 download/extract them, and then copy them to /usr/lib/hotplug/firmware
20 or /lib/firmware (depending on configuration of firmware hotplug).
20 21
21 Say Y if you own such a device and want to use it. 22 Say Y if you own such a device and want to use it.
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 8abc21890129..d8966d1d25ee 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
370static int ttusb_dec_audio_pes2ts_cb(void *priv, unsigned char *data) 370static 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
381static int ttusb_dec_video_pes2ts_cb(void *priv, unsigned char *data) 381static 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);
@@ -1182,7 +1182,7 @@ static void ttusb_dec_init_tasklet(struct ttusb_dec *dec)
1182 (unsigned long)dec); 1182 (unsigned long)dec);
1183} 1183}
1184 1184
1185static int ttusb_init_rc(struct ttusb_dec *dec) 1185static int ttusb_init_rc( struct ttusb_dec *dec)
1186{ 1186{
1187 struct input_dev *input_dev; 1187 struct input_dev *input_dev;
1188 u8 b[] = { 0x00, 0x01 }; 1188 u8 b[] = { 0x00, 0x01 };
@@ -1203,13 +1203,12 @@ static int ttusb_init_rc(struct ttusb_dec *dec)
1203 input_dev->keycode = rc_keys; 1203 input_dev->keycode = rc_keys;
1204 1204
1205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++) 1205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
1206 set_bit(rc_keys[i], input_dev->keybit); 1206 set_bit(rc_keys[i], input_dev->keybit);
1207 1207
1208 input_register_device(input_dev); 1208 input_register_device(input_dev);
1209 1209
1210 if (usb_submit_urb(dec->irq_urb, GFP_KERNEL)) 1210 if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
1211 printk("%s: usb_submit_urb failed\n",__FUNCTION__); 1211 printk("%s: usb_submit_urb failed\n",__FUNCTION__);
1212
1213 /* enable irq pipe */ 1212 /* enable irq pipe */
1214 ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL); 1213 ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1215 1214
@@ -1395,6 +1394,7 @@ static int ttusb_dec_init_stb(struct ttusb_dec *dec)
1395 /* We can't trust the USB IDs that some firmwares 1394 /* We can't trust the USB IDs that some firmwares
1396 give the box */ 1395 give the box */
1397 switch (model) { 1396 switch (model) {
1397 case 0x00070001:
1398 case 0x00070008: 1398 case 0x00070008:
1399 case 0x0007000c: 1399 case 0x0007000c:
1400 ttusb_dec_set_model(dec, TTUSB_DEC3000S); 1400 ttusb_dec_set_model(dec, TTUSB_DEC3000S);
@@ -1588,7 +1588,7 @@ static int fe_send_command(struct dvb_frontend* fe, const u8 command,
1588 int param_length, const u8 params[], 1588 int param_length, const u8 params[],
1589 int *result_length, u8 cmd_result[]) 1589 int *result_length, u8 cmd_result[])
1590{ 1590{
1591 struct ttusb_dec* dec = (struct ttusb_dec*) fe->dvb->priv; 1591 struct ttusb_dec* dec = fe->dvb->priv;
1592 return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result); 1592 return ttusb_dec_send_command(dec, command, param_length, params, result_length, cmd_result);
1593} 1593}
1594 1594
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
43static int ttusbdecfe_read_status(struct dvb_frontend* fe, fe_status_t* status) 43static 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
98static 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
67static int ttusbdecfe_dvbs_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 108static 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,