Commit 65f4cda1 authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] DVB: revamp dibusb driver

- [DVB] dibusb: update documentation for the dibusb DVB driver
- [DVB] dibusb: major overhaul of the driver, including adding new vendor and product ids from clones
Signed-off-by: default avatarMichael Hunold <hunold@linuxtv.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5c9de4d6
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/
......@@ -19,6 +21,10 @@ The drivers should work with
- Ultima Electronic/Artec T1 USB TVBOX
http://www.arteceuro.com/products-tvbox.html
- 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),
......@@ -32,6 +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)
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
......@@ -85,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.
......@@ -102,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
......@@ -122,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.
......
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
......@@ -8,11 +8,13 @@ config DVB_DIBUSB
Devices supported by this driver:
Twinhan VisionPlus VisionDTV USB-Ter (VP7041)
TwinhanDTV USB-Ter (VP7041)
TwinhanDTV Magic Box (VP7041e)
KWorld V-Stream XPERT DTV - DVB-T USB
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 +22,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.
......
This diff is collapsed.
......@@ -7,6 +7,7 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*
*
*
* for more information see dvb-dibusb.c .
*/
......@@ -14,24 +15,102 @@
#ifndef __DVB_DIBUSB_H__
#define __DVB_DIBUSB_H__
#define DIBUSB_DEMOD_I2C_ADDR_DEFAULT 0x10
/* Vendor IDs */
#define USB_TWINHAN_VENDOR_ID 0x1822
#define USB_IMC_NETWORKS_VENDOR_ID 0x13d3
#define USB_KWORLD_VENDOR_ID 0xeb1a
#define USB_DIBCOM_VENDOR_ID 0x10b8
#define USB_ULTIMA_ELECTRONIC_ID 0x05d8
#define USB_VID_TWINHAN_ID 0x1822
#define USB_VID_IMC_NETWORKS_ID 0x13d3
#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_VP7041_PRODUCT_PREFW_ID 0x3201
#define USB_VSTREAM_PRODUCT_PREFW_ID 0x17de
#define USB_DIBCOM_PRODUCT_PREFW_ID 0x0bb8
#define USB_ULTIMA_ELEC_PROD_PREFW_ID 0x8105
#define USB_PID_TWINHAN_VP7041_COLD_ID 0x3201
#define USB_PID_KWORLD_VSTREAM_COLD_ID 0x17de
#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_VP7041_PRODUCT_ID 0x3202
#define USB_VSTREAM_PRODUCT_ID 0x17df
#define USB_DIBCOM_PRODUCT_ID 0x0bb9
#define USB_ULTIMA_ELEC_PROD_ID 0x8106
#define USB_PID_TWINHAN_VP7041_WARM_ID 0x3202
#define USB_PID_KWORLD_VSTREAM_WARM_ID 0x17df
#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[] = {
"dvb-dibusb-5.0.0.11.fw",
};
struct dibusb_device {
u16 cold_product_id;
u16 warm_product_id;
u8 demod_addr;
const char *name;
};
#define DIBUSB_SUPPORTED_DEVICES 6
/* USB Driver stuff */
static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = {
{ .cold_product_id = USB_PID_TWINHAN_VP7041_COLD_ID,
.warm_product_id = USB_PID_TWINHAN_VP7041_WARM_ID,
.name = "TwinhanDTV USB-Ter/Magic Box / HAMA USB DVB-T device",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_PID_KWORLD_VSTREAM_COLD_ID,
.warm_product_id = USB_PID_KWORLD_VSTREAM_WARM_ID,
.name = "KWorld V-Stream XPERT DTV - DVB-T USB",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_PID_DIBCOM_MOD3000_COLD_ID,
.warm_product_id = USB_PID_DIBCOM_MOD3000_WARM_ID,
.name = "DiBcom USB DVB-T reference design (MOD300)",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_PID_ULTIMA_TVBOX_COLD_ID,
.warm_product_id = USB_PID_ULTIMA_TVBOX_WARM_ID,
.name = "Ultima Electronic/Artec T1 USB TVBOX",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_PID_COMPRO_DVBU2000_COLD_ID,
.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,
}
};
/* USB Driver stuff */
/* table of devices that work with this driver */
static struct usb_device_id dibusb_table [] = {
{ USB_DEVICE(USB_VID_TWINHAN_ID, USB_PID_TWINHAN_VP7041_COLD_ID) },
{ 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_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 */
};
MODULE_DEVICE_TABLE (usb, dibusb_table);
/* CS register start/stop the usb controller cpu */
#define DIBUSB_CPU_CSREG 0x7F92
......@@ -53,15 +132,20 @@ struct dibusb_pid {
struct usb_dibusb *dib;
};
#define DIBUSB_TS_NUM_URBS 3
#define DIBUSB_TS_URB_BUFFER_SIZE 4096
#define DIBUSB_TS_BUFFER_SIZE (DIBUSB_TS_NUM_URBS * DIBUSB_TS_URB_BUFFER_SIZE)
#define DIBUSB_TS_DEFAULT_SIZE (188*21)
struct usb_dibusb {
/* usb */
struct usb_device * udev;
struct dibusb_device * dibdev;
int feedcount;
int streaming;
int feed_count;
struct urb *buf_urb;
struct urb * buf_urb[DIBUSB_TS_NUM_URBS];
u8 *buffer;
dma_addr_t dma_handle;
......@@ -77,52 +161,13 @@ struct usb_dibusb {
struct semaphore i2c_sem;
/* dvb */
int dvb_is_ready;
struct dvb_adapter *adapter;
struct dmxdev dmxdev;
struct dvb_demux demux;
struct dvb_net dvb_net;
};
struct dibusb_device {
u16 cold_product_id;
u16 warm_product_id;
u8 demod_addr;
const char *name;
};
/* static array of valid firmware names, the best one first */
static const char * valid_firmware_filenames[] = {
"dvb-dibusb-5.0.0.11.fw",
};
#define DIBUSB_SUPPORTED_DEVICES 4
/* USB Driver stuff */
static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = {
{ .cold_product_id = USB_VP7041_PRODUCT_PREFW_ID,
.warm_product_id = USB_VP7041_PRODUCT_ID,
.name = "Twinhan VisionDTV USB-Ter/HAMA USB DVB-T device",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_VSTREAM_PRODUCT_PREFW_ID,
.warm_product_id = USB_VSTREAM_PRODUCT_ID,
.name = "KWorld V-Stream XPERT DTV - DVB-T USB",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{ .cold_product_id = USB_DIBCOM_PRODUCT_PREFW_ID,
.warm_product_id = USB_DIBCOM_PRODUCT_ID,
.name = "DiBcom USB reference design",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
{
.cold_product_id = USB_ULTIMA_ELEC_PROD_PREFW_ID,
.warm_product_id = USB_ULTIMA_ELEC_PROD_ID,
.name = "Ultima Electronic/Artec T1 USB TVBOX",
.demod_addr = DIBUSB_DEMOD_I2C_ADDR_DEFAULT,
},
};
#define COMMAND_PIPE usb_sndbulkpipe(dib->udev, 0x01)
#define RESULT_PIPE usb_rcvbulkpipe(dib->udev, 0x81)
#define DATA_PIPE usb_rcvbulkpipe(dib->udev, 0x82)
......@@ -142,6 +187,10 @@ static struct dibusb_device dibusb_devices[DIBUSB_SUPPORTED_DEVICES] = {
/* 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
......
This diff is collapsed.
......@@ -7,6 +7,7 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, version 2.
*
*
*
* for more information see dib3000mb.c .
*/
......@@ -320,7 +321,7 @@ static u16 dib3000mb_bandwidth_8mhz[] =
#define DIB3000MB_REG_UNK_108 ( 108)
#define DIB3000MB_UNK_108 (0x0080)
/* fft ??? */
/* fft */
#define DIB3000MB_REG_UNK_121 ( 121)
#define DIB3000MB_UNK_121_2K ( 7)
#define DIB3000MB_UNK_121_DEFAULT ( 5)
......@@ -351,12 +352,11 @@ static u16 dib3000mb_bandwidth_8mhz[] =
#define DIB3000MB_REG_VIT_CODE_RATE ( 129)
/* forward error correction code rates */
#define DIB3000MB_FEC_1_2 ( 0)
#define DIB3000MB_FEC_2_3 ( 1)
#define DIB3000MB_FEC_3_4 ( 2)
#define DIB3000MB_FEC_4_5 ( 3)
#define DIB3000MB_FEC_5_6 ( 4)
#define DIB3000MB_FEC_7_8 ( 5)
#define DIB3000MB_FEC_1_2 ( 1)
#define DIB3000MB_FEC_2_3 ( 2)
#define DIB3000MB_FEC_3_4 ( 3)
#define DIB3000MB_FEC_5_6 ( 5)
#define DIB3000MB_FEC_7_8 ( 7)
/* vit select hp */
#define DIB3000MB_REG_VIT_HP ( 130)
......@@ -627,8 +627,8 @@ static u16 dib3000mb_filter_coeffs[] = {
/* packet error rate (uncorrected TS packets) (16) */
#define DIB3000MB_REG_PACKET_ERROR_RATE ( 417)
/* packet error count (16) */
#define DIB3000MB_REG_PACKET_ERROR_COUNT ( 420)
/* uncorrected packet count (16) */
#define DIB3000MB_REG_UNC ( 420)
/* viterbi locked (1) */
#define DIB3000MB_REG_VIT_LCK ( 421)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment