[linux-dvb] Patches to fix support for VisionPlus DTV (VP1020) / tuning problem

Steffen Motzer motzersn at tlink.de
Sat Apr 23 11:39:04 CEST 2005


These patches fix the following bugs:

bttv-i2c.c:
After upgrading from 2.6.9 to 2.6.11.7, bttv failed to write to the ASIC
via the i2c bus. After a couple of times bttv_i2c_wait_done was called
the RACK flag was indicating a failed i2c operation.

dvb-bt8xx.c:
dst_attach returns a pointer. If dst_attach failed to find a frontend
(the ASIC) dvb-bt8xx tried to register a frontend anyway.

dst.c:
dst.c compared the ID returned by the frontend with the NULL pointer of
the last (empty) entry of dst_tlist if it couldn't find the ID in the
list making the the driver crash.
I also added the ID of my card to dst_tlist.

After applying the patches the driver successfully loads but tuning
rarely works right. Xine starts buffering but never finishes. Sometimes
I can see a badly corrupted frame so Xine seems to receive some data
from the transponder. If I repeatedly start mplayer to tune to the same
channel until the card finally tunes right then on the next start xine
always successfully receives this channel.



-------------- next part --------------
--- dvb-bt8xx.c.orig	2005-04-04 20:22:29.000000000 +0200
+++ dvb-bt8xx.c		2005-04-19 09:33:50.000000000 +0200
@@ -514,7 +514,7 @@
 		state->bt = card->bt;
 
 		/*	DST is not a frontend, attaching the ASIC	*/
-		if ((dst_attach(state, &card->dvb_adapter)) < 0) {
+		if ((dst_attach(state, &card->dvb_adapter)) == NULL) {
 			printk("%s: Could not find a Twinhan DST.\n", __FUNCTION__);
 			break;
 		}

-------------- next part --------------
*** bttv-i2c.c.orig	2005-04-23 00:42:40.000000000 +0200
--- bttv-i2c.c		2005-04-23 02:09:43.000000000 +0200
*************** bttv_i2c_wait_done(struct bttv *btv)
*** 135,143 ****
  	DECLARE_WAITQUEUE(wait, current);
  	int rc = 0;
  
  	add_wait_queue(&btv->i2c_queue, &wait);
! 	if (0 == btv->i2c_done)
! 		msleep_interruptible(20);
  	remove_wait_queue(&btv->i2c_queue, &wait);
  
  	if (0 == btv->i2c_done)
--- 135,148 ----
  	DECLARE_WAITQUEUE(wait, current);
  	int rc = 0;
  
+ 	unsigned long timeout = msecs_to_jiffies(20);
+ 
  	add_wait_queue(&btv->i2c_queue, &wait);
! 
! 	while (0 == btv->i2c_done && timeout) {
! 		set_current_state(TASK_INTERRUPTIBLE);
! 		timeout = schedule_timeout(timeout);
! 	}
  	remove_wait_queue(&btv->i2c_queue, &wait);
  
  	if (0 == btv->i2c_done)

-------------- next part --------------
*** dst.c.orig	2005-04-07 12:39:36.000000000 +0200
--- dst.c		2005-04-23 02:06:01.000000000 +0200
*************** struct dst_types dst_tlist[] = {
*** 684,689 ****
--- 684,697 ----
  		.dst_feature = 0
  	},
  
+ 	{
+                 .device_id = "200103A",
+                 .offset = 0,
+                 .dst_type = DST_TYPE_IS_SAT,
+                 .type_flags = DST_TYPE_HAS_SYMDIV | DST_TYPE_HAS_FW_1,
+                 .dst_feature = 0
+         },
+ 
  	{ }
  
  };
*************** static int dst_get_device_id(struct dst_
*** 732,738 ****
  	state->rxbuffer[7] = '\0';
  
  	for (i = 0, p_dst_type = dst_tlist; i < ARRAY_SIZE (dst_tlist); i++, p_dst_type++) {
! 		if (!strncmp (&state->rxbuffer[p_dst_type->offset], p_dst_type->device_id, strlen (p_dst_type->device_id))) {
  			use_type_flags = p_dst_type->type_flags;
  			use_dst_type = p_dst_type->dst_type;
  
--- 740,746 ----
  	state->rxbuffer[7] = '\0';
  
  	for (i = 0, p_dst_type = dst_tlist; i < ARRAY_SIZE (dst_tlist); i++, p_dst_type++) {
! 		if (p_dst_type->device_id!=NULL && !strncmp (&state->rxbuffer[p_dst_type->offset], p_dst_type->device_id, strlen (p_dst_type->device_id))) {
  			use_type_flags = p_dst_type->type_flags;
  			use_dst_type = p_dst_type->dst_type;
  



More information about the linux-dvb mailing list