diff options
-rw-r--r-- | linux/Documentation/dvb/README.dibusb | 41 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/Kconfig | 5 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb.c | 45 | ||||
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb.h | 26 |
4 files changed, 83 insertions, 34 deletions
diff --git a/linux/Documentation/dvb/README.dibusb b/linux/Documentation/dvb/README.dibusb index 0e2363727..311f1f023 100644 --- a/linux/Documentation/dvb/README.dibusb +++ b/linux/Documentation/dvb/README.dibusb @@ -1,9 +1,11 @@ +$Id: README.dibusb,v 1.6 2004/09/28 19:36:44 pmp Exp $ + Documentation for dib3000mb frontend driver and dibusb device driver The drivers should work with - Twinhan VisionPlus VisionDTV USB-Ter DVB-T Device (VP7041) - http://www.twinhan.com/visiontv-2_4.htm + http://www.twinhan.com/ - CTS Portable (Chinese Television System) http://www.2cts.tv/ctsportable/ @@ -22,6 +24,7 @@ The drivers should work with - Compro Videomate DVB-U2000 - DVB-T USB http://www.comprousa.com/products/vmu2000.htm +- Unknown USB DVB-T device with vendor ID Hyper-Paltek Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de), @@ -35,10 +38,11 @@ published by the Free Software Foundation, version 2. NEWS: + 2004-09-28 - added support for a new device (Unkown, vendor ID is Hyper-Paltek) 2004-09-20 - added support for a new device (Compro DVB-U2000), thanks to Amaury Demol for reporting - - changed usb TS transfer method (several urbs, stopping transfer - before setting a new pid) + - changed usb TS transfer method (several urbs, stopping transfer + before setting a new pid) 2004-09-13 - added support for a new device (Artec T1 USB TVBOX), thanks to Christian Motschke for reporting 2004-09-05 - released the dibusb device and dib3000mb-frontend driver @@ -50,8 +54,8 @@ NEWS: CTS Portable (Chinese Television System) 2004-07-08 - firmware-extraction-2.422-problem solved, driver is now working properly with firmware extracted from 2.422 - - #if for 2.6.4 (dvb), compile issue - - changed firmware handling, see vp7041.txt sec 1.1 + - #if for 2.6.4 (dvb), compile issue + - changed firmware handling, see vp7041.txt sec 1.1 2004-07-02 - some tuner modifications, v0.1, cleanups, first public 2004-06-28 - now using the dvb_dmx_swfilter_packets, everything runs fine now @@ -92,8 +96,13 @@ in the device). If you want to enable debug output, you have to load the driver manually. -modprobe dvb-dibusb debug=1 -modprobe dib3000mb debug=1 +first have a look, which debug level are available: + +modinfo dvb-dibusb +modinfo dib3000mb + +modprobe dvb-dibusb debug=<level> +modprobe dib3000mb debug=<level> should do the trick. @@ -109,11 +118,13 @@ as a slave device in vdr, was not working for me. Some work has to be done 2. Known problems and bugs TODO: -- add some additional URBs for USB data transfer -- due a firmware problem i2c writes during mpeg transfers destroy the stream - no i2c writes during streaming, interrupt streaming, when adding another pid +- remote control tasklet +- signal-quality and strength calculations +- debug messages restructure +- i2c address probing +- -2.1. Adding new devices +2.1. Adding support for devices It is not possible to determine the range of devices based on the DiBcom reference design. This is because the reference design of DiBcom can be sold @@ -129,7 +140,7 @@ of the device. I will add it to this list in order to make this clear to others. If you are familar with C you can also add the VID and PID of the device to -the dvb-dibusb.[hc]-files and create a patch and send it over to me or to +the dvb-dibusb.h-file and create a patch and send it over to me or to the linux-dvb mailing list, _after_ you have tried compiling and modprobing it. @@ -138,9 +149,9 @@ it. Patches, comments and suggestions are very very welcome 3. Acknowledgements - Amaury Demol (ademol@dibcom.fr) and Francois Kanounnikoff from DiBcom for - providing specs, code and help, on which the dvb-dibusb and dib3000mb are - based. + Amaury Demol (ademol@dibcom.fr) and Francois Kanounnikoff from DiBcom for + providing specs, code and help, on which the dvb-dibusb and dib3000mb are + based. Alex Woods for frequently answering question about usb and dvb stuff, a big thank you diff --git a/linux/drivers/media/dvb/dibusb/Kconfig b/linux/drivers/media/dvb/dibusb/Kconfig index a6d6329f2..112650015 100644 --- a/linux/drivers/media/dvb/dibusb/Kconfig +++ b/linux/drivers/media/dvb/dibusb/Kconfig @@ -1,5 +1,5 @@ config DVB_DIBUSB - tristate "Twinhan/KWorld/Hama/Artec USB DVB-T devices" + tristate "DiBcom/Twinhan/KWorld/Hama/Artec/Compro USB DVB-T devices" depends on DVB_CORE && USB select FW_LOADER help @@ -13,6 +13,7 @@ config DVB_DIBUSB Hama DVB-T USB-Box DiBcom reference device (non-public) Ultima Electronic/Artec T1 USB TVBOX + Compro Videomate DVB-U2000 - DVB-T USB The VP7041 seems to be identical to "CTS Portable" (Chinese Television System). @@ -20,7 +21,7 @@ config DVB_DIBUSB These devices can be understood as budget ones, they "only" deliver the MPEG data. - Currently all known copies of the DiBcom reference design have the DiBcom 3000MB + Currently all known copies of the DiBcom reference design have the DiBcom 3000-MB frontend onboard. Please enable and load this one manually in order to use this device. diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.c b/linux/drivers/media/dvb/dibusb/dvb-dibusb.c index f1e6fd418..0bf61e8d5 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.c +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.c @@ -20,9 +20,7 @@ * Amaury Demol (ademol@dibcom.fr) from DiBcom for providing specs and driver * sources, on which this driver (and the dib3000mb frontend) are based. * - * TODO - * - probing for i2c addresses, it is possible, that they have been changed - * by the vendor + * $Id: dvb-dibusb.c,v 1.8 2004/09/28 19:36:44 pmp Exp $ * * see Documentation/dvb/README.dibusb for more information */ @@ -57,7 +55,7 @@ static int debug; module_param(debug, int, 0x644); -MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts (|-able))."); +MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts,16=err (|-able))."); #else #define dprintk_new(args...) #define debug_dump(b,l) @@ -67,6 +65,7 @@ MODULE_PARM_DESC(debug, "set debugging level (1=info,2=xfer,4=alotmore,8=ts (|-a #define deb_xfer(args...) dprintk_new(0x02,args) #define deb_alot(args...) dprintk_new(0x04,args) #define deb_ts(args...) dprintk_new(0x08,args) +#define deb_err(args...) dprintk_new(0x10,args) /* Version information */ #define DRIVER_VERSION "0.0" @@ -81,12 +80,14 @@ static int dibusb_readwrite_usb(struct usb_dibusb *dib, if (wbuf == NULL || wlen == 0) return -EINVAL; -/* if (dib->disconnecting) - return -EINVAL;*/ - if ((ret = down_interruptible(&dib->usb_sem))) return ret; + if (dib->streaming && wbuf[0] == DIBUSB_REQ_I2C_WRITE) + deb_err("BUG: writing to i2c, while TS-streaming destroys the stream. What" + " did you do ? Please enable debugging and send the syslog to the author. (%x reg: %x %x)", + wbuf[0],wbuf[2],wbuf[3]); + debug_dump(wbuf,wlen); ret = usb_bulk_msg(dib->udev,COMMAND_PIPE, @@ -171,6 +172,8 @@ static int dibusb_start_xfer(struct usb_dibusb *dib) (DIB3000MB_FIFO_ACTIVATE >> 8) & 0xff, (DIB3000MB_FIFO_ACTIVATE) & 0xff }; + dib->streaming = 1; + deb_ts("start streaming\n"); return dibusb_i2c_msg(dib,DIBUSB_DEMOD_I2C_ADDR_DEFAULT,b,4,NULL,0); } @@ -182,6 +185,8 @@ static int dibusb_stop_xfer(struct usb_dibusb *dib) (DIB3000MB_FIFO_INHIBIT >> 8) & 0xff, (DIB3000MB_FIFO_INHIBIT) & 0xff }; + dib->streaming = 0; + deb_ts("stop streaming\n"); return dibusb_i2c_msg(dib,DIBUSB_DEMOD_I2C_ADDR_DEFAULT,b,4,NULL,0); } @@ -221,10 +226,10 @@ static void dibusb_urb_complete(struct urb *urb, struct pt_regs *ptregs) { struct usb_dibusb *dib = urb->context; - deb_ts("urb complete feedcount: %d, status: %d\n",dib->feedcount,urb->status); + deb_xfer("urb complete feedcount: %d, status: %d\n",dib->feedcount,urb->status); if (dib->feedcount > 0 && urb->status == 0) { - deb_ts("URB return len: %d\n",urb->actual_length); + deb_xfer("URB return len: %d\n",urb->actual_length); if (urb->actual_length % 188) deb_xfer("TS Packets: %d, %d\n", urb->actual_length/188,urb->actual_length % 188); @@ -297,6 +302,7 @@ static int dibusb_interrupt_read_loop(struct usb_dibusb *dib) /* * TODO: a tasklet should run with a delay of 1/10 second * and feed an appropriate event device ? + * NEC protocol is used for remote controlls */ static int dibusb_read_remote_control(struct usb_dibusb *dib) { @@ -305,6 +311,18 @@ static int dibusb_read_remote_control(struct usb_dibusb *dib) if ((ret = dibusb_readwrite_usb(dib,b,1,rb,5))) return ret; + + + switch (rb[0]) { + case DIBUSB_RC_NEC_KEY_PRESSED: + + break; + case DIBUSB_RC_NEC_EMPTY: + case DIBUSB_RC_NEC_KEY_REPEATED: + default: + break; + } + return 0; } @@ -539,6 +557,7 @@ static int dibusb_init(struct usb_dibusb *dib) } dib->feedcount = 0; + dib->streaming = 0; dib->dvb_is_ready = 0; if ((ret = dibusb_dvb_init(dib))) { @@ -602,19 +621,21 @@ static int dibusb_loadfirmware(struct usb_device *udev, if (ret != b[0]) { err("error while transferring firmware " "(transferred size: %d, block size: %d)", - ret,b[1]); + ret,b[0]); ret = -EINVAL; break; } i += 5 + b[0]; } + /* length in ret */ + if (ret > 0) + ret = 0; /* restart the CPU */ reset = 0; - if ((ret = dibusb_writemem(udev,DIBUSB_CPU_CSREG,&reset,1)) != 1) + if (ret || (ret = dibusb_writemem(udev,DIBUSB_CPU_CSREG,&reset,1)) != 1) err("could not restart the USB controller CPU."); kfree(p); - ret = 0; } else { ret = -ENOMEM; } diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h index 331f85d3c..167367ad6 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h @@ -7,6 +7,7 @@ * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation, version 2. * + * $Id: dvb-dibusb.h,v 1.5 2004/09/28 19:36:44 pmp Exp $ * * for more information see dvb-dibusb.c . */ @@ -19,10 +20,11 @@ /* Vendor IDs */ #define USB_VID_TWINHAN_ID 0x1822 #define USB_VID_IMC_NETWORKS_ID 0x13d3 -#define USB_VID_KWORLD_ID 0xeb1a +#define USB_VID_EMPIA_ID 0xeb1a #define USB_VID_DIBCOM_ID 0x10b8 #define USB_VID_ULTIMA_ELECTRONIC_ID 0x05d8 #define USB_VID_COMPRO_ID 0x185b +#define USB_VID_HYPER_PALTEK 0x1025 /* Product IDs before loading the firmware */ #define USB_PID_TWINHAN_VP7041_COLD_ID 0x3201 @@ -30,6 +32,7 @@ #define USB_PID_DIBCOM_MOD3000_COLD_ID 0x0bb8 #define USB_PID_ULTIMA_TVBOX_COLD_ID 0x8105 #define USB_PID_COMPRO_DVBU2000_COLD_ID 0xd000 +#define USB_PID_UNK_HYPER_PALTEK_COLD_ID 0x005e /* product ID afterwards */ #define USB_PID_TWINHAN_VP7041_WARM_ID 0x3202 @@ -37,6 +40,7 @@ #define USB_PID_DIBCOM_MOD3000_WARM_ID 0x0bb9 #define USB_PID_ULTIMA_TVBOX_WARM_ID 0x8106 #define USB_PID_COMPRO_DVBU2000_WARM_ID 0xd001 +#define USB_PID_UNK_HYPER_PALTEK_WARM_ID 0x005f /* static array of valid firmware names, the best one first */ static const char * valid_firmware_filenames[] = { @@ -50,7 +54,7 @@ struct dibusb_device { const char *name; }; -#define DIBUSB_SUPPORTED_DEVICES 5 +#define DIBUSB_SUPPORTED_DEVICES 6 /* USB Driver stuff */ static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = { @@ -66,7 +70,7 @@ static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = { }, { .cold_product_id = USB_PID_DIBCOM_MOD3000_COLD_ID, .warm_product_id = USB_PID_DIBCOM_MOD3000_WARM_ID, - .name = "DiBcom USB reference design", + .name = "DiBcom USB DVB-T reference design (MOD300)", .demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT, }, { .cold_product_id = USB_PID_ULTIMA_TVBOX_COLD_ID, @@ -78,6 +82,11 @@ static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = { .warm_product_id = USB_PID_COMPRO_DVBU2000_WARM_ID, .name = "Compro Videomate DVB-U2000 - DVB-T USB", .demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT, + }, + { .cold_product_id = USB_PID_UNK_HYPER_PALTEK_COLD_ID, + .warm_product_id = USB_PID_UNK_HYPER_PALTEK_WARM_ID, + .name = "Unkown USB DVB-T device ???? please report the name to linux-dvb or to the author", + .demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT, } }; @@ -88,14 +97,16 @@ static struct usb_device_id dibusb_table [] = { { USB_DEVICE(USB_VID_TWINHAN_ID, USB_PID_TWINHAN_VP7041_WARM_ID) }, { USB_DEVICE(USB_VID_IMC_NETWORKS_ID,USB_PID_TWINHAN_VP7041_COLD_ID) }, { USB_DEVICE(USB_VID_IMC_NETWORKS_ID,USB_PID_TWINHAN_VP7041_WARM_ID) }, - { USB_DEVICE(USB_VID_KWORLD_ID, USB_PID_KWORLD_VSTREAM_COLD_ID) }, - { USB_DEVICE(USB_VID_KWORLD_ID, USB_PID_KWORLD_VSTREAM_WARM_ID) }, + { USB_DEVICE(USB_VID_EMPIA_ID, USB_PID_KWORLD_VSTREAM_COLD_ID) }, + { USB_DEVICE(USB_VID_EMPIA_ID, USB_PID_KWORLD_VSTREAM_WARM_ID) }, { USB_DEVICE(USB_VID_DIBCOM_ID, USB_PID_DIBCOM_MOD3000_COLD_ID) }, { USB_DEVICE(USB_VID_DIBCOM_ID, USB_PID_DIBCOM_MOD3000_WARM_ID) }, { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC_ID, USB_PID_ULTIMA_TVBOX_COLD_ID) }, { USB_DEVICE(USB_VID_ULTIMA_ELECTRONIC_ID, USB_PID_ULTIMA_TVBOX_WARM_ID) }, { USB_DEVICE(USB_VID_COMPRO_ID, USB_PID_COMPRO_DVBU2000_COLD_ID) }, { USB_DEVICE(USB_VID_COMPRO_ID, USB_PID_COMPRO_DVBU2000_WARM_ID) }, + { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_COLD_ID) }, + { USB_DEVICE(USB_VID_HYPER_PALTEK, USB_PID_UNK_HYPER_PALTEK_WARM_ID) }, { } /* Terminating entry */ }; @@ -133,6 +144,7 @@ struct usb_dibusb { struct dibusb_device * dibdev; int feedcount; + int streaming; struct urb * buf_urb[DIBUSB_TS_NUM_URBS]; u8 *buffer; dma_addr_t dma_handle; @@ -175,6 +187,10 @@ struct usb_dibusb { /* prefix for reading the current RC key */ #define DIBUSB_REQ_POLL_REMOTE 0x04 +#define DIBUSB_RC_NEC_EMPTY 0x00 +#define DIBUSB_RC_NEC_KEY_PRESSED 0x01 +#define DIBUSB_RC_NEC_KEY_REPEATED 0x02 + /* 0x05 0xXX */ #define DIBUSB_REQ_SET_STREAMING_MODE 0x05 |