diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:24:11 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:24:11 +0000 |
commit | 7e949443baebedef67aaa31d742fa994e218a39b (patch) | |
tree | 46d594c6dcb3327a659aec8e75d68c0c192c803b | |
parent | abec1400ec7e1b351d714078a12d365f2929f7ab (diff) | |
download | mediapointer-dvb-s2-7e949443baebedef67aaa31d742fa994e218a39b.tar.gz mediapointer-dvb-s2-7e949443baebedef67aaa31d742fa994e218a39b.tar.bz2 |
- moved the mirrored pid_filter_table back to dvb-dibusb
- first almost working version for HanfTek UMT-010
- found out, that Yakumo/HAMA/Typhoon are predecessors of the HanfTek
- minor cleanups
-rw-r--r-- | linux/drivers/media/dvb/dibusb/Makefile | 3 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c | 47 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c | 46 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c | 64 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c | 80 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c | 69 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb.h | 41 |
7 files changed, 263 insertions, 87 deletions
diff --git a/linux/drivers/media/dvb/dibusb/Makefile b/linux/drivers/media/dvb/dibusb/Makefile index aeb896fe2..a0319f8cb 100644 --- a/linux/drivers/media/dvb/dibusb/Makefile +++ b/linux/drivers/media/dvb/dibusb/Makefile @@ -3,7 +3,8 @@ dvb-dibusb-objs = dvb-dibusb-core.o \ dvb-dibusb-fe-i2c.o \ dvb-dibusb-firmware.o \ dvb-dibusb-remote.o \ - dvb-dibusb-usb.o + dvb-dibusb-usb.o \ + dvb-dibusb-pid.o obj-$(CONFIG_DVB_DIBUSB) += dvb-dibusb.o diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c index e8c4acba3..2ac4599aa 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-core.c @@ -104,7 +104,12 @@ static struct usb_device_id dib_table [] = { /* 00 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_COLD)}, /* 01 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_AVERMEDIA_DVBT_USB_WARM)}, /* 02 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_COLD) }, + +/* the following device is actually not supported, but when loading the + * correct firmware (ie. its usb ids will change) everything works fine then + */ /* 03 */ { USB_DEVICE(USB_VID_AVERMEDIA, USB_PID_YAKUMO_DTT200U_WARM) }, + /* 04 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_COLD) }, /* 05 */ { USB_DEVICE(USB_VID_COMPRO, USB_PID_COMPRO_DVBU2000_WARM) }, /* 06 */ { USB_DEVICE(USB_VID_COMPRO_UNK, USB_PID_COMPRO_DVBU2000_UNK_COLD) }, @@ -172,12 +177,15 @@ struct dibusb_tuner dibusb_tuner[] = { static struct dibusb_demod dibusb_demod[] = { { DIBUSB_DIB3000MB, + 16, { 0x8, 0 }, }, - { DIBUSB_DIB3000MC, + { DIBUSB_DIB3000MC, + 32, { 0x9, 0xa, 0xb, 0xc }, }, { DIBUSB_MT352, + 254, { 0xf, 0 }, }, }; @@ -210,9 +218,10 @@ static struct dibusb_device_class dibusb_device_classes[] = { { UMT2_0, &dibusb_usb_ctrl[2], "dvb-dibusb-umt-1.fw", 0x01, 0x02, - 15, 4096, + 15, 188*21, DIBUSB_RC_NO, &dibusb_demod[DIBUSB_MT352], +// &dibusb_tuner[DIBUSB_TUNER_COFDM_PANASONIC_ENV77H11D5], &dibusb_tuner[DIBUSB_TUNER_CABLE_LG_TDTP_E102P], }, }; @@ -273,10 +282,10 @@ static struct dibusb_usb_device dibusb_devices[] = { { &dib_table[27], NULL }, { NULL }, }, - { "Yakumo/Typhoon DVB-T mobile USB2.0", - &dibusb_device_classes[DIBUSB2_0], + { "AVermedia/Yakumo/Hama/Typhoon DVB-T USB2.0", + &dibusb_device_classes[UMT2_0], { &dib_table[2], NULL }, - { &dib_table[3], NULL }, + { NULL }, }, { "Hanftek UMT-010 DVB-T USB2.0", &dibusb_device_classes[UMT2_0], @@ -308,6 +317,7 @@ static int dibusb_exit(struct usb_dibusb *dib) dibusb_remote_exit(dib); dibusb_fe_exit(dib); dibusb_i2c_exit(dib); + dibusb_pid_list_exit(dib); dibusb_dvb_exit(dib); dibusb_urb_exit(dib); deb_info("init_state should be zero now: %x\n",dib->init_state); @@ -324,12 +334,9 @@ static int dibusb_init(struct usb_dibusb *dib) dib->init_state = DIBUSB_STATE_INIT; - dibusb_hw_wakeup(dib); - dibusb_set_streaming_mode(dib,0); - dibusb_streaming(dib,0); - if ((ret = dibusb_urb_init(dib)) || (ret = dibusb_dvb_init(dib)) || + (ret = dibusb_pid_list_init(dib)) || (ret = dibusb_i2c_init(dib))) { dibusb_exit(dib); return ret; @@ -400,26 +407,6 @@ static int dibusb_probe(struct usb_interface *intf, } memset(dib,0,sizeof(struct usb_dibusb)); - dib->pid_parse = 1; - switch (udev->speed) { - case USB_SPEED_LOW: - err("cannot handle USB speed because it is to sLOW."); - break; - case USB_SPEED_FULL: - info("running at FULL speed, will use pid parsing."); - break; - case USB_SPEED_HIGH: - if (!pid_parse) { - dib->pid_parse = 0; - info("running at HIGH speed, will deliver the complete TS."); - } else - info("running at HIGH speed, will use pid_parsing anyway."); - break; - case USB_SPEED_UNKNOWN: /* fall through */ - default: - err("cannot handle USB speed because it is unkown."); - break; - } dib->udev = udev; dib->dibdev = dibdev; @@ -452,7 +439,7 @@ static void dibusb_disconnect(struct usb_interface *intf) /* usb specific object needed to register this driver with the usb subsystem */ struct usb_driver dibusb_driver = { .owner = THIS_MODULE, - .name = "dvb_dibusb", + .name = DRIVER_DESC, .probe = dibusb_probe, .disconnect = dibusb_disconnect, .id_table = dib_table, diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c index 78adf48f4..d7dd6e747 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-dvb.c @@ -14,6 +14,8 @@ #include <linux/usb.h> #include <linux/version.h> +static u32 urb_compl_count; + /* * MPEG2 TS DVB stuff */ @@ -25,6 +27,10 @@ void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) deb_ts("urb complete feedcount: %d, status: %d, length: %d\n",dib->feedcount,urb->status, urb->actual_length); + urb_compl_count++; + if (urb_compl_count % 500 == 0) + deb_info("%d urbs completed so far.\n",urb_compl_count); + switch (urb->status) { case 0: /* success */ case -ETIMEDOUT: /* NAK */ @@ -58,12 +64,18 @@ void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) deb_ts("urb resubmitted, (%d)\n",ret); } -static int dibusb_ctrl_feed(struct usb_dibusb *dib, int pid, int onoff) +static int dibusb_ctrl_feed(struct dvb_demux_feed *dvbdmxfeed, int onoff) { - int newfeedcount = dib->feedcount + (onoff ? 1 : -1); + struct usb_dibusb *dib = dvbdmxfeed->demux->priv; + int newfeedcount; + + if (dib == NULL) + return -ENODEV; + + newfeedcount = dib->feedcount + (onoff ? 1 : -1); + /* - * stop feed before setting a new pid and firmware_bug - * or if there will be no pid anymore + * stop feed before setting a new pid if there will be no pid anymore */ // if ((dib->dibdev->parm->firmware_bug && dib->feedcount) || if (newfeedcount == 0) { @@ -78,14 +90,11 @@ static int dibusb_ctrl_feed(struct usb_dibusb *dib, int pid, int onoff) dib->feedcount = newfeedcount; - if (dib->pid_parse) { - if (dib->xfer_ops.pid_ctrl != NULL) { - if (dib->xfer_ops.pid_ctrl(dib->fe,pid,onoff) < 0) { - err("no free pid in list."); - return -ENODEV; - } - } - } + /* get a free pid from the list and activate it on the device + * specific pid_filter + */ + if (dib->pid_parse) + dibusb_ctrl_pid(dib,dvbdmxfeed,onoff); /* * start the feed, either if there is the firmware bug or @@ -117,27 +126,22 @@ static int dibusb_ctrl_feed(struct usb_dibusb *dib, int pid, int onoff) static int dibusb_start_feed(struct dvb_demux_feed *dvbdmxfeed) { - struct usb_dibusb *dib = dvbdmxfeed->demux->priv; deb_ts("start pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid,dvbdmxfeed->type); - dvbdmxfeed->priv = dib; - return dibusb_ctrl_feed(dib,dvbdmxfeed->pid,1); + return dibusb_ctrl_feed(dvbdmxfeed,1); } static int dibusb_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { - struct usb_dibusb *dib = (struct usb_dibusb *) dvbdmxfeed->priv; - if (dib == NULL) { - err("dib in dmxfeed->priv was NULL"); - return -EINVAL; - } deb_ts("stop pid: 0x%04x, feedtype: %d\n", dvbdmxfeed->pid, dvbdmxfeed->type); - return dibusb_ctrl_feed(dib,dvbdmxfeed->pid,0); + return dibusb_ctrl_feed(dvbdmxfeed,0); } int dibusb_dvb_init(struct usb_dibusb *dib) { int ret; + urb_compl_count = 0; + #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,4) if ((ret = dvb_register_adapter(&dib->adapter, DRIVER_DESC)) < 0) { #else diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c index 4afd72410..925c8599f 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-fe-i2c.c @@ -125,6 +125,27 @@ static int dibusb_tuner_quirk(struct usb_dibusb *dib) return 0; } +/* there is a ugly pid_filter in the firmware of the umt devices, it is accessible + * by i2c address 0x8. Don't know how to deactivate it and how many rows it has. + */ +static int dibusb_umt_pid_control(struct dvb_frontend *fe, int index, int pid, int onoff) +{ + struct usb_dibusb *dib = fe->dvb->priv; + u8 b[3]; + b[0] = index; + if (onoff) { + b[1] = (pid >> 8) & 0xff; + b[2] = pid & 0xff; + } else { + b[1] = 0; + b[2] = 0; + } + dibusb_i2c_msg(dib, 0x8, b, 3, NULL,0); + dibusb_set_streaming_mode(dib,0); + dibusb_set_streaming_mode(dib,1); + return 0; +} + int dibusb_fe_init(struct usb_dibusb* dib) { struct dib3000_config demod_cfg; @@ -149,6 +170,7 @@ int dibusb_fe_init(struct usb_dibusb* dib) case DIBUSB_MT352: mt352_hanftek_umt_010_config.demod_address = dib->dibdev->dev_cl->demod->i2c_addrs[i]; dib->fe = mt352_attach(&mt352_hanftek_umt_010_config, &dib->i2c_adap); + dib->xfer_ops.pid_ctrl = dibusb_umt_pid_control; break; } if (dib->fe != NULL) { @@ -156,6 +178,13 @@ int dibusb_fe_init(struct usb_dibusb* dib) break; } } + if (dib->fe->ops->sleep != NULL) + dib->fe_sleep = dib->fe->ops->sleep; + dib->fe->ops->sleep = dibusb_hw_sleep; + + if (dib->fe->ops->init != NULL ) + dib->fe_init = dib->fe->ops->init; + dib->fe->ops->init = dibusb_hw_wakeup; /* setting the default tuner */ dib->tuner = dib->dibdev->dev_cl->tuner; @@ -420,8 +449,6 @@ static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[ #define TUNER_MUL 62500 - deb_info("tdtp debug %d MHz, BW: %d\n",fep->frequency,fep->u.ofdm.bandwidth); - div = (fep->frequency + 36125000 + TUNER_MUL / 2) / TUNER_MUL; if (fep->frequency < 174500000) @@ -441,26 +468,41 @@ static int lg_tdtp_e102p_tua6034(struct dvb_frontend_parameters* fep, u8 pllbuf[ pllbuf[2] = 0xce; pllbuf[3] = (p4 << 4) | p3210; - deb_info("pllbuf[4] = %x\n",pllbuf[4]); - return 0; } static int lg_tdtp_e102p_mt352_demod_init(struct dvb_frontend *fe) { - static u8 mt352_clock_config [] = { 0x89, 0xb0, 0x2d }; - static u8 mt352_reset [] = { 0x50, 0x80 }; - static u8 mt352_adc_ctl_1_cfg [] = { 0x8E, 0x40 }; - static u8 mt352_agc_cfg [] = { 0x67, 0x14, 0x22 }; - static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; + static u8 mt352_clock_config[] = { 0x89, 0xb0, 0x2d }; + static u8 mt352_reset[] = { 0x50, 0x80 }; + static u8 mt352_mclk_ratio[] = { 0x8b, 0x00 }; + static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 }; + static u8 mt352_agc_cfg[] = { 0x67, 0x14, 0x22 }; + static u8 mt352_sec_agc_cfg[] = { 0x69, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x40, 0x40 }; + + static u8 mt352_unk [] = { 0xb5, 0x7a }; + + static u8 mt352_acq_ctl[] = { 0x53, 0x5f }; + static u8 mt352_input_freq_1[] = { 0x56, 0xf1, 0x05 }; + +// static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 }; mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config)); udelay(2000); mt352_write(fe, mt352_reset, sizeof(mt352_reset)); + mt352_write(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio)); + mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg)); - mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg)); - mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); + + mt352_write(fe, mt352_sec_agc_cfg, sizeof(mt352_sec_agc_cfg)); + + mt352_write(fe, mt352_unk, sizeof(mt352_unk)); + + mt352_write(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl)); + mt352_write(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1)); + +// mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg)); return 0; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c new file mode 100644 index 000000000..91a39541d --- /dev/null +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-pid.c @@ -0,0 +1,80 @@ +/* + * dvb-dibusb-pid.c is part of the driver for mobile USB Budget DVB-T devices + * based on reference design made by DiBcom (http://www.dibcom.fr/) + * + * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@desy.de) + * + * see dvb-dibusb-core.c for more copyright details. + * + * This file contains functions for initializing and handling the internal + * pid-list. This pid-list mirrors the information currently stored in the + * devices pid-list. + */ +#include "dvb-dibusb.h" + +int dibusb_pid_list_init(struct usb_dibusb *dib) +{ + int i; + dib->pid_list = kmalloc(sizeof(struct dibusb_pid) * dib->dibdev->dev_cl->demod->pid_filter_count,GFP_KERNEL); + if (dib->pid_list == NULL) + return -ENOMEM; + + deb_xfer("initializing %d pids for the pid_list.\n",dib->dibdev->dev_cl->demod->pid_filter_count); + + dib->pid_list_lock = SPIN_LOCK_UNLOCKED; + memset(dib->pid_list,0,dib->dibdev->dev_cl->demod->pid_filter_count*(sizeof(struct dibusb_pid))); + for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) { + dib->pid_list[i].index = i; + dib->pid_list[i].pid = 0; + dib->pid_list[i].active = 0; + } + + dib->init_state |= DIBUSB_STATE_PIDLIST; + return 0; +} + +void dibusb_pid_list_exit(struct usb_dibusb *dib) +{ + if (dib->init_state & DIBUSB_STATE_PIDLIST) + kfree(dib->pid_list); + dib->init_state &= ~DIBUSB_STATE_PIDLIST; +} + +/* fetch a pid from pid_list and set it on or off */ +int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff) +{ + int i,ret = -1; + unsigned long flags; + u16 pid = dvbdmxfeed->pid; + + if (onoff) { + spin_lock_irqsave(&dib->pid_list_lock,flags); + for (i=0; i < dib->dibdev->dev_cl->demod->pid_filter_count; i++) + if (!dib->pid_list[i].active) { + dib->pid_list[i].pid = pid; + dib->pid_list[i].active = 1; + ret = i; + break; + } + dvbdmxfeed->priv = &dib->pid_list[ret]; + spin_unlock_irqrestore(&dib->pid_list_lock,flags); + + if (dib->xfer_ops.pid_ctrl != NULL) + dib->xfer_ops.pid_ctrl(dib->fe,dib->pid_list[ret].index,dib->pid_list[ret].pid,1); + } else { + struct dibusb_pid *dpid = dvbdmxfeed->priv; + + if (dib->xfer_ops.pid_ctrl != NULL) + dib->xfer_ops.pid_ctrl(dib->fe,dpid->index,0,0); + + dpid->pid = 0; + dpid->active = 0; + ret = dpid->index; + } + + /* a free pid from the list */ + deb_info("setting pid: %5d %04x at index %d '%s'\n",pid,pid,ret,onoff ? "on" : "off"); + + return ret; +} + diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c index 36aa76da1..031f4bd93 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb-usb.c @@ -80,15 +80,6 @@ int dibusb_interrupt_read_loop(struct usb_dibusb *dib) return dibusb_write_usb(dib,b,1); } -/* - * ioctl for power control - */ -int dibusb_hw_sleep(struct usb_dibusb *dib) -{ - u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP }; - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); -} - #endif static int dibusb_write_usb(struct usb_dibusb *dib, u8 *buf, u16 len) { @@ -112,10 +103,33 @@ static int dibusb_ioctl_cmd(struct usb_dibusb *dib, u8 cmd, u8 *param, int plen) return dibusb_write_usb(dib,b,34); //2+size); } -int dibusb_hw_wakeup(struct usb_dibusb *dib) +/* + * ioctl for power control + */ +int dibusb_hw_wakeup(struct dvb_frontend *fe) { + struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv; u8 b[1] = { DIBUSB_IOCTL_POWER_WAKEUP }; - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); + deb_info("dibusb-device is getting up.\n"); + dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); + + if (dib->fe_init) + return dib->fe_init(fe); + + return 0; +} + +int dibusb_hw_sleep(struct dvb_frontend *fe) +{ + struct usb_dibusb *dib = (struct usb_dibusb *) fe->dvb->priv; + u8 b[1] = { DIBUSB_IOCTL_POWER_SLEEP }; + deb_info("dibusb-device is going to bed.\n"); + dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_POWER_MODE, b,1); + + if (dib->fe_sleep) + return dib->fe_sleep(fe); + + return 0; } int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode) @@ -126,10 +140,20 @@ int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode) int dibusb_streaming(struct usb_dibusb *dib,int onoff) { - if (onoff) - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0); - else - return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_DISABLE_STREAM,NULL,0); + switch (dib->dibdev->dev_cl->id) { + case DIBUSB2_0: + if (onoff) + return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_ENABLE_STREAM,NULL,0); + else + return dibusb_ioctl_cmd(dib,DIBUSB_IOCTL_CMD_DISABLE_STREAM,NULL,0); + break; + case UMT2_0: + return dibusb_set_streaming_mode(dib,onoff); + break; + default: + break; + } + return 0; } int dibusb_urb_init(struct usb_dibusb *dib) @@ -185,6 +209,21 @@ int dibusb_urb_init(struct usb_dibusb *dib) } dib->init_state |= DIBUSB_STATE_URB_SUBMIT; } + + + dib->pid_parse = 1; + switch (dib->dibdev->dev_cl->id) { + case DIBUSB2_0: + if (dib->udev->speed == USB_SPEED_HIGH && !pid_parse) { + dib->pid_parse = 0; + info("running at HIGH speed, will deliver the complete TS."); + } else + info("will use pid_parsing."); + break; + default: + break; + } + return 0; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h index 201e20ebd..bfb05989f 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h @@ -74,7 +74,6 @@ typedef enum { DIBUSB1_1_AN2235, DIBUSB2_0, UMT2_0, - DIBUSB1_1_AN2235_WITH } dibusb_class_t; typedef enum { @@ -106,6 +105,7 @@ extern struct dibusb_tuner dibusb_tuner[]; struct dibusb_demod { dibusb_demodulator_t id; + int pid_filter_count; /* counter of the internal pid_filter */ u8 i2c_addrs[DIBUSB_POSSIBLE_I2C_ADDR_NUM]; /* list of possible i2c addresses of the demod */ }; @@ -121,7 +121,7 @@ struct dibusb_device_class { int urb_count; /* number of data URBs to be submitted */ int urb_buffer_size; /* the size of the buffer for each URB */ - + dibusb_remote_t remote_type; /* does this device have a ir-receiver */ struct dibusb_demod *demod; /* which demodulator is mount */ @@ -136,7 +136,14 @@ struct dibusb_usb_device { struct usb_device_id *cold_ids[DIBUSB_ID_MAX_NUM]; /* list of USB ids when this device is at pre firmware state */ struct usb_device_id *warm_ids[DIBUSB_ID_MAX_NUM]; /* list of USB ids when this device is at post firmware state */ }; - + +/* a PID for the pid_filter list, when in use */ +struct dibusb_pid +{ + int index; + u16 pid; + int active; +}; struct usb_dibusb { /* usb */ @@ -151,11 +158,12 @@ struct usb_dibusb { #define DIBUSB_STATE_DVB 0x008 #define DIBUSB_STATE_I2C 0x010 #define DIBUSB_STATE_REMOTE 0x020 +#define DIBUSB_STATE_PIDLIST 0x040 int init_state; int feedcount; int pid_parse; - struct dib3000_xfer_ops xfer_ops; + struct dib_fe_xfer_ops xfer_ops; struct dibusb_tuner *tuner; @@ -170,6 +178,10 @@ struct usb_dibusb { struct semaphore usb_sem; struct semaphore i2c_sem; + /* pid filtering */ + spinlock_t pid_list_lock; + struct dibusb_pid *pid_list; + /* dvb */ struct dvb_adapter *adapter; struct dmxdev dmxdev; @@ -177,6 +189,9 @@ struct usb_dibusb { struct dvb_net dvb_net; struct dvb_frontend* fe; + int (*fe_sleep) (struct dvb_frontend *); + int (*fe_init) (struct dvb_frontend *); + /* remote control */ struct input_dev rc_input_dev; struct work_struct rc_query_work; @@ -193,6 +208,8 @@ int dibusb_remote_exit(struct usb_dibusb *dib); int dibusb_remote_init(struct usb_dibusb *dib); /* dvb-dibusb-fe-i2c.c */ +int dibusb_i2c_msg(struct usb_dibusb *dib, u8 addr, + u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen); int dibusb_fe_init(struct usb_dibusb* dib); int dibusb_fe_exit(struct usb_dibusb *dib); int dibusb_i2c_init(struct usb_dibusb *dib); @@ -207,12 +224,18 @@ int dibusb_dvb_exit(struct usb_dibusb *dib); int dibusb_readwrite_usb(struct usb_dibusb *dib, u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen); -int dibusb_hw_wakeup(struct usb_dibusb *dib); -int dibusb_set_streaming_mode(struct usb_dibusb *dib,u8 mode); -int dibusb_streaming(struct usb_dibusb *dib,int onoff); +int dibusb_hw_wakeup(struct dvb_frontend *); +int dibusb_hw_sleep(struct dvb_frontend *); +int dibusb_set_streaming_mode(struct usb_dibusb *,u8); +int dibusb_streaming(struct usb_dibusb *,int); + +int dibusb_urb_init(struct usb_dibusb *); +int dibusb_urb_exit(struct usb_dibusb *); -int dibusb_urb_init(struct usb_dibusb *dib); -int dibusb_urb_exit(struct usb_dibusb *dib); +/* dvb-dibusb-pid.c */ +int dibusb_pid_list_init(struct usb_dibusb *dib); +void dibusb_pid_list_exit(struct usb_dibusb *dib); +int dibusb_ctrl_pid(struct usb_dibusb *dib, struct dvb_demux_feed *dvbdmxfeed , int onoff); /* i2c and transfer stuff */ #define DIBUSB_I2C_TIMEOUT HZ*5 |