summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
diff options
context:
space:
mode:
authorAlex Woods <devnull@localhost>2003-12-05 21:37:45 +0000
committerAlex Woods <devnull@localhost>2003-12-05 21:37:45 +0000
commit105076a838a2fd64c5ee8552d503d8eab22474f6 (patch)
tree4f43eff98010a32db9eff08d0ebaad842abdc5f8 /linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
parent32d1eb26f468bf4d4104f8099f967687d5d1df22 (diff)
downloadmediapointer-dvb-s2-105076a838a2fd64c5ee8552d503d8eab22474f6.tar.gz
mediapointer-dvb-s2-105076a838a2fd64c5ee8552d503d8eab22474f6.tar.bz2
Correct the USB id of the DEC3000-s.
Implement a little more of the frontend.
Diffstat (limited to 'linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c')
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 1cc610c83..9acc56895 100644
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -55,6 +55,9 @@ static int debug = 0;
#define MAX_AV_PES_LENGTH 6144
+#define LOF_HI 10600000
+#define LOF_LO 9750000
+
enum ttusb_model {
TTUSB_DEC2000T,
TTUSB_DEC3000S
@@ -75,6 +78,7 @@ struct ttusb_dec {
int (*frontend_ioctl) (struct dvb_frontend *, unsigned int, void *);
u16 pid[DMX_PES_OTHER];
+ int hi_band;
/* USB bits */
struct usb_device *udev;
@@ -1074,7 +1078,7 @@ static int ttusb_dec_2000t_frontend_ioctl(struct dvb_frontend *fe, unsigned int
return -ENOSYS;
break;
- case FE_SET_FRONTEND:{
+ case FE_SET_FRONTEND: {
struct dvb_frontend_parameters *p =
(struct dvb_frontend_parameters *)arg;
u8 b[] = { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
@@ -1172,7 +1176,7 @@ static int ttusb_dec_3000s_frontend_ioctl(struct dvb_frontend *fe, unsigned int
return -ENOSYS;
break;
- case FE_SET_FRONTEND:{
+ case FE_SET_FRONTEND: {
struct dvb_frontend_parameters *p =
(struct dvb_frontend_parameters *)arg;
u8 b[] = { 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
@@ -1180,9 +1184,11 @@ static int ttusb_dec_3000s_frontend_ioctl(struct dvb_frontend *fe, unsigned int
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x00 };
+ 0x00, 0x00, 0x00, 0x00, 0x00 };
u32 freq;
u32 sym_rate;
+ u32 band;
+
dprintk("%s: FE_SET_FRONTEND\n", __FUNCTION__);
@@ -1191,10 +1197,13 @@ static int ttusb_dec_3000s_frontend_ioctl(struct dvb_frontend *fe, unsigned int
p->u.qam.symbol_rate);
dprintk(" inversion->%d\n", p->inversion);
- freq = htonl(p->frequency / 1000);
+ freq = htonl(p->frequency * 1000 + (dec->hi_band ? LOF_HI : LOF_LO));
memcpy(&b[4], &freq, sizeof(u32));
sym_rate = htonl(p->u.qam.symbol_rate);
memcpy(&b[12], &sym_rate, sizeof(u32));
+ band = htonl(dec->hi_band ? LOF_HI : LOF_LO);
+ memcpy(&b[24], &band, sizeof(u32));
+
ttusb_dec_send_command(dec, 0x71, sizeof(b), b, NULL, NULL);
break;
@@ -1217,6 +1226,25 @@ static int ttusb_dec_3000s_frontend_ioctl(struct dvb_frontend *fe, unsigned int
dprintk("%s: FE_RESET\n", __FUNCTION__);
break;
+ case FE_DISEQC_SEND_MASTER_CMD:
+ dprintk("%s: FE_DISEQC_SEND_MASTER_CMD\n", __FUNCTION__);
+ break;
+
+ case FE_DISEQC_SEND_BURST:
+ dprintk("%s: FE_DISEQC_SEND_BURST\n", __FUNCTION__);
+ break;
+
+ case FE_SET_TONE: {
+ fe_sec_tone_mode_t tone = (fe_sec_tone_mode_t)arg;
+ dprintk("%s: FE_SET_TONE\n", __FUNCTION__);
+ dec->hi_band = (SEC_TONE_ON == tone);
+ break;
+ }
+
+ case FE_SET_VOLTAGE:
+ dprintk("%s: FE_SET_VOLTAGE\n", __FUNCTION__);
+ break;
+
default:
dprintk("%s: unknown IOCTL (0x%X)\n", __FUNCTION__, cmd);
return -EINVAL;
@@ -1286,7 +1314,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
memset(dec, 0, sizeof(struct ttusb_dec));
switch (id->idProduct) {
- case 0x1007:
+ case 0x1006:
dec->model = TTUSB_DEC3000S;
dec->model_name = "DEC3000-s";
break;
@@ -1339,8 +1367,8 @@ static void ttusb_dec_disconnect(struct usb_interface *intf)
}
static struct usb_device_id ttusb_dec_table[] = {
- /*{USB_DEVICE(0x0b48, 0x1006)}, Unconfirmed */
- {USB_DEVICE(0x0b48, 0x1007)}, /* DEC3000-s */
+ {USB_DEVICE(0x0b48, 0x1006)}, /* DEC3000-s */
+ /*{USB_DEVICE(0x0b48, 0x1007)}, Unconfirmed */
{USB_DEVICE(0x0b48, 0x1008)}, /* DEC2000-t */
{}
};