patch-2.2.13 linux/drivers/char/bttv.c

Next file: linux/drivers/char/buz.c
Previous file: linux/drivers/char/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/drivers/char/bttv.c linux/drivers/char/bttv.c
@@ -563,7 +563,7 @@
         /* MIRO PCTV pro */
         { 3, 1, 0, 2, 65551, { 2, 3, 1, 1}, {1,65537, 0, 0,10}},
 	/* ADS Technologies Channel Surfer TV (and maybe TV+FM) */
-	{ 3, 4, 2, 2, 15, { 2, 3, 1, 1}, { 13, 14, 11, 7, 0, 0}, 0},
+	{ 3, 4, 0, 2, 15, { 2, 3, 1, 1}, { 13, 14, 11, 7, 0, 0}, 0},
         /* AVerMedia TVCapture 98 */
 	{ 3, 4, 0, 2, 15, { 2, 3, 1, 1}, { 13, 14, 11, 7, 0, 0}, 0},
         /* Aimslab VHX */
@@ -1288,7 +1288,7 @@
 }
 
 
-static void bt848_set_geo(struct bttv *btv, u16 width, u16 height, u16 fmt)
+static void bt848_set_geo(struct bttv *btv, u16 width, u16 height, u16 fmt, int pll)
 {
         u16 vscale, hscale;
 	u32 xsf, sr;
@@ -1297,9 +1297,13 @@
 	u16 inter;
 	u8 crop, vtc;  
 	struct tvnorm *tvn;
+	unsigned long flags;
  	
 	if (!width || !height)
 	        return;
+	        
+	save_flags(flags);
+	cli();
 
 	tvn=&tvnorms[btv->win.norm];
 	
@@ -1324,7 +1328,8 @@
 	btwrite(1, BT848_VBI_PACK_DEL);
 
         btv->pll.pll_ofreq = tvn->Fsc;
-        set_pll(btv);
+        if(pll)
+        	set_pll(btv);
 
 	btwrite(fmt, BT848_COLOR_FMT);
 #ifdef __sparc__
@@ -1372,6 +1377,7 @@
 			hdelay, vdelay, crop);
 	bt848_set_eogeo(btv, 1, vtc, hscale, vscale, hactive, vactive,
 			hdelay, vdelay, crop);
+	restore_flags(flags);
 }
 
 
@@ -1400,7 +1406,7 @@
 	else
 	        btor(BT848_CAP_CTL_DITH_FRAME, BT848_CAP_CTL);
 
-        bt848_set_geo(btv, btv->win.width, btv->win.height, format);
+        bt848_set_geo(btv, btv->win.width, btv->win.height, format, 1);
 }
 
 /*
@@ -3436,14 +3442,14 @@
 					btv->risc_jmp[11]=cpu_to_le32(btv->gre);
 					bt848_set_geo(btv, btv->gwidth,
 						      btv->gheight,
-						      btv->gfmt);
+						      btv->gfmt, 0);
 				} else {
 					bt848_set_risc_jmps(btv);
 					btand(~BT848_VSCALE_COMB, BT848_E_VSCALE_HI);
 					btand(~BT848_VSCALE_COMB, BT848_O_VSCALE_HI);
                                         bt848_set_geo(btv, btv->win.width, 
 						      btv->win.height,
-						      btv->win.color_fmt);
+						      btv->win.color_fmt, 0);
 				}
 				wake_up_interruptible(&btv->capq);
 				break;
@@ -3454,7 +3460,7 @@
 				btv->risc_jmp[11]=cpu_to_le32(btv->gre);
 				btv->risc_jmp[12]=cpu_to_le32(BT848_RISC_JUMP);
 				bt848_set_geo(btv, btv->gwidth, btv->gheight,
-					      btv->gfmt);
+					      btv->gfmt, 0);
 			}
 		}
 		if (astat&BT848_INT_OCERR) 
@@ -3557,7 +3563,7 @@
                 remap[bttv_num]|=btv->bt848_adr&(~PCI_BASE_ADDRESS_MEM_MASK);
                 pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, remap[bttv_num]);
                 pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &dw);
-                btv->dev->base_address[0] = btv->bt848_adr;
+                btv->dev->base_address[0] = btv->bt848_adr = dw;
         }					
         btv->bt848_adr&=PCI_BASE_ADDRESS_MEM_MASK;
         pci_read_config_byte(dev, PCI_CLASS_REVISION, &btv->revision);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)