Commit 7cd893fd authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] DVB: new driver for mobile USB Budget DVB-T devices

- [DVB] new driver for mobile USB Budget DVB-T devices, thanks to Patrick
  Boettcher
Signed-off-by: default avatarMichael Hunold <hunold@linuxtv.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 3516350a
......@@ -2,5 +2,4 @@
# Makefile for the kernel multimedia device drivers.
#
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/
obj-y := dvb-core/ frontends/ ttpci/ ttusb-dec/ ttusb-budget/ b2c2/ bt8xx/ dibusb/
config DVB_DIBUSB
tristate "Twinhan/KWorld/Hama/Artec USB DVB-T devices"
depends on DVB_CORE && USB
select FW_LOADER
help
Support for USB 1.1 DVB-T devices based on a reference design made by
DiBcom (http://www.dibcom.fr).
Devices supported by this driver:
Twinhan VisionPlus VisionDTV USB-Ter (VP7041)
KWorld V-Stream XPERT DTV - DVB-T USB
Hama DVB-T USB-Box
DiBcom reference device (non-public)
Ultima Electronic/Artec T1 USB TVBOX
The VP7041 seems to be identical to "CTS Portable" (Chinese
Television System).
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
frontend onboard. Please enable and load this one manually in order to use this
device.
A firmware is needed to use the device. See Documentation/dvb/README.dibusb
details.
Say Y if you own such a device and want to use it. You should build it as
a module.
obj-$(CONFIG_DVB_DIBUSB) += dvb-dibusb.o
EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/
This diff is collapsed.
/*
* dvb-dibusb.h
*
* Copyright (C) 2004 Patrick Boettcher (patrick.boettcher@desy.de)
*
* This program is free software; you can redistribute it and/or
* 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 .
*/
#ifndef __DVB_DIBUSB_H__
#define __DVB_DIBUSB_H__
/* 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
/* 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
/* 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
/* CS register start/stop the usb controller cpu */
#define DIBUSB_CPU_CSREG 0x7F92
// 0x10 is the I2C address of the first demodulator on the board
#define DIBUSB_DEMOD_I2C_ADDR_DEFAULT 0x10
#define DIBUSB_I2C_TIMEOUT HZ*5
#define DIBUSB_MAX_PIDS 16
#define DIB3000MB_REG_FIRST_PID ( 153)
struct usb_dibusb;
struct dibusb_pid {
u16 reg;
u16 pid;
int active;
struct usb_dibusb *dib;
};
struct usb_dibusb {
/* usb */
struct usb_device * udev;
struct dibusb_device * dibdev;
int streaming;
int feed_count;
struct urb *buf_urb;
u8 *buffer;
dma_addr_t dma_handle;
spinlock_t pid_list_lock;
struct dibusb_pid pid_list[DIBUSB_MAX_PIDS];
/* I2C */
struct i2c_adapter i2c_adap;
struct i2c_client i2c_client;
/* locking */
struct semaphore usb_sem;
struct semaphore i2c_sem;
/* dvb */
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)
/*
* last endpoint 0x83 only used for chaining the buffers
* of the endpoints in the cypress
*/
#define CHAIN_PIPE_DO_NOT_USE usb_rcvbulkpipe(dib->udev, 0x83)
/* types of first byte of each buffer */
#define DIBUSB_REQ_START_READ 0x00
#define DIBUSB_REQ_START_DEMOD 0x01
#define DIBUSB_REQ_I2C_READ 0x02
#define DIBUSB_REQ_I2C_WRITE 0x03
/* prefix for reading the current RC key */
#define DIBUSB_REQ_POLL_REMOTE 0x04
/* 0x05 0xXX */
#define DIBUSB_REQ_SET_STREAMING_MODE 0x05
/* interrupt the internal read loop, when blocking */
#define DIBUSB_REQ_INTR_READ 0x06
/* IO control
* 0x07 <cmd 1 byte> <param 32 bytes>
*/
#define DIBUSB_REQ_SET_IOCTL 0x07
/* IOCTL commands */
/* change the power mode in firmware */
#define DIBUSB_IOCTL_CMD_POWER_MODE 0x00
#define DIBUSB_IOCTL_POWER_SLEEP 0x00
#define DIBUSB_IOCTL_POWER_WAKEUP 0x01
/*
* values from the demodulator which are needed in
* the usb driver as well
*/
#define DIB3000MB_REG_FIFO ( 145)
#define DIB3000MB_FIFO_INHIBIT ( 1)
#define DIB3000MB_FIFO_ACTIVATE ( 0)
#define DIB3000MB_ACTIVATE_FILTERING (0x2000)
#endif
......@@ -63,13 +63,9 @@ config DVB_SP887X
help
A DVB-T tuner module. Say Y when you want to support this frontend.
This driver needs a copy of the Avermedia firmware. The version tested
is part of the Avermedia DVB-T 1.3.26.3 Application. If the software is
installed in Windoze the file will be in the /Program Files/AVerTV DVB-T/
directory and is called sc_main.mc. Alternatively it can "extracted" from
the install cab files.
Copy this file to '/usr/lib/hotplug/firmware/dvb-fe-sp887x.fw'.
This driver needs external firmware. Please use the command
"<kerneldir>/Documentation/dvb/get_dvb_firmware sp887x" to
download/extract it, and then copy it to /usr/lib/hotplug/firmware.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
......@@ -81,9 +77,9 @@ config DVB_ALPS_TDLB7
help
A DVB-T tuner module. Say Y when you want to support this frontend.
This driver needs a copy of the firmware file from the Haupauge
Windoze driver. Copy 'Sc_main.mc' to
'/usr/lib/hotplug/firmware/dvb-fe-tdlb7.fw'.
This driver needs external firmware. Please use the command
"<kerneldir>/Documentation/dvb/get_dvb_firmware alps_tdlb7" to
download/extract it, and then copy it to /usr/lib/hotplug/firmware.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
......@@ -99,6 +95,16 @@ config DVB_ALPS_TDMB7
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
config DVB_CX22702
tristate "Conexant cx22702 demodulator (OFDM)"
depends on DVB_CORE
help
A DVB-T tuner module. Say Y when you want to support this frontend.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
config DVB_GRUNDIG_29504_401
tristate "Grundig 29504-401 based"
depends on DVB_CORE
......@@ -115,6 +121,11 @@ config DVB_TDA1004X
help
A DVB-T tuner module. Say Y when you want to support this frontend.
This driver needs external firmware. Please use the commands
"<kerneldir>/Documentation/dvb/get_dvb_firmware tda10045",
"<kerneldir>/Documentation/dvb/get_dvb_firmware tda10046" to
download/extract them, and then copy them to /usr/lib/hotplug/firmware.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
......@@ -139,6 +150,21 @@ config DVB_MT352
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
config DVB_DIB3000MB
tristate "DiBcom 3000-MB"
depends on DVB_CORE
help
A DVB-T tuner module. Designed for mobile usage. Say Y when you want
to support this frontend.
Used on USB-powered devices. You should also say Y to DVB_DIBUSB
(DiBcom USB DVB-T Adapter) to support the actual device,
this is "only" the frontend/tuner.
If you don't know what tuner module is soldered on your
DVB adapter simply enable all supported frontends, the
right one will get autodetected.
comment "DVB-C (cable) frontends"
depends on DVB_CORE
......
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