[V4L] Make AGC and adaptive AGC configurable [patch for bttv-0.7.51]

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



Hello,

I'm trying to use bt8[47]8 boards for image processing and need to
turn off AGC, or at least turn off `adaptive AGC' (`crush') in the
bttv driver.

The patch below for Gerd's bttv-0.7.51 lets me do this with a new
`initialization flags' parameter.

I can provide a patch for the 2.2.18 bttv version as well, but
according to my experience stream-capturing doesn't work properly in
that version anyway (bttv-0.7.51 seems much better).

Regards,
Wolfram.

--- bttv-0.7.51/driver/bttv-driver.c.orig	Sun Dec 17 15:05:48 2000
+++ bttv-0.7.51/driver/bttv-driver.c	Wed Dec 27 00:08:08 2000
@@ -72,6 +72,7 @@
 unsigned int bttv_debug = 0;
 unsigned int bttv_verbose = 1;
 unsigned int bttv_gpio = 0;
+static unsigned int init_fl[BTTV_MAX];
 
 /* insmod options */
 MODULE_PARM(radio,"1-4i");
@@ -93,9 +94,11 @@
 MODULE_PARM(gbufsize,"i");
 MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000");
 MODULE_PARM(combfilter,"i");
+MODULE_PARM(init_fl,"1-4i");
+MODULE_PARM_DESC(init_fl,"initialization flags, 1 to disable AGC, 2 to disable crush, default is 0");
 
 MODULE_DESCRIPTION("bttv - v4l driver module for bt848/878 based cards");
-MODULE_AUTHOR("Ralph  Metzler & Marcus Metzler & Gerd Knorr");
+MODULE_AUTHOR("Ralph Metzler & Marcus Metzler & Gerd Knorr");
 
 /* kernel args */
 #ifndef MODULE
@@ -2484,6 +2487,7 @@
 {
 	int j;
  	unsigned long irq_flags;
+	unsigned init_wd;
 
 	btv->user=0; 
         init_MUTEX(&btv->lock);
@@ -2586,8 +2590,12 @@
 
 	btwrite(0x20, BT848_E_VSCALE_HI);
 	btwrite(0x20, BT848_O_VSCALE_HI);
-	btwrite(/*BT848_ADC_SYNC_T|*/
-		BT848_ADC_RESERVED|BT848_ADC_CRUSH, BT848_ADC);
+	init_wd = BT848_ADC_RESERVED;
+	if (init_fl[btv->nr] & 1)
+		init_wd |= BT848_ADC_AGC_EN; /* disable AGC */
+	if (!(init_fl[btv->nr] & 2))
+		init_wd |= BT848_ADC_CRUSH; /* adaptive AGC */
+	btwrite(/*BT848_ADC_SYNC_T|*/ init_wd, BT848_ADC);
 
 	btwrite(BT848_CONTROL_LDEC, BT848_E_CONTROL);
 	btwrite(BT848_CONTROL_LDEC, BT848_O_CONTROL);





[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