summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/Documentation/video4linux/CARDLIST.cx882
-rw-r--r--linux/drivers/media/dvb/cinergyT2/cinergyT2.c6
-rw-r--r--linux/drivers/media/video/cpia.c14
-rw-r--r--linux/drivers/media/video/cpia_pp.c8
-rw-r--r--linux/drivers/media/video/cpia_usb.c6
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-vbi.c61
-rw-r--r--linux/drivers/media/video/cx88/cx88-cards.c9
-rw-r--r--linux/drivers/media/video/cx88/cx88-input.c4
-rw-r--r--linux/drivers/media/video/cx88/cx88.h2
-rw-r--r--linux/include/media/v4l2-dev.h8
-rw-r--r--v4l/Makefile13
-rwxr-xr-xv4l/scripts/insmod.sh307
-rwxr-xr-xv4l/scripts/make_kconfig.pl149
-rwxr-xr-xv4l/scripts/make_noconfig.pl57
-rwxr-xr-xv4l/scripts/rmmod.pl195
15 files changed, 390 insertions, 451 deletions
diff --git a/linux/Documentation/video4linux/CARDLIST.cx88 b/linux/Documentation/video4linux/CARDLIST.cx88
index f9636fd6b..19a0a6a46 100644
--- a/linux/Documentation/video4linux/CARDLIST.cx88
+++ b/linux/Documentation/video4linux/CARDLIST.cx88
@@ -48,5 +48,5 @@
47 -> pcHDTV HD5500 HDTV [7063:5500]
48 -> Kworld MCE 200 Deluxe [17de:0841]
49 -> PixelView PlayTV P7000 [1554:4813]
- 50 -> NPG Tech Real TV [14f1:0842]
+ 50 -> NPG Tech Real TV FM Top 10 [14f1:0842]
51 -> WinFast DTV2000 H [107d:665e]
diff --git a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
index 8dbba1ca7..0fb56a66a 100644
--- a/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/linux/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -561,15 +561,19 @@ static unsigned int cinergyt2_poll (struct file *file, struct poll_table_struct
{
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
+ unsigned int mask = 0;
if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;
poll_wait(file, &cinergyt2->poll_wq, wait);
+ if (cinergyt2->pending_fe_events != 0)
+ mask |= (POLLIN | POLLRDNORM | POLLPRI);
+
mutex_unlock(&cinergyt2->sem);
- return (POLLIN | POLLRDNORM | POLLPRI);
+ return mask;
}
diff --git a/linux/drivers/media/video/cpia.c b/linux/drivers/media/video/cpia.c
index 99ee90628..c605f4849 100644
--- a/linux/drivers/media/video/cpia.c
+++ b/linux/drivers/media/video/cpia.c
@@ -50,13 +50,6 @@
#include "cpia.h"
-#ifdef CONFIG_VIDEO_CPIA_PP
-extern int cpia_pp_init(void);
-#endif
-#ifdef CONFIG_VIDEO_CPIA_USB
-extern int cpia_usb_init(void);
-#endif
-
static int video_nr = -1;
#ifdef MODULE
@@ -4050,13 +4043,6 @@ static int __init cpia_init(void)
proc_cpia_create();
#endif
-#ifdef CONFIG_VIDEO_CPIA_PP
- cpia_pp_init();
-#endif
-#ifdef CONFIG_VIDEO_CPIA_USB
- cpia_usb_init();
-#endif
-
return 0;
}
diff --git a/linux/drivers/media/video/cpia_pp.c b/linux/drivers/media/video/cpia_pp.c
index 0b00e6027..4c89bd395 100644
--- a/linux/drivers/media/video/cpia_pp.c
+++ b/linux/drivers/media/video/cpia_pp.c
@@ -803,7 +803,7 @@ static struct parport_driver cpia_pp_driver = {
.detach = cpia_pp_detach,
};
-int cpia_pp_init(void)
+static int cpia_pp_init(void)
{
printk(KERN_INFO "%s v%d.%d.%d\n",ABOUT,
CPIA_PP_MAJ_VER,CPIA_PP_MIN_VER,CPIA_PP_PATCH_VER);
@@ -860,6 +860,8 @@ void cleanup_module(void)
static int __init cpia_pp_setup(char *str)
{
+ int err;
+
if (!strncmp(str, "parport", 7)) {
int n = simple_strtoul(str + 7, NULL, 10);
if (parport_ptr < PARPORT_MAX) {
@@ -873,6 +875,10 @@ static int __init cpia_pp_setup(char *str)
parport_nr[parport_ptr++] = PPCPIA_PARPORT_NONE;
}
+ err=cpia_pp_init();
+ if (err)
+ return err;
+
return 1;
}
diff --git a/linux/drivers/media/video/cpia_usb.c b/linux/drivers/media/video/cpia_usb.c
index 9c49a4b00..2ee34a3b9 100644
--- a/linux/drivers/media/video/cpia_usb.c
+++ b/linux/drivers/media/video/cpia_usb.c
@@ -474,12 +474,6 @@ static int cpia_usb_close(void *privdata)
return 0;
}
-int cpia_usb_init(void)
-{
- /* return -ENODEV; */
- return 0;
-}
-
/* Probing and initializing */
static int cpia_probe(struct usb_interface *intf,
diff --git a/linux/drivers/media/video/cx25840/cx25840-vbi.c b/linux/drivers/media/video/cx25840/cx25840-vbi.c
index 3383b5549..b452ec9c8 100644
--- a/linux/drivers/media/video/cx25840/cx25840-vbi.c
+++ b/linux/drivers/media/video/cx25840/cx25840-vbi.c
@@ -89,25 +89,7 @@ void cx25840_vbi_setup(struct i2c_client *client)
v4l2_std_id std = cx25840_get_v4lstd(client);
int hblank,hactive,burst,vblank,vactive,sc,vblank656,src_decimation;
int luma_lpf,uv_lpf, comb;
- u32 pll,pll_int,pll_frac,pll_post,fin,fsc;
-
- /* DEBUG: Displays configured PLL frequency */
- pll_int=cx25840_read(client, 0x108);
- pll_frac=cx25840_read4(client, 0x10c)&0x1ffffff;
- pll_post=cx25840_read(client, 0x109);
- v4l_dbg(1, cx25840_debug, client,
- "PLL regs = int: %u, frac: %u, post: %u\n",
- pll_int,pll_frac,pll_post);
-
-
- if (pll_post) {
- pll= (28636363L*((((u64)pll_int)<<25L)+pll_frac)) >>25L;
- pll/=pll_post;
- v4l_dbg(1, cx25840_debug, client, "PLL = %d.%06d MHz\n",
- pll/1000000, pll%1000000);
- v4l_dbg(1, cx25840_debug, client, "PLL/8 = %d.%06d MHz\n",
- pll/8000000, (pll/8)%1000000);
- }
+ u32 pll_int,pll_frac,pll_post;
/* datasheet startup, step 8d */
if (std & ~V4L2_STD_NTSC) {
@@ -159,20 +141,41 @@ void cx25840_vbi_setup(struct i2c_client *client)
}
}
- fin=((u64)src_decimation*pll)>>12;
- v4l_dbg(1, cx25840_debug, client, "ADC Sampling freq = %d.%06d MHz\n",
+ /* DEBUG: Displays configured PLL frequency */
+ pll_int=cx25840_read(client, 0x108);
+ pll_frac=cx25840_read4(client, 0x10c)&0x1ffffff;
+ pll_post=cx25840_read(client, 0x109);
+ v4l_dbg(1, cx25840_debug, client,
+ "PLL regs = int: %u, frac: %u, post: %u\n",
+ pll_int,pll_frac,pll_post);
+
+ if (pll_post) {
+ int fin, fsc;
+ int pll= (28636363L*((((u64)pll_int)<<25L)+pll_frac)) >>25L;
+
+ pll/=pll_post;
+ v4l_dbg(1, cx25840_debug, client, "PLL = %d.%06d MHz\n",
+ pll/1000000, pll%1000000);
+ v4l_dbg(1, cx25840_debug, client, "PLL/8 = %d.%06d MHz\n",
+ pll/8000000, (pll/8)%1000000);
+
+ fin=((u64)src_decimation*pll)>>12;
+ v4l_dbg(1, cx25840_debug, client, "ADC Sampling freq = "
+ "%d.%06d MHz\n",
fin/1000000,fin%1000000);
- fsc= (((u64)sc)*pll) >> 24L;
- fsc= ((u32)((((u64)sc)*pll) >> 21L))/src_decimation;
- v4l_dbg(1, cx25840_debug, client, "Chroma sub-carrier freq = %d.%06d MHz\n",
+ fsc= (((u64)sc)*pll) >> 24L;
+ v4l_dbg(1, cx25840_debug, client, "Chroma sub-carrier freq = "
+ "%d.%06d MHz\n",
fsc/1000000,fsc%1000000);
- v4l_dbg(1, cx25840_debug, client, "hblank %i, hactive %i, vblank %i"
- ", vactive %i, vblank656 %i, src_dec %i,"
- "burst 0x%02x, luma_lpf %i, uv_lpf %i, comb 0x%02x, sc 0x%06x\n",
- hblank, hactive, vblank, vactive, vblank656, src_decimation,
- burst, luma_lpf, uv_lpf, comb, sc);
+ v4l_dbg(1, cx25840_debug, client, "hblank %i, hactive %i, "
+ "vblank %i , vactive %i, vblank656 %i, src_dec %i,"
+ "burst 0x%02x, luma_lpf %i, uv_lpf %i, comb 0x%02x,"
+ " sc 0x%06x\n",
+ hblank, hactive, vblank, vactive, vblank656,
+ src_decimation, burst, luma_lpf, uv_lpf, comb, sc);
+ }
/* Sets horizontal blanking delay and active lines */
cx25840_write(client, 0x470, hblank);
diff --git a/linux/drivers/media/video/cx88/cx88-cards.c b/linux/drivers/media/video/cx88/cx88-cards.c
index 3e829eb0f..5431d591e 100644
--- a/linux/drivers/media/video/cx88/cx88-cards.c
+++ b/linux/drivers/media/video/cx88/cx88-cards.c
@@ -1185,9 +1185,9 @@ struct cx88_board cx88_boards[] = {
#endif
.blackbird = 1,
},
- [CX88_BOARD_NPGTECH_REALTV] = {
- .name = "NPG Tech Real TV",
- .tuner_type = TUNER_LG_PAL_NEW_TAPC,
+ [CX88_BOARD_NPGTECH_REALTV_TOP10FM] = {
+ .name = "NPG Tech Real TV FM Top 10",
+ .tuner_type = TUNER_TNF_5335MF, /* Actually a TNF9535 */
.radio_type = UNSET,
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
@@ -1202,6 +1202,7 @@ struct cx88_board cx88_boards[] = {
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
+ .gpio0 = 0x078b,
}},
.radio = {
.type = CX88_RADIO,
@@ -1462,7 +1463,7 @@ struct cx88_subid cx88_subids[] = {
},{
.subvendor = 0x14f1,
.subdevice = 0x0842,
- .card = CX88_BOARD_NPGTECH_REALTV,
+ .card = CX88_BOARD_NPGTECH_REALTV_TOP10FM,
},{
.subvendor = 0x107d,
.subdevice = 0x665e,
diff --git a/linux/drivers/media/video/cx88/cx88-input.c b/linux/drivers/media/video/cx88/cx88-input.c
index 8b8bbb1b5..9283be42d 100644
--- a/linux/drivers/media/video/cx88/cx88-input.c
+++ b/linux/drivers/media/video/cx88/cx88-input.c
@@ -75,7 +75,7 @@ static void cx88_ir_handle_key(struct cx88_IR *ir)
/* read gpio value */
gpio = cx_read(ir->gpio_addr);
- if (core->board == CX88_BOARD_NPGTECH_REALTV) {
+ if (core->board == CX88_BOARD_NPGTECH_REALTV_TOP10FM) {
/* This board apparently uses a combination of 2 GPIO
to represent the keys. Additionally, the second GPIO
can be used for parity.
@@ -249,7 +249,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
ir_type = IR_TYPE_PD;
ir->sampling = 0xff00; /* address */
break;
- case CX88_BOARD_NPGTECH_REALTV:
+ case CX88_BOARD_NPGTECH_REALTV_TOP10FM:
ir_codes = ir_codes_npgtech;
ir->gpio_addr = MO_GP0_IO;
ir->mask_keycode = 0xfa;
diff --git a/linux/drivers/media/video/cx88/cx88.h b/linux/drivers/media/video/cx88/cx88.h
index b8a28e7cb..efeef4b47 100644
--- a/linux/drivers/media/video/cx88/cx88.h
+++ b/linux/drivers/media/video/cx88/cx88.h
@@ -201,7 +201,7 @@ extern struct sram_channel cx88_sram_channels[];
#define CX88_BOARD_PCHDTV_HD5500 47
#define CX88_BOARD_KWORLD_MCE200_DELUXE 48
#define CX88_BOARD_PIXELVIEW_PLAYTV_P7000 49
-#define CX88_BOARD_NPGTECH_REALTV 50
+#define CX88_BOARD_NPGTECH_REALTV_TOP10FM 50
#define CX88_BOARD_WINFAST_DTV2000H 51
enum cx88_itype {
diff --git a/linux/include/media/v4l2-dev.h b/linux/include/media/v4l2-dev.h
index f43216d68..18f1bd706 100644
--- a/linux/include/media/v4l2-dev.h
+++ b/linux/include/media/v4l2-dev.h
@@ -47,10 +47,6 @@
#define VFL_TYPE_RADIO 2
#define VFL_TYPE_VTX 3
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
- const struct file_operations *fops;
-#endif
-
/* Video standard functions */
extern unsigned int v4l2_video_std_fps(struct v4l2_standard *vs);
extern int v4l2_video_std_construct(struct v4l2_standard *vs,
@@ -101,7 +97,11 @@ struct v4l2_tvnorm {
struct video_device
{
/* device ops */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,17)
+ const struct file_operations *fops;
+#else
struct file_operations *fops;
+#endif
/* device info */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
diff --git a/v4l/Makefile b/v4l/Makefile
index 6f86925a6..87fdc5270 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -232,14 +232,17 @@ distclean:: clean
#################################################
# Kernel module insert/removal rules
-insmod load::
- scripts/insmod.sh load
+start insmod load::
+ scripts/rmmod.pl load
-rmmod unload::
- scripts/insmod.sh unload
+stop rmmod unload::
+ scripts/rmmod.pl unload
reload::
- scripts/insmod.sh reload
+ scripts/rmmod.pl reload
+
+debug::
+ scripts/rmmod.pl debug
#################################################
# Configuration rules
diff --git a/v4l/scripts/insmod.sh b/v4l/scripts/insmod.sh
deleted file mode 100755
index 91b4558e3..000000000
--- a/v4l/scripts/insmod.sh
+++ /dev/null
@@ -1,307 +0,0 @@
-#!/bin/sh
-# insmod modules from current directory without having to install them first
-
-sync
-
-case "$1" in
- load)
- echo "Inserting V4L/DVB modules into kernel"
- modprobe i2c-core
- modprobe crc32
- modprobe firmware_class
- # make sure input stuff is there for IR remote controls
- modprobe evdev
- # video4linux
- insmod ./compat_ioctl32.ko
- insmod ./videodev.ko
- insmod ./v4l1-compat.ko
- insmod ./v4l2-common.ko
- insmod ./video-buf.ko
- insmod ./ir-common.ko
- insmod ./ir-kbd-i2c.ko
- insmod ./tuner.ko
- insmod ./tda9887.ko
- insmod ./tvaudio.ko
- insmod ./tveeprom.ko
- insmod ./tvmixer.ko
- insmod ./cs53l32a.ko
- insmod ./wm8775.ko
- insmod ./cx25840.ko
- insmod ./saa7115.ko
- insmod ./btcx-risc.ko
- insmod ./saa7127.ko
- insmod ./msp3400.ko
- insmod ./tvp5150.ko
- insmod ./tda7432.ko
- insmod ./tda9840.ko
- insmod ./tda9875.ko
- insmod ./tea6415c.ko
- insmod ./tea6420.ko
- # DVB core
- insmod ./dvb-core.ko # dvb_net_debug=1
- # for hybrid cx88 and saa7134 cards
- insmod ./video-buf-dvb.ko
- # frontend drivers
- insmod ./dvb-pll.ko
- insmod ./ves1x93.ko
- insmod ./sp8870.ko
- insmod ./cx22700.ko
- insmod ./stv0299.ko
- insmod ./ves1820.ko
- insmod ./tda1004x.ko
- insmod ./tda10021.ko
- insmod ./dib3000-common.ko
- insmod ./dib3000mb.ko
- insmod ./dib3000mc.ko
- insmod ./l64781.ko
- insmod ./tda8083.ko
- insmod ./cx24110.ko
- insmod ./cx24123.ko
- insmod ./cx22702.ko
- insmod ./mt312.ko
- insmod ./mt352.ko
- insmod ./stv0297.ko
- insmod ./nxt200x.ko
- insmod ./lgdt330x.ko
- insmod ./nxt6000.ko
- insmod ./bcm3510.ko
- insmod ./s5h1420.ko
- insmod ./sp887x.ko
- insmod ./or51211.ko
- insmod ./or51132.ko
- insmod ./zl10353.ko
- insmod ./ttusbdecfe.ko
-
- # saa7146 based siemens/technotrend/hauppauge cards
- insmod ./saa7146.ko
- insmod ./saa7146_vv.ko
- insmod ./ttpci-eeprom.ko
- insmod ./dvb-ttpci.ko
- insmod ./budget-core.ko
- insmod ./budget.ko
- insmod ./budget-ci.ko
- insmod ./budget-av.ko
- insmod ./mxb.ko
- insmod ./hexium_gemini.ko
- insmod ./hexium_orion.ko
- # technotrend/hauppauge USB things
- insmod ./dvb-ttusb-budget.ko
- insmod ./ttusb_dec.ko
-
- # technisat skystar2
- insmod ./stv0297_cs2.ko
- insmod ./b2c2-flexcop.ko
- insmod ./b2c2-flexcop-usb.ko
- insmod ./b2c2-flexcop-pci.ko
- # terratec CinergyT2
- insmod ./cinergyT2.ko
-
- insmod ./dvb-usb.ko
- insmod ./dvb-usb-gp8psk.ko
- insmod ./dvb-usb-vp7045.ko
- insmod ./dvb-usb-dtt200u.ko
-
- insmod ./dvb-usb-dibusb-common.ko
- insmod ./dvb-usb-dibusb-mb.ko
- insmod ./dvb-usb-dibusb-mc.ko
- insmod ./dvb-usb-a800.ko
- insmod ./dvb-usb-nova-t-usb2.ko
- insmod ./dvb-usb-umt-010.ko
- insmod ./dvb-usb-digitv.ko
- insmod ./dvb-usb-cxusb.ko
- # bt8xx
- insmod ./bt832.ko
- insmod ./bttv.ko
- insmod ./bt878.ko
- insmod ./dst.ko
- insmod ./dst_ca.ko
- insmod ./dvb-bt8xx.ko
- insmod ./saa6588.ko
- # conexant cx2388x
- insmod ./cx88xx.ko
- insmod ./cx8800.ko
- insmod ./cx8802.ko
- insmod ./cx88-vp3054-i2c.ko
- insmod ./cx88-dvb.ko
- insmod ./cx88-blackbird.ko
- insmod ./cx88-alsa.ko
- # phillips saa713x
- insmod ./saa7134.ko
- insmod ./saa7134-alsa.ko
-# insmod ./saa7134-oss.ko
- insmod ./saa7134-dvb.ko
- insmod ./saa7134-empress.ko
- insmod ./saa6752hs.ko
-
- insmod ./em28xx.ko
- insmod ./pvrusb2.ko
- insmod ./cpia2.ko
- insmod ./vivi.ko
-
- echo
- ;;
- debug)
- echo "Inserting V4L/DVB modules (debug) into kernel"
- modprobe i2c-core
- modprobe crc32
- modprobe firmware_class
- modprobe evdev
- insmod ./compat_ioctl32.ko
- insmod ./videodev.ko
- insmod ./v4l1-compat.ko
- insmod ./v4l2-common.ko
- insmod ./video-buf.ko
- insmod ./ir-common.ko
- insmod ./ir-kbd-i2c.ko
- insmod ./tuner.ko tuner_debug=1
- insmod ./tda9887.ko
- insmod ./tvaudio.ko
- insmod ./tveeprom.ko
- insmod ./tvmixer.ko
- insmod ./cs53l32a.ko
- insmod ./wm8775.ko
- insmod ./cx25840.ko
- insmod ./saa7115.ko
- insmod ./btcx-risc.ko
- insmod ./saa7127.ko
- insmod ./msp3400.ko
- insmod ./tvp5150.ko
- insmod ./tda7432.ko
- insmod ./tda9840.ko
- insmod ./tda9875.ko
- insmod ./tea6415c.ko
- insmod ./tea6420.ko
- insmod ./dvb-core.ko cam_debug=1
- insmod ./video-buf-dvb.ko
- insmod ./dvb-pll.ko
- insmod ./ves1x93.ko
- insmod ./sp8870.ko
- insmod ./cx22700.ko
- insmod ./stv0299.ko
- insmod ./ves1820.ko
- insmod ./tda1004x.ko
- insmod ./tda10021.ko
- insmod ./dib3000-common.ko
- insmod ./dib3000mb.ko
- insmod ./dib3000mc.ko
- insmod ./l64781.ko
- insmod ./stv0297.ko
- insmod ./tda8083.ko
- insmod ./cx24110.ko
- insmod ./cx24123.ko
- insmod ./mt312.ko
- insmod ./mt352.ko
- insmod ./cx22702.ko
- insmod ./nxt200x.ko
- insmod ./lgdt330x.ko
- insmod ./nxt6000.ko
- insmod ./bcm3510.ko
- insmod ./s5h1420.ko
- insmod ./sp887x.ko
- insmod ./or51211.ko
- insmod ./or51132.ko
- insmod ./zl10353.ko
- insmod ./ttusbdecfe.ko
- insmod ./saa7146.ko
- insmod ./saa7146_vv.ko
- insmod ./ttpci-eeprom.ko
- insmod ./dvb-ttpci.ko debug=247
- insmod ./budget-core.ko
- insmod ./budget.ko
- insmod ./budget-ci.ko
- insmod ./budget-av.ko
- insmod ./mxb.ko
- insmod ./hexium_gemini.ko
- insmod ./hexium_orion.ko
- insmod ./dvb-ttusb-budget.ko
- insmod ./stv0297_cs2.ko
- insmod ./b2c2-flexcop.ko debug=0x01
- insmod ./b2c2-flexcop-usb.ko debug=0x01
- insmod ./b2c2-flexcop-pci.ko debug=0x01
- insmod ./ttusb_dec.ko
- insmod ./cinergyT2.ko
-
- insmod ./dvb-usb.ko debug=0x33
- insmod ./dvb-usb-gp8psk.ko debug=0x03
- insmod ./dvb-usb-vp7045.ko debug=0x03
- insmod ./dvb-usb-dtt200u.ko debug=0x03
-
- insmod ./dvb-usb-dibusb-common.ko debug=0x03
- insmod ./dvb-usb-dibusb-mb.ko
- insmod ./dvb-usb-dibusb-mc.ko
- insmod ./dvb-usb-a800.ko
- insmod ./dvb-usb-nova-t-usb2.ko
- insmod ./dvb-usb-umt-010.ko
- insmod ./dvb-usb-digitv.ko
- insmod ./dvb-usb-cxusb.ko
-
- insmod ./bt832.ko
- insmod ./bttv.ko
- insmod ./bt878.ko
- insmod ./dst.ko
- insmod ./dst_ca.ko
- insmod ./dvb-bt8xx.ko
- insmod ./saa6588.ko
-
- insmod ./cx88xx.ko
- insmod ./cx8800.ko
- insmod ./cx8802.ko
- insmod ./cx88-vp3054-i2c.ko
- insmod ./cx88-dvb.ko
- insmod ./cx88-blackbird.ko
- insmod ./cx88-alsa.ko
-
- insmod ./saa7134.ko
- insmod ./saa7134-alsa.ko
- insmod ./saa7134-oss.ko
- insmod ./saa7134-dvb.ko
- insmod ./saa7134-empress.ko
- insmod ./saa6752hs.ko
-
- insmod ./em28xx.ko
- insmod ./pvrusb2.ko
- insmod ./cpia2.ko
- insmod ./vivi.ko
- echo
- ;;
- unload)
- echo "Removing V4L/DVB modules from kernel"
- rmmod b2c2-flexcop-usb b2c2-flexcop-pci b2c2-flexcop dvb-ttpci budget \
- budget-av budget-ci budget-core ttusb_dec dvb-ttusb-budget \
- ttpci-eeprom dvb-usb-nova-t-usb2.ko dvb-usb-a800.ko \
- dvb-usb-umt-010.ko dvb-usb-dibusb-mc.ko dvb-usb-dibusb-mb.ko\
- dvb-usb-dibusb-common.ko dvb-usb-gp8psk.ko dvb-usb-vp7045.ko \
- dvb-usb-dtt200u.ko dvb-usb-digitv.ko dvb-usb-cxusb.ko \
- dvb-usb.ko
-# video4linux cards
- rmmod cx88-alsa cx88-blackbird cx88-dvb cx88-vp3054-i2c cx8802 cx8800 \
- cx88xx saa7134-oss saa7134-alsa saa7134-empress saa7134-dvb \
- saa7134 dvb-bt8xx dst_ca dst bt878 bttv bt832 mxb \
- hexium_gemini hexium_orion em28xx pvrusb2 cpia2 vivi
-
-# frontends
- rmmod dib3000mb zl10353 dib3000mc dib3000_common nxt200x ves1x93 \
- sp8870 cx22700 stv0299 ves1820 cinergyT2 ttusbdecfe \
- tda1004x l64781 tda8083 cx24110 cx22702 stv0297 \
- tda10021 mt352 mt312 bcm3510 s5h1420 nxt6000 \
- stv0297_cs2 lgdt330x cx24123 sp887x or51211 or51132 \
- dvb-pll
-
-# chips and helpers
- rmmod saa7127 msp3400 tvp5150 tda7432 tda9840 tda9875 tea6415c tea6420 \
- saa6752hs saa6588 btcx-risc tveeprom tvaudio tda9887 tuner \
- ir-kbd-i2c ir-common cx25840 tvmixer cs53l32a wm8775 saa7115 \
- saa7146_vv saa7146 video-buf-dvb video-buf \
- v4l2-common v4l1-compat dvb-core videodev compat_ioctl32
-
- echo
- ;;
- reload)
- $0 unload && $0 load
- ;;
- *)
- echo "Usage$0 {load|unload|debug|reload}"
- exit 1
-esac
-
-sync
diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl
index a95e4512a..0d396c8f4 100755
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -14,6 +14,7 @@ sub add_bool($)
{
my $arg=shift;
+ exists $config{$arg} or die "Adding unknown boolean '$arg'";
$tristate{$arg}="bool";
# printf "Boolean:%s\n",$arg;
}
@@ -22,13 +23,17 @@ sub add_tristate($)
{
my $arg=shift;
+ exists $config{$arg} or die "Adding unknown tristate '$arg'";
$tristate{$arg}="tristate";
# printf "Tristate:%s\n",$arg;
}
sub add_int($)
{
- $intopt{$_[0]} = '0';
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown int '$arg'";
+ $intopt{$arg} = 0;
}
sub set_int_value($$)
@@ -36,6 +41,7 @@ sub set_int_value($$)
my $key = shift;
my $val = shift;
+ exists $intopt{$key} or die "Default for unknown int option '$key'";
$intopt{$key} = $val;
}
@@ -43,11 +49,22 @@ sub add_config($)
{
my $arg=shift;
- if ($arg =~ m/^([A-Z0-9_]+)/) {
+ if ($arg =~ m/^(\w+)/) {
+ # Have option default to 'on'
$config{$1} = 1;
+ } else {
+ die "Do not understand config variable '$arg'";
}
}
+# Turn option off, iff it already exists
+sub disable_config($)
+{
+ my $key = shift;
+
+ $config{$key} = 0 if (exists $config{$key});
+}
+
sub check_deps($)
{
my $arg=shift;
@@ -66,7 +83,7 @@ sub check_deps($)
sub open_kconfig($$) {
my ($dir,$file)=@_;
my $in = new FileHandle;
- my $skip=0;
+ my $disabled=0;
my $key;
#print "opening $file\n";
@@ -75,29 +92,64 @@ sub open_kconfig($$) {
# if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) {
# next;
# }
- if (m|^\s*source[\s\"]+([^\n\s\"]+)[\n\s\"]|) {
+
+ # start of a new stanza, reset
+ if (m/^\w/) {
+ $disabled = 0;
+ $default_seen = 0;
+ $key = undef;
+ }
+
+ if (m|^\s*source\s+"([^"]+)"\s*$| ||
+ m|^\s*source\s+(\S+)\s*$|) {
open_kconfig($dir,"$dir/$1");
next;
}
- if (m|^\s+depends on (.*)\n|) {
+ if (m|^\s+depends on\s+(.*)\n|) {
check_deps ($1);
}
- if (m|^\s+select (.*)\n|) {
+ if (m|^\s+select\s+(.*)\n|) {
check_deps ($1);
}
- if (m|^\s*bool\s+|) {
+ if (m|^\s+bool(ean)?\s|) {
add_bool($key);
}
- if (m|^\s*tristate\s+|) {
+ if (m|^\s+tristate\s|) {
add_tristate($key);
}
- if (m|^\s*int\s|) {
+ if (m|^\s+int\s|) {
+ add_int($key);
+ }
+ if (m|^\s+hex\s|) {
add_int($key);
}
- if (m|^\s*default "(\d+)"| && exists $intopt{$key}) {
+ # Get default for int options
+ if (m|^\s+default "(\d+)"| && exists $intopt{$key}) {
set_int_value($key, $1);
}
- if (m|^\s*config (.*)\n|) {
+ # Override default for disabled tri/bool options
+ if (m/^\s+default (y|n|m|"yes"|"no")\s+(if .*)?$/ &&
+ exists $tristate{$key} && $disabled) {
+ $default_seen = 1;
+ $_ = "\tdefault n\n";
+ }
+
+ # check for end of config definition for disabled drivers
+ # we need to make sure we've disabled it, and add a bit
+ # to the help text
+ if (m|^\s*(---)?help(---)?\s*$| && $disabled) {
+ print OUT "\tdefault n\n" unless($default_seen);
+ print OUT <<"EOF";
+ depends on VIDEO_KERNEL_VERSION
+ help
+ WARNING! This driver needs at least kernel $minver{$key}! It may not
+ compile or work correctly on your kernel, which is too old.
+
+EOF
+ next;
+ }
+
+ if (m|^\s*config (\w+)\s*$|) {
$key=$1;
add_config ($1);
@@ -110,27 +162,22 @@ sub open_kconfig($$) {
} else {
die "Minimum version for $key not found at versions.txt";
}
- if ( ($version < $minversion) |
- ($level < $minlevel) |
+ if ( ($version < $minversion) ||
+ ($level < $minlevel) ||
($sublevel < $minsublevel) ) {
- $skip=1;
- printf "$key requires version $minversion.$minlevel.$minsublevel\n";
-
- print OUT "# $key disabled due to incorrect version\nconfig $key\n\ttristate\n\tdefault n\n\n";
- next;
+ $disabled=1;
+ disable_config ($key);
+ print "$key requires version $minversion.$minlevel.$minsublevel\n";
+ print OUT "# $key disabled for insufficient kernel version\n";
} else {
-# printf "OK: $key requires version $minversion.$minlevel.$minsublevel\n";
- $skip=0;
+# print "OK: $key requires version $minversion.$minlevel.$minsublevel\n";
+ $disabled=0;
}
}
s/^main(menu\s\"[^\"]+)/\1 - DON'T CHANGE IT!/;
- if (m/^[\w]/) {
- $skip=0;
- }
- if (!$skip) {
- print OUT $_;
- }
+
+ print OUT $_;
}
close $in;
}
@@ -170,9 +217,31 @@ close IN;
printf "Preparing to compile for kernel version %d.%d.%d\n",$version,$level,$sublevel;
open OUT,">Kconfig";
-print OUT "mainmenu \"V4L/DVB menu\"\n";
-print OUT "source Kconfig.kern\n";
+print OUT <<"EOF";
+mainmenu "V4L/DVB menu"
+source Kconfig.kern
+config VIDEO_KERNEL_VERSION
+ bool "Enable drivers not supported by this kernel"
+ default n
+ ---help---
+ Normally drivers that require a kernel newer $version.$level.$sublevel,
+ the kernel you are compiling for now, will be disabled.
+
+ Turning this switch on will let you enabled them, but be warned
+ they may not work properly or even compile.
+
+ They may also work fine, and the only reason they are listed as
+ requiring a newer kernel is that no one has tested them with an
+ older one yet.
+
+ If the driver works, please post a report at V4L mailing list:
+ video4linux-list\@redhat.com.
+
+ Unless you know what you are doing, you should answer N.
+
+EOF
+
open_kconfig ("../linux","../linux/drivers/media/Kconfig");
close OUT;
@@ -183,26 +252,28 @@ while ( my ($key, $value) = each(%config) ) {
open OUT,">Kconfig.kern";
print OUT "config MODULES\n\tboolean\n\tdefault y\n\n";
-$tristate{"MODULES"}="bool";
+add_config('MODULES');
+add_bool('MODULES');
while ( my ($key, $value) = each(%depend) ) {
print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault m\n\n";
}
close OUT;
+# These options should default to off
+disable_config('DVB_AV7110_FIRMWARE');
+disable_config('DVB_CINERGYT2_TUNING');
+
+# Produce a .config file if it's forced or one doesn't already exist
if (($force_kconfig eq 1) || !open IN,".config") {
open OUT,">.config";
while ( my ($key,$value) = each(%tristate) ) {
-
- if ( ($key eq "DVB_AV7110_FIRMWARE") ||
- ($key eq "DVB_CINERGYT2_TUNING") ) {
- printf OUT "CONFIG_%s=n\n",$key;
- } else {
- if ($value eq "tristate") {
- printf OUT "CONFIG_%s=m\n",$key;
- } else {
- printf OUT "CONFIG_%s=y\n",$key;
- }
+ if (!$config{$key}) {
+ print OUT "CONFIG_$key=n\n";
+ } elsif ($value eq 'tristate') {
+ print OUT "CONFIG_$key=m\n";
+ } else { # must be 'bool'
+ print OUT "CONFIG_$key=y\n";
}
}
while ( my ($key,$value) = each(%intopt) ) {
diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl
index a81e157e2..cb3ea9627 100755
--- a/v4l/scripts/make_noconfig.pl
+++ b/v4l/scripts/make_noconfig.pl
@@ -1,57 +1,40 @@
#!/usr/bin/perl
-my $config = ();
+my %config = ();
+my %allconfig = ();
open IN,".config";
while (<IN>) {
- if (m/\s*([\d\w_]+)[=](.*)\n/) {
+ if (m/\s*(\w+)=\s*(\S*)/) {
#printf "%s=%s\n",$1,$2;
$config { $1 } = $2;
}
}
close IN;
-open IN,".version";
+# Build table of _all_ bool and tristate config variables
+open IN,"Kconfig";
while (<IN>) {
- if (m/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)\.(\d+)/) {
- $version=$1;
- $level=$2;
- $sublevel=$3;
- }
-}
-close IN;
-
-open IN,"versions.txt";
-while (<IN>) {
- if (m/\[(\d+)\.(\d+)\.(\d+)\]/) {
- $minversion=$1;
- $minlevel=$2;
- $minsublevel=$3;
- next;
- }
- s/\n//;
-
- if (m/DVB_AV7110_FIRMWARE_FILE/) {
- next;
- }
- if (m/^\s*([\w\d_]+)/) {
- if ( ($version < $minversion) |
- ($level < $minlevel) |
- ($sublevel < $minsublevel) ) {
- $config { "CONFIG_$1" } = 'n';
-#print "CONFIG_$1 version is not supported\n";
- next;
- }
- if (!($config { "CONFIG_$1" } ) ) {
-print "CONFIG_$1 is unset\n";
- $config { "CONFIG_$1" } = 'n';
- }
+ if (/^config\s+(\w+)\s*$/) {
+ $key = "CONFIG_$1";
+ } elsif (/^\s+bool(ean)?\s/) {
+ $allconfig{$key} = 'bool';
+ $key = 0;
+ } elsif (/^\s+tristate\s/) {
+ $allconfig{$key} = 'tristate';
+ $key = 0;
}
+ # else, must be int or string, ignore
}
close IN;
+exists $allconfig{0} and die "Unable to correctly parse Kconfig file";
+
+# Produce output for including in a Makefile
+# Explicitly set options that didn't appear in .config to n
open OUT,">.myconfig";
-while ( my ($key, $value) = each(%config) ) {
+while ( my ($key, $value) = each(%allconfig) ) {
+ $value = exists $config{$key} ? $config{$key} : 'n';
printf OUT "%-44s := %s\n",$key,$value;
}
close OUT;
diff --git a/v4l/scripts/rmmod.pl b/v4l/scripts/rmmod.pl
new file mode 100755
index 000000000..eb8f02d14
--- /dev/null
+++ b/v4l/scripts/rmmod.pl
@@ -0,0 +1,195 @@
+#!/usr/bin/perl
+use strict;
+use File::Find;
+
+my %depend = ();
+my %depend2 = ();
+my %rmlist = ();
+my @nodep;
+my @modlist;
+my @allmodules;
+my %reqmodules;
+my %loaded = ();
+my $i=0;
+
+# Device debug parameters
+# Module name Debug option
+my %debug = ( "tuner" => "tuner_debug=1",
+ "dvb-core" => "cam_debug=1",
+ "dvb-ttpci" => "debug=247",
+ "b2c2-flexcop" => "debug=0x01",
+ "b2c2-flexcop-usb" => "debug=0x01",
+ "b2c2-flexcop-pci" => "debug=0x01",
+ "dvb-usb" => "debug=0x33",
+ "dvb-usb-gp8psk" => "debug=0x03",
+ "dvb-usb-vp7045" => "debug=0x03",
+ "dvb-usb-dtt200u" => "debug=0x03",
+ "dvb-usb-dibusb-common" => "debug=0x03",
+ );
+
+
+sub parse_dir {
+ my $file = $File::Find::name;
+
+ if (!($file =~ /[.]ko$/)) {
+ return;
+ }
+
+ my $module = $file;
+ $module =~ s|^[./]*(.*)[.]ko|\1|;
+
+ open IN, "modinfo $file|grep depends|cut -b 17-|";
+ while (<IN>) {
+ my $deps = $_;
+ $deps =~ s/\n//;
+ $deps =~ s/[,]/ /g;
+ $deps = " $deps ";
+ $depend{$module} = $deps;
+ push @allmodules, $module;
+ $i++;
+ }
+ close IN;
+}
+
+sub parse_loaded {
+ open IN, "/proc/modules";
+ while (<IN>) {
+ m/^([\w\d_-]+)/;
+ $loaded{$1}=1;
+ }
+ close IN;
+}
+
+sub cleandep()
+{
+ my $dep;
+
+ while ( my ($k, $v) = each(%depend) ) {
+ my $arg=$v;
+ my $arg2=" ";
+ while (!($arg =~ m/^\s*$/)) {
+ if ($arg =~ m/^ ([^ ]+) /) {
+ my $val=$1;
+ if (exists($depend{$val})) {
+ $arg2="$arg2 $val ";
+ } else {
+ $reqmodules{$val}=1;
+ }
+ }
+ $arg =~ s/^ [^ ]+//;
+ $arg2 =~ s/\s\s+/ /;
+ }
+ $depend2 { $k } = $arg2;
+ }
+
+}
+
+sub rmdep()
+{
+ my $dep;
+
+ while ($dep=pop @nodep) {
+ while ( my ($k, $v) = each(%depend2) ) {
+ if ($v =~ m/\s($dep)\s/) {
+ $v =~ s/\s${dep}\s/ /;
+ $v =~ s/\s${dep}\s/ /;
+ $v =~ s/\s${dep}\s/ /;
+ $depend2 {$k} = $v;
+ }
+ }
+ }
+}
+
+sub orderdep ()
+{
+ my $old;
+ do {
+ $old=$i;
+ while ( my ($key, $value) = each(%depend2) ) {
+ if ($value =~ m/^\s*$/) {
+ push @nodep, $key;
+ push @modlist, $key;
+ $i=$i-1;
+ delete $depend2 {$key};
+ }
+ }
+ rmdep();
+ } until ($old==$i);
+ while ( my ($key, $value) = each(%depend2) ) {
+ printf "ERROR: bad dependencies - $key ($value)\n";
+ }
+}
+
+sub insmod ($)
+{
+ my $debug=shift;
+
+ while ( my ($key, $value) = each(%reqmodules) ) {
+ printf ("modprobe $key\n");
+ system ("modprobe $key");
+ }
+
+ foreach my $key (@modlist) {
+ if ($debug) {
+ my $dbg=$debug{$key};
+
+ printf "insmod ./$key.ko $dbg\n";
+ system "insmod ./$key.ko $dbg\n";
+ } else {
+ printf "insmod ./$key.ko\n";
+ system "insmod ./$key.ko\n";
+ }
+ }
+}
+
+sub rmmod ()
+{
+ my $cmd="rmmod";
+ while (my $key=pop @modlist) {
+ my $dep=$key;
+ $dep=~s/[\-]/_/g;
+ if (exists ($loaded{$dep})) {
+ printf "$cmd ./$key.ko\n";
+ system "$cmd ./$key.ko\n";
+ }
+ }
+}
+
+sub prepare_cmd()
+{
+ find(\&parse_dir, ".");
+ printf "found $i modules\n";
+
+ cleandep();
+ orderdep();
+}
+
+# main
+my $mode=shift;
+if ($mode eq "load") {
+ prepare_cmd;
+ insmod(0);
+} else {
+ if ($mode eq "unload") {
+ prepare_cmd;
+ parse_loaded;
+ rmmod;
+ } else {
+ if ($mode eq "reload") {
+ prepare_cmd;
+ parse_loaded;
+ my @modlist2=@modlist;
+ rmmod;
+ @modlist=@modlist2;
+ insmod(0);
+ } else {
+ if ($mode eq "debug") {
+ prepare_cmd;
+ parse_loaded;
+ insmod(1);
+ } else {
+ printf "Usage: $0 [load|unload|reload]\n";
+ }
+ }
+ }
+}