Re: patch(bttv-0.7.103+snapshot)#2: radio PCTVpro/Mt2032, Voodoo TV FM(TV 200)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi,
2nd version of the fix:
- close race (by re-broadcasting pinnacle_id after tuner.o has loaded)
- FM Radio on Voodoo TV/FM (Voodoo TV 200) works again
- printk->dprintk as applicable
- relative to http://bytesex.org/snapshot/bttv7-20030131.tar.gz

Regards, Gunther



diff -Nur bttv7-20030131/driver/bttv-cards.c bttv7-20030131gm/driver/bttv-cards.c
--- bttv7-20030131/driver/bttv-cards.c	Fri Jan 31 20:54:47 2003
+++ bttv7-20030131gm/driver/bttv-cards.c	Sun Feb  2 18:08:53 2003
@@ -1788,7 +1788,7 @@
 int miro_fmtuner[]  = { 0,0,0,0,   0,0,0,0,  0,0,0,0,  0,0,0,1,
 			1,1,1,1,   1,1,1,0,  0,0,0,0,  0,1,0,0 };
 
-static void miro_pinnacle_gpio(struct bttv *btv)
+static int miro_pinnacle_gpio(struct bttv *btv)
 {
 	int id,msp,gpio;
 	char *info;
@@ -1862,7 +1862,9 @@
 		if (autoload)
 			request_module("tda9887");
 		bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,&id);
+		return(id);
 	}
+	return -1;
 }
 
 /* GPIO21   L: Buffer aktiv, H: Buffer inaktiv */
@@ -1936,6 +1938,7 @@
 /* initialization part two -- after registering i2c bus */
 void __devinit bttv_init_card2(struct bttv *btv)
 {
+	int pinnacle_id = -1;
         btv->tuner_type = -1;
 
 	if (BTTV_UNKNOWN == btv->type) {
@@ -1949,7 +1952,7 @@
 	case BTTV_PINNACLE:
 	case BTTV_PINNACLEPRO: 
 		/* miro/pinnacle */
-		miro_pinnacle_gpio(btv);
+		pinnacle_id=miro_pinnacle_gpio(btv);
 		break;
 	case BTTV_FLYVIDEO_98:
 	case BTTV_MAXI:
@@ -2111,8 +2114,12 @@
 	}
 
 	if (bttv_tvcards[btv->type].tuner != UNSET) {
-		if (autoload)
+		if (autoload) {
 			request_module("tuner");
+			if(pinnacle_id != -1)
+		                bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,&pinnacle_id);
+
+		}
 	}
 }
 
diff -Nur bttv7-20030131/driver/tda9887.c bttv7-20030131gm/driver/tda9887.c
--- bttv7-20030131/driver/tda9887.c	Tue Jan 28 21:29:07 2003
+++ bttv7-20030131gm/driver/tda9887.c	Sun Feb  2 17:57:12 2003
@@ -419,6 +419,7 @@
 	{
 		int *i = arg;
 
+		dprintk("bttv tda9887 received pinnacle id %d\n",*i);
 		t->pinnacle_id = *i;
 		tda9887_miro(t);
 		break;
diff -Nur bttv7-20030131/driver/tuner.c bttv7-20030131gm/driver/tuner.c
--- bttv7-20030131/driver/tuner.c	Fri Jan 31 16:02:37 2003
+++ bttv7-20030131gm/driver/tuner.c	Sun Feb  2 18:00:22 2003
@@ -54,6 +54,7 @@
 	unsigned int radio;
 	unsigned int mode;            /* current norm for multi-norm tuners */
 	unsigned int xogc;	     // only for MT2032
+	unsigned int pinnacle_id;     // only for Pinnacle PCTVpro/MT2032 radio mode
 };
 
 static struct i2c_driver driver;
@@ -733,9 +734,17 @@
 static void mt2032_set_radio_freq(struct i2c_client *c,int freq)
 {               
         int if2;
+	struct tuner *t = (struct tuner*)c->data;
 
+	// 10.7 MHz IF (right for Voodoo TVFM)
         if2=10700*1000; //  10.7MHz FM intermediate frequency
 
+	// Pinnacle PCTVpro/MT2032/tda9887:
+	if(t->pinnacle_id == 3) // NTSC card
+		if2=41300*1000;
+	else if(t->pinnacle_id ==2 ) // PAL card
+		if2=33300*1000;
+
 	// per Manual for FM tuning: first if center freq. 1085 MHz
         mt2032_set_if_freq(c,freq* 1000*1000/16, 1085*1000*1000,if2,if2,if2);
 }
@@ -889,7 +898,17 @@
 	case AUDC_SET_RADIO:
 		t->radio = 1;
 		break;
-		
+
+	
+	case AUDC_CONFIG_PINNACLE:
+	{
+		int *i = arg;
+		dprintk("bttv tuner received pinnacle id %d\n",*i);
+
+                t->pinnacle_id = *i;
+                break;
+        }
+	
 	/* --- v4l ioctls --- */
 	/* take care: bttv does userspace copying, we'll get a
 	   kernel pointer here... */

[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux