[PATCH] bttv_card & bttv_radio (was Re: BTTV detection broken in 2.4.0-test11-pre5)

From: Werner Almesberger (Werner.Almesberger@epfl.ch)
Date: Sun Nov 19 2000 - 21:14:24 EST


Gerd Knorr wrote:
> Why? What is the point in compiling bttv statically into the kernel?

Well, I see the modules vs. static flame war is already in progress ;-)

My reason for wanting static kernels is that I usually build many, very
different versions of the same kernel, among which I frequently switch
back and forth, and which I copy to different machines. Modules just get
in the way here.

I'm not at all against modules in general, quite to the contrary, but
there are cases where a static kernel is preferrable, and since it's
easy to keep the driver usable also without modules, I think it's worth
the effort.

Since we don't have Keith Owens' wonderful extension yet, I've made a
patch for 2.4.0-test11-pre7 that adds the new option bttv_card, and
renames bt848_radio to bttv_radio, replacing my previous patch. It also
fixes a rather embarrassing mistake I made in the bt848_radio patch ...

- Werner

---------------------------------- cut here -----------------------------------

--- linux.orig/Documentation/kernel-parameters.txt Tue Sep 5 22:51:14 2000
+++ linux/Documentation/kernel-parameters.txt Mon Nov 20 02:15:59 2000
@@ -43,6 +43,7 @@
         SERIAL Serial support is enabled.
         SMP The kernel is an SMP kernel.
         SOUND Appropriate sound system support is enabled.
+ V4L Video For Linux support is enabled.
         VGA The VGA console has been enabled.
         VT Virtual terminal support is enabled.
         XT IBM PC/XT MFM hard disk support is enabled.
@@ -115,6 +116,20 @@
                         Duplex Mode.
 
         bmouse= [HW,MOUSE,PS2] Bus mouse.
+
+ bttv_card= [HW,V4L] Specify the model of the BT848/878 card(s),
+ superseding any auto-detection. The values are
+ described in Documentation/video4linux/bttv/CARDLIST.
+ E.g. bttv_card=2 specifies "Hauppauge old" for the
+ first card, bttv_card=3,3 specifies "STB" for the
+ first two cards.
+
+ bttv_radio= [HW,V4L] Enables the FM radio tuners of BT848/878
+ cards. This parameter corresponds to the radio= module
+ parameter if the driver is compiled as such, e.g.
+ bttv_radio=1 enables the radio of the first card,
+ bttv_radio=0,1 enables the radio of the second card,
+ etc.
 
         BusLogic= [HW,SCSI]
 
--- linux.orig/drivers/media/video/bttv-cards.c Mon Nov 20 02:07:47 2000
+++ linux/drivers/media/video/bttv-cards.c Mon Nov 20 03:07:22 2000
@@ -1319,6 +1319,24 @@
         }
 }
 
+#ifndef MODULE
+
+static int __init bttv_card_setup(char *str)
+{
+ int i,number,res = 2;
+
+ for (i = 0; res == 2 && i < BTTV_MAX; i++) {
+ res = get_option(&str,&number);
+ if (res)
+ card[i] = number;
+ }
+ return 1;
+}
+
+__setup("bttv_card=", bttv_card_setup);
+
+#endif /* not MODULE */
+
 /*
  * Local variables:
  * c-basic-offset: 8
--- linux.orig/drivers/media/video/bttv-driver.c Mon Nov 20 02:07:47 2000
+++ linux/drivers/media/video/bttv-driver.c Mon Nov 20 02:59:10 2000
@@ -3100,6 +3100,24 @@
 module_init(bttv_init_module);
 module_exit(bttv_cleanup_module);
 
+#ifndef MODULE
+
+static int __init bttv_radio_setup(char *str)
+{
+ int i,number,res = 2;
+
+ for (i = 0; res == 2 && i < BTTV_MAX; i++) {
+ res = get_option(&str,&number);
+ if (res)
+ radio[i] = number;
+ }
+ return 1;
+}
+
+__setup("bttv_radio=", bttv_radio_setup);
+
+#endif /* not MODULE */
+
 /*
  * Local variables:
  * c-basic-offset: 8

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH           Werner.Almesberger@epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Nov 23 2000 - 21:00:18 EST