diff options
Diffstat (limited to 'linux/drivers/media/dvb/dibusb/dvb-dibusb.h')
-rw-r--r-- | linux/drivers/media/dvb/dibusb/dvb-dibusb.h | 145 |
1 files changed, 89 insertions, 56 deletions
diff --git a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h index a04e8d8cf..331f85d3c 100644 --- a/linux/drivers/media/dvb/dibusb/dvb-dibusb.h +++ b/linux/drivers/media/dvb/dibusb/dvb-dibusb.h @@ -14,24 +14,92 @@ #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_KWORLD_ID 0xeb1a +#define USB_VID_DIBCOM_ID 0x10b8 +#define USB_VID_ULTIMA_ELECTRONIC_ID 0x05d8 +#define USB_VID_COMPRO_ID 0x185b /* 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 /* 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 + +/* 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 5 + +/* 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 = "Twinhan VisionDTV USB-Ter/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 reference design", + .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, + } +}; + +/* 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_KWORLD_ID, USB_PID_KWORLD_VSTREAM_COLD_ID) }, + { USB_DEVICE(USB_VID_KWORLD_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) }, + { } /* Terminating entry */ +}; + +MODULE_DEVICE_TABLE (usb, dibusb_table); /* CS register start/stop the usb controller cpu */ #define DIBUSB_CPU_CSREG 0x7F92 @@ -53,15 +121,19 @@ 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 streaming; - int feed_count; - struct urb *buf_urb; + int feedcount; + struct urb * buf_urb[DIBUSB_TS_NUM_URBS]; u8 *buffer; dma_addr_t dma_handle; @@ -77,52 +149,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) |