summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorPatrick Boettcher <devnull@localhost>2004-09-28 19:36:44 +0000
committerPatrick Boettcher <devnull@localhost>2004-09-28 19:36:44 +0000
commit00da2badce9a5354c4315b2805e62fb1f77edf63 (patch)
tree4ae090379ed8e6a8ecf4c0719c1c05c5e738aaa6 /linux/drivers/media
parent37884cd17a30bf0711f1214647a35047dab17229 (diff)
downloadmediapointer-dvb-s2-00da2badce9a5354c4315b2805e62fb1f77edf63.tar.gz
mediapointer-dvb-s2-00da2badce9a5354c4315b2805e62fb1f77edf63.tar.bz2
- added new device ids (unkown name) from new Twinhan driver
- notes in documentation - some cleanups - return values in firmware upload method (thanks to Ian <ian (a) imm.uklinux.net>)
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/dibusb/Kconfig5
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb.c45
-rw-r--r--linux/drivers/media/dvb/dibusb/dvb-dibusb.h26
3 files changed, 57 insertions, 19 deletions
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