summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
Diffstat (limited to 'v4l')
-rw-r--r--v4l/.cvsignore7
-rw-r--r--v4l/Makefile268
-rw-r--r--v4l/Makefile.kernel46
-rw-r--r--v4l/compat.h69
-rwxr-xr-xv4l/scripts/gentree.pl93
-rwxr-xr-xv4l/scripts/hghead.pl41
-rwxr-xr-xv4l/scripts/insmod.sh305
-rwxr-xr-xv4l/scripts/make_kconfig.pl393
-rwxr-xr-xv4l/scripts/make_makefile.pl36
-rwxr-xr-xv4l/scripts/make_myconfig.pl58
-rwxr-xr-xv4l/scripts/make_noconfig.pl63
-rwxr-xr-xv4l/scripts/makelinks.sh10
-rwxr-xr-xv4l/scripts/prep_commit_msg.pl73
-rwxr-xr-xv4l/scripts/rmmod.pl194
-rwxr-xr-xv4l/scripts/strip-trailing-whitespaces.sh57
-rwxr-xr-xv4l/scripts/tuner.pl11
-rw-r--r--v4l/versions.txt21
17 files changed, 1084 insertions, 661 deletions
diff --git a/v4l/.cvsignore b/v4l/.cvsignore
deleted file mode 100644
index 88be5bcbc..000000000
--- a/v4l/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.ko
-*.o.flags
-*.mod.c
-.*.cmd
-.version
-.snapshot
-.tmp_versions
diff --git a/v4l/Makefile b/v4l/Makefile
index f24614634..663369674 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -3,9 +3,35 @@ obj = .
endif
#################################################
+# Version Check
+
+ifneq ($(KERNELRELEASE),)
+
+-include $(TOPDIR)/Rules.make
+
+else
+
+# take version info from last module build if available
+-include $(obj)/.version
+
+ifneq ($(SRCDIR),)
+KDIR := $(SRCDIR)
+else
+ifneq ($(KERNELRELEASE),)
+KDIR := /lib/modules/$(KERNELRELEASE)/build
+else
+KDIR := /lib/modules/$(shell uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("%s.%s.%s%s\n",$$1,$$2,$$3,$$4); };')/build
+
+endif
+endif
+
+endif
+
+#################################################
# default compilation rule
-default:: Makefile.media links .version
+default:: config-compat.h Makefile.media links .version
+ echo srcdir $(SRCDIR)
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
#################################################
@@ -18,15 +44,6 @@ default:: Makefile.media links .version
#################################################
# CFLAGS configuration
-# for DVB
-EXTRA_CFLAGS += -DDVB_CVS=1
-EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/dvb-core/
-EXTRA_CFLAGS += -I$(srctree)/drivers/media/dvb/frontends/
-
-ifeq ($(CONFIG_VIDEO_ADV_DEBUG),y)
- EXTRA_CFLAGS += -DCONFIG_VIDEO_ADV_DEBUG=1
-endif
-
ifeq ($(CONFIG_XC3028),m)
EXTRA_CFLAGS += -DCONFIG_XC3028=1
endif
@@ -35,47 +52,6 @@ ifeq ($(CONFIG_DVB_FIRESAT),m)
EXTRA_CFLAGS += -I$(srctree)/drivers/ieee1394/
endif
-ifeq ($(CONFIG_VIDEO_CX88_DVB),m)
- EXTRA_CFLAGS += -DCONFIG_VIDEO_CX88_DVB_MODULE=1
- EXTRA_CFLAGS += -DHAVE_CX22702=1
- EXTRA_CFLAGS += -DHAVE_OR51132=1
- EXTRA_CFLAGS += -DHAVE_LGDT330X=1
- EXTRA_CFLAGS += -DHAVE_MT352=1
- EXTRA_CFLAGS += -DHAVE_ZL10353=1
- EXTRA_CFLAGS += -DHAVE_NXT200X=1
- EXTRA_CFLAGS += -DHAVE_CX24123=1
- EXTRA_CFLAGS += -DHAVE_VP3054_I2C=1
-endif
-
-ifeq ($(CONFIG_VIDEO_SAA7134_DVB),m)
- EXTRA_CFLAGS += -DHAVE_MT352=1
- EXTRA_CFLAGS += -DHAVE_TDA1004X=1
- EXTRA_CFLAGS += -DHAVE_NXT200X=1
-endif
-
-ifeq ($(CONFIG_VIDEO_BUF_DVB),m)
- EXTRA_CFLAGS += -DHAVE_VIDEO_BUF_DVB=1
-endif
-
-ifeq ($(CONFIG_DVB_AV7110_OSD),y)
- EXTRA_CFLAGS += -DCONFIG_DVB_AV7110_OSD=1
-endif
-
-ifeq ($(CONFIG_DVB_AV7110_FIRMWARE),y)
- EXTRA_CFLAGS += -DCONFIG_DVB_AV7110_FIRMWARE_FILE
-endif
-
-# for pvrusb2
-ifeq ($(CONFIG_VIDEO_PVRUSB2_SYSFS),y)
- EXTRA_CFLAGS += -DCONFIG_VIDEO_PVRUSB2_SYSFS
-endif
-ifeq ($(CONFIG_VIDEO_PVRUSB2_DEBUGIFC),y)
- EXTRA_CFLAGS += -DCONFIG_VIDEO_PVRUSB2_DEBUGIFC
-endif
-ifeq ($(CONFIG_VIDEO_PVRUSB2_24XXX),y)
- EXTRA_CFLAGS += -DCONFIG_VIDEO_PVRUSB2_24XXX
-endif
-
EXTRA_CFLAGS += -g
EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL)
@@ -84,20 +60,18 @@ EXTRA_CFLAGS += $(if $(wildcard $(srctree)/.mm), -DMM_KERNEL)
# Kernel 2.4/2.6 specific rules
ifneq ($(KERNELRELEASE),)
+
ifeq ($(VERSION).$(PATCHLEVEL),2.6)
export-objs :=
list-multi :=
else
+include $(obj)/Makefile.kern24
+
multi-m := $(filter $(list-multi), $(obj-m))
int-m := $(sort $(foreach m, $(multi-m), $($(basename $(m))-objs)))
export-objs := $(filter $(int-m) $(obj-m),$(export-objs))
endif
-include $(obj)/Makefile.kern24
--include $(TOPDIR)/Rules.make
-else
-# take version info from last module build if available
--include $(obj)/.version
endif
#################################################
@@ -109,15 +83,14 @@ SNAPSHOT_CFLAGS := -DSNAPSHOT='$(shell cat $(snapshot))'
EXTRA_CFLAGS += $(SNAPSHOT_CFLAGS)
endif
-KDIR := /lib/modules/$(KERNELRELEASE)/build
PWD := $(shell pwd)
-DEST := /lib/modules/$(KERNELRELEASE)/$(MDIR)
+DEST := /lib/modules/$(KERNELRELEASE)/v4l2
KDIR26 := /lib/modules/$(KERNELRELEASE)/kernel/drivers/media
-KDIRUSB := /lib/modules/$(KERNELRELEASE)/kernel/drivers/usb/media
#################################################
# Compiler fixup rules
+HOSTCC:=$(CC)
CC += -I$(obj)
ifeq ($(VERSION).$(PATCHLEVEL),2.6)
@@ -156,17 +129,56 @@ export LC_ALL
all:: allmodconfig default
#################################################
-# Compiling preparation rules
+# installation invocation rules
+
+install:: media-install ivtv-install
-Makefile.media::
- scripts/make_makefile.pl
+remove rminstall:: media-rminstall ivtv-rminstall
-.version:
+#################################################
+# Compiling preparation rules
+
+.version::
ifneq ($(KERNELRELEASE),)
- echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version
+ @echo -e VERSION=$(VERSION)\\nPATCHLEVEL:=$(PATCHLEVEL)\\nSUBLEVEL:=$(SUBLEVEL)\\nKERNELRELEASE:=$(KERNELRELEASE) > $(obj)/.version
+ifneq ($(SRCDIR),)
+ @echo -e SRCDIR=$(SRCDIR)\\n >> $(obj)/.version
+endif
else
- echo "No version yet."
- uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version
+ @echo "No version yet."
+ @uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version
+endif
+
+Makefile.media:: .version
+ scripts/make_makefile.pl $(KDIR)
+
+release::
+ifneq ($(VER),)
+ @echo "Forcing compiling to version $(VER)."
+ @echo $(VER)|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version
+else
+ifneq ($(DIR),)
+ @echo "Seeking for a version at $(DIR)/Makefile."
+ @perl \
+ -e 'open IN,"$(DIR)/Makefile"; ' \
+ -e 'while (<IN>) {' \
+ -e ' if (/^VERSION\s*=\s*([0-9]+)/){ $$version=$$1; }' \
+ -e ' elsif (/^PATCHLEVEL\s*=\s*([0-9]+)/){ $$level=$$1; }' \
+ -e ' elsif (/^SUBLEVEL\s*=\s*([0-9]+)/){ $$sublevel=$$1; }' \
+ -e ' elsif (/^EXTRAVERSION\s*=\s*([^\s]+)\n/){ $$extra=$$1; }' \
+ -e '};' \
+ -e 'printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",' \
+ -e ' $$version,$$level,$$sublevel,$$version,$$level,$$sublevel,$$extra);' \
+ -e 'printf ("SRCDIR:=$(DIR)\n");' > $(obj)/.version
+ @cat .version|grep KERNELRELEASE:|sed s,'KERNELRELEASE:=','Forcing compiling to version ',
+
+ @if [ ! -f $(DIR)/scripts/kallsyms ]; then \
+ echo "*** Warning: You should configure and build kernel before compiling V4L"; \
+ fi
+else
+ @echo "No version specified. Using `uname -r`."
+ @uname -r|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version
+endif
endif
links::
@@ -174,13 +186,28 @@ links::
@find ../linux/drivers/media -name '*.[ch]' -type f -exec ln -sf '{}' . \;
@find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \;
+config-compat.h:: .myconfig
+ @perl \
+ -e 'print "#ifndef __CONFIG_COMPAT_H__\n";' \
+ -e 'print "#define __CONFIG_COMPAT_H__\n\n";' \
+ -e 'print "#include <linux/config.h>\n\n";' \
+ -e 'while(<>) {' \
+ -e ' next unless /^(\S+)\s*:= (\S+)$$/;' \
+ -e ' print "#undef $$1\n";' \
+ -e ' if($$2 eq "n") { next; }' \
+ -e ' elsif($$2 eq "m") { print "#define $$1_MODULE 1\n"; }' \
+ -e ' elsif($$2 eq "y") { print "#define $$1 1\n"; }' \
+ -e ' else { print "#define $$1 $$2\n"; }' \
+ -e '} print "\n#endif\n";' \
+ < .myconfig > config-compat.h
+
kernel-links makelinks::
cd ..; v4l/scripts/makelinks.sh $(KDIR)
#################################################
# Cardlist updating rule
-card cardlist cardlists:
+card cardlist cardlists::
scripts/cardlist
#################################################
@@ -190,68 +217,81 @@ clean::
@find . -name '*.c' -type l -exec rm '{}' \;
@find . -name '*.h' -type l -exec rm '{}' \;
-rm -f *~ *.o *.ko .*.o.cmd .*.ko.cmd *.mod.c av7110_firm.h fdump \
- ivtv-svnversion.h
+ ivtv-svnversion.h config-compat.h
distclean:: clean
-rm -f .version .*.o.flags .*.o.d Makefile.media \
- Kconfig Kconfig.kern .config .config.cmd
+ Kconfig Kconfig.kern .config .config.cmd .myconfig
-rm -rf .tmp_versions
+ -rm -f scripts/lxdialog scripts/kconfig
@find .. -name '*.orig' -exec rm '{}' \;
@find .. -name '*.rej' -exec rm '{}' \;
#################################################
# Kernel module insert/removal rules
-rmmodules::
- rmmod -w $(shell echo "$(v4l_modules)"|sed s,' ','\n',g|sed s,'-','_',g|sort|uniq -d)
+start insmod load::
+ scripts/rmmod.pl load
-insmod load::
- scripts/insmod.sh 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
-xconfig:: links .version
- ./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/qconf Kconfig
- ./scripts/make_noconfig.pl
-
-gconfig:: links .version
- ./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/gconf Kconfig
- ./scripts/make_noconfig.pl
-
-config:: links .version
- ./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/conf Kconfig
- ./scripts/make_noconfig.pl
-
-menuconfig:: links .version
- ./scripts/make_kconfig.pl
- -rm scripts/lxdialog scripts/kconfig
- -if [ -d $(KDIR)/scripts/lxdialog ]; then \
- ln -s $(KDIR)/scripts/lxdialog scripts/lxdialog; \
- fi
+# Kernel config programs
+QCONF := $(KDIR)/scripts/kconfig/qconf
+GCONF := $(KDIR)/scripts/kconfig/gconf
+MCONF := $(KDIR)/scripts/kconfig/mconf
+CONF := $(KDIR)/scripts/kconfig/conf
- -if [ -d $(KDIR)/scripts/kconfig ]; then \
- ln -s $(KDIR)/scripts/kconfig scripts/kconfig; \
- fi
+# lxdialog can be in either scripts/lxdialog or scripts/kconfig/lxdialog
+LXDIALOG_DIR := $(shell if [ -d $(KDIR)/scripts/kconfig/lxdialog ]; then echo kconfig/ ; fi)
+LXDIALOG_LNK := $(if $(LXDIALOG_DIR),scripts/kconfig,scripts/lxdialog)
+LXDIALOG := $(KDIR)/scripts/$(LXDIALOG_DIR)lxdialog/lxdialog
+
+.myconfig : .config
+ ./scripts/make_myconfig.pl
+
+xconfig:: links .version $(QCONF)
+ ./scripts/make_kconfig.pl $(KDIR)
+ $(QCONF) Kconfig
- $(KDIR)/scripts/kconfig/mconf Kconfig
- ./scripts/make_noconfig.pl
+gconfig:: links .version $(GCONF)
+ ./scripts/make_kconfig.pl $(KDIR)
+ $(QCONF) Kconfig
-allmodconfig:: links .version
- ./scripts/make_kconfig.pl
- $(KDIR)/scripts/kconfig/conf -m Kconfig
- cat .config|grep -v CONFIG_DVB_AV7110_FIRMWARE >.config.new
- mv .config.new .config
- ./scripts/make_noconfig.pl
+config:: links .version $(CONF)
+ ./scripts/make_kconfig.pl $(KDIR)
+ $(CONF) Kconfig
+
+menuconfig:: links .version $(MCONF) lxdialog
+ ./scripts/make_kconfig.pl $(KDIR)
+ $(MCONF) Kconfig
+
+allyesconfig allmodconfig:: links .version
+ ./scripts/make_kconfig.pl $(KDIR) 1
+
+# rule to build kernel conf programs
+KMAKEVARS := config-targets=1 mixed-targets=0 dot-config=0
+$(QCONF) $(GCONF) $(MCONF) $(CONF):
+ $(MAKE) -C $(KDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(notdir $@)
+
+# lxdialog has two parts, a symlink and the actual binary
+.PHONY: lxdialog
+lxdialog: $(LXDIALOG) $(LXDIALOG_LNK)
+
+$(LXDIALOG_LNK):
+ ln -snf $(KDIR)/$(LXDIALOG_LNK) $(LXDIALOG_LNK)
+
+$(LXDIALOG):
+ $(MAKE) -C $(KDIR) -f $(PWD)/Makefile.kernel $(KMAKEVARS) v4l-$(LXDIALOG)
#################################################
# IVTV link rules
@@ -297,9 +337,6 @@ old-install:: rminstall
#################################################
# Tree management rules
-change changes changelog::
- make -C .. changelog
-
update::
make -C .. update
@@ -310,6 +347,11 @@ push::
make -C .. push
#################################################
+# Help
+help::
+ @cat ../INSTALL
+
+#################################################
# build tarballs rules
RPWD := $(shell cd .. && pwd)
@@ -321,7 +363,7 @@ tardest ?= .
snapdir := $(HOME)/snapshot
snap := $(name)
-snapshot snap tarball: update distclean
+snapshot snap tarball:: update distclean
echo $(thisdir)
echo $(name)
echo $(date) > .snapshot
diff --git a/v4l/Makefile.kernel b/v4l/Makefile.kernel
new file mode 100644
index 000000000..bbcfdc6d3
--- /dev/null
+++ b/v4l/Makefile.kernel
@@ -0,0 +1,46 @@
+# This Makefile is used to build sources that are part of the kernel tree.
+# What we want are the various programs used by the kconfig system. We can't
+# just directly call the top-level kernel Makefile, as it doesn't provide
+# targets to only build the kconfig system. It provides targets to build
+# the kconfig system *and then configure the kernel*.
+
+# What we do is include the top-level kernel Makefile here, to get all the
+# variables and rules it defines, and then add our own targets to just build
+# the kconfig system. You can think of this file as a modified version of the
+# top-level kernel Makefile that has "kconfig build only" targets added to it.
+# Each of these new targets has the prefix v4l- so it doesn't conflict with
+# any targets in the kernel Makefile.
+
+# Like the kernel Makefile, this Makefile should have the cwd be the root
+# of the kernel source.
+
+# These should be defined on the command line, to override the kernel Makefile
+# config-targets := 1
+# mixed-targets := 0
+# dot-config := 0
+
+include Makefile
+
+# Used by the config target
+v4l-conf: scripts_basic
+ $(MAKE) $(build)=scripts/kconfig scripts/kconfig/conf
+
+# Used by the xconfig target
+v4l-qconf: scripts_basic
+ $(MAKE) $(build)=scripts/kconfig qconf-target=1 scripts/kconfig/qconf
+
+# Used by the qconfig target
+v4l-gconf: scripts_basic
+ $(MAKE) $(build)=scripts/kconfig gconf-target=1 scripts/kconfig/gconf
+
+# Used by the menuconfig target, also needs lxdialog
+v4l-mconf: scripts_basic
+ $(MAKE) $(build)=scripts/kconfig scripts/kconfig/mconf
+
+# Rule used for kernel where lxdialog is in directory scripts/lxdialog
+v4l-%/scripts/lxdialog/lxdialog: scripts_basic
+ $(MAKE) $(build)=scripts/lxdialog
+
+# Rule used for kernel where lxdialog is in directory scripts/kconfig/lxdialog
+v4l-%/scripts/kconfig/lxdialog/lxdialog: scripts_basic
+ $(MAKE) $(build)=scripts/kconfig/lxdialog
diff --git a/v4l/compat.h b/v4l/compat.h
index 9efcfebd1..ae34380e0 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -10,6 +10,7 @@
#include <linux/version.h>
#include <linux/utsname.h>
#include <linux/sched.h>
+#include "config-compat.h"
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,18)
# define minor(x) MINOR(x)
@@ -87,24 +88,24 @@
static inline unsigned long msecs_to_jiffies(const unsigned int m)
{
#if HZ <= 1000 && !(1000 % HZ)
- return (m + (1000 / HZ) - 1) / (1000 / HZ);
+ return (m + (1000 / HZ) - 1) / (1000 / HZ);
#else
#if HZ > 1000 && !(HZ % 1000)
- return m * (HZ / 1000);
+ return m * (HZ / 1000);
#else
- return (m * HZ + 999) / 1000;
+ return (m * HZ + 999) / 1000;
#endif
#endif
}
static inline unsigned int jiffies_to_msecs(const unsigned long j)
{
#if HZ <= 1000 && !(1000 % HZ)
- return (1000 / HZ) * j;
+ return (1000 / HZ) * j;
#else
#if HZ > 1000 && !(HZ % 1000)
- return (j + (HZ / 1000) - 1)/(HZ / 1000);
+ return (j + (HZ / 1000) - 1)/(HZ / 1000);
#else
- return (j * 1000) / HZ;
+ return (j * 1000) / HZ;
#endif
#endif
}
@@ -131,31 +132,18 @@ static inline unsigned long msleep_interruptible(unsigned int msecs)
}
#endif
-#ifndef DVB_CVS
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
-#undef HAVE_LGDT330X
-#undef HAVE_TDA1004X
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15)
-#undef HAVE_NXT200X
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
-#undef HAVE_CX24123
-#endif
-#endif
-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
/* some keys from 2.6.x which are not (yet?) in 2.4.x */
# define KEY_PLAY 207
-# define KEY_PRINT 210
+# define KEY_PRINT 210
# define KEY_EMAIL 215
# define KEY_SEARCH 217
-# define KEY_SELECT 0x161
+# define KEY_SELECT 0x161
# define KEY_GOTO 0x162
# define KEY_INFO 0x166
# define KEY_CHANNEL 0x16b
# define KEY_LANGUAGE 0x170
-# define KEY_SUBTITLE 0x172
+# define KEY_SUBTITLE 0x172
# define KEY_ZOOM 0x174
# define KEY_MODE 0x175
# define KEY_TV 0x179
@@ -171,7 +159,7 @@ static inline unsigned long msleep_interruptible(unsigned int msecs)
# define KEY_BLUE 0x191
# define KEY_CHANNELUP 0x192
# define KEY_CHANNELDOWN 0x193
-# define KEY_RESTART 0x198
+# define KEY_RESTART 0x198
# define KEY_SHUFFLE 0x19a
# define KEY_NEXT 0x197
# define KEY_RADIO 0x181
@@ -190,11 +178,18 @@ static inline unsigned long msleep_interruptible(unsigned int msecs)
# define KEY_OK 0x160
# define KEY_DIGITS 0x19d
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+# define KEY_SEND 231
+# define KEY_REPLY 232
+# define KEY_FORWARDMAIL 233
+# define KEY_SAVE 234
+# define KEY_DOCUMENTS 235
+#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
@@ -212,12 +207,12 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
do { \
DEFINE_WAIT(__wait); \
for (;;) { \
- prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \
- if (condition) \
- break; \
- __ret = schedule_timeout(__ret); \
- if (!__ret) \
- break; \
+ prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ __ret = schedule_timeout(__ret); \
+ if (!__ret) \
+ break; \
} \
finish_wait(&wq, &__wait); \
} while (0); \
@@ -236,9 +231,9 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
void * __ret = NULL; \
__ret = kmalloc(n * size, flags); \
if (__ret) \
- memset(__ret, 0, n * size); \
+ memset(__ret, 0, n * size); \
__ret; \
-})
+})
#endif
#endif
@@ -246,10 +241,10 @@ static inline unsigned long vmalloc_to_pfn(void * vmalloc_addr)
#ifndef kzalloc
#define kzalloc(size, flags) \
({ \
- void *__ret = kmalloc(size, flags); \
- if (__ret) \
- memset(__ret, 0, size); \
- __ret; \
+ void *__ret = kmalloc(size, flags); \
+ if (__ret) \
+ memset(__ret, 0, size); \
+ __ret; \
})
#endif
#endif
diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl
index 0ae296b93..e58d410c2 100755
--- a/v4l/scripts/gentree.pl
+++ b/v4l/scripts/gentree.pl
@@ -2,12 +2,10 @@
use strict;
use File::Find;
use Fcntl ':mode';
-use Cwd;
my $VER = shift;
my $SRC = shift;
my $DESTDIR = shift;
-my $cwd;
my $extra;
@@ -70,9 +68,9 @@ sub filter_source ($$) {
if ($line =~ m/^#include \"compat.h\"/) {
next;
}
- if ($line =~ m/[\$]Id:/) {
- next;
- }
+# if ($line =~ m/[\$]Id:/) {
+# next;
+# }
if ($line =~ /^#ifdef MM_KERNEL/) {
chomp($line);
$state{$level} = "if";
@@ -81,8 +79,20 @@ sub filter_source ($$) {
$level++;
next;
}
- if ($line =~ /^\s*#if 0\s.*[Kk][Ee][Ee][Pp].*/) {
- print OUT "#if 0\n";
+ if ($line =~ /^#ifdef _COMPAT_H/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 0;
+ print STDERR "/* BP #if MM_KERNEL state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
+ if ($line =~ m|^\s*\#if\s+0\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) {
+ if ($1 eq ";") {
+ print OUT "#if 0\n";
+ } else {
+ print OUT "#if 0$1\n";
+ }
chomp($line);
$state{$level} = "ifother";
$if{$level} = 0;
@@ -90,6 +100,30 @@ sub filter_source ($$) {
$level++;
next;
}
+ if ($line =~ /^#ifdef\sSTV0297_CS2/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 0;
+ print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
+ if ($line =~ /^#ifndef\sBROKEN_XAWTV/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 1;
+ print STDERR "/* BP #if 0 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
+ if ($line =~ /^#ifndef\sSTV0297_CS2/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 1;
+ print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
if ($line =~ /^#if 0/) {
chomp($line);
$state{$level} = "if";
@@ -98,8 +132,8 @@ sub filter_source ($$) {
$level++;
next;
}
- if ($line =~ /^#if 1\s.*[Kk][Ee][Ee][Pp].*/) {
- print OUT "#if 1\n";
+ if ($line =~ m|^\s*\#if\s+1\s*\/[\*]\s*[Kk][Ee].[Pp]\s*[\*]\/(.*)|) {
+ print OUT "#if 1$1\n";
$state{$level} = "ifother";
$if{$level} = 1;
print STDERR "/* BP #if 1 (keep) state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
@@ -122,6 +156,14 @@ sub filter_source ($$) {
$level++;
next;
}
+ if ($line =~ /^#if.*CONFIG_XC3028/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 0;
+ print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
if ($line =~ /^#if.*I2C_CLASS_TV_ANALOG/) {
chomp($line);
$state{$level} = "if";
@@ -138,7 +180,15 @@ sub filter_source ($$) {
$level++;
next;
}
- if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) {
+ if ($line =~ /^#ifndef.\s*I2C_PEC/) {
+ chomp($line);
+ $state{$level} = "if";
+ $if{$level} = 0;
+ print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
+ $level++;
+ next;
+ }
+ if ($line =~ /^#ifdef.\s*I2C_PEC/) {
chomp($line);
$state{$level} = "if";
$if{$level} = 1;
@@ -146,14 +196,14 @@ sub filter_source ($$) {
$level++;
next;
}
- if ($line =~ /^#if.*CONFIG_XC3028/) {
+ if ($line =~ /^#if.*I2C_CLASS_TV_DIGITAL/) {
chomp($line);
$state{$level} = "if";
- $if{$level} = 0;
- print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level$
+ $if{$level} = 1;
+ print STDERR "/* BP #if 1 state=$state{$level} if=$if{$level} level=$level ($line) */\n" if $DEBUG;
$level++;
next;
- }
+ }
if ($line =~ /^#if.*BTTV_VERSION_CODE/) {
chomp($line);
$line =~ s@^#if\s*@@;
@@ -280,9 +330,7 @@ sub parse_dir {
return;
}
- my $mode = (lstat("$cwd/$file"))[2];
-
-# printf "Permissions of %s/%s are %04o (dir=%s\n", $cwd,$file, $mode, cwd;
+ my $mode = (lstat("$file"))[2];
if ($mode & S_IFDIR) {
return;
@@ -291,14 +339,14 @@ sub parse_dir {
$srcdir =~ s/(.)/\[$1\]/g;
my $f2 = $file;
- $f2 =~ s,^$srcdir,$cwd/$DESTDIR/,;
+ $f2 =~ s,^$srcdir,$DESTDIR/,;
print "from $file to $f2\n";
my $tmp = "/tmp/src.$$";
if ($file =~ m/.*\.[ch]$/) {
- filter_source("$cwd/$file","$tmp");
+ filter_source("$file","$tmp");
} else {
- system("cp $cwd/$file $tmp");
+ system("cp $file $tmp");
}
my $dir = $f2;
@@ -315,12 +363,11 @@ sub parse_dir {
my $patchtmploc = "/tmp/temp.patch";
-printf STDERR <<EOF,$VER,$CODE;
+printf <<EOF,$VER,$CODE;
kernel is %s (0x%x)
EOF
-print STDERR "finding files at $SRC\n";
+print "finding files at $SRC\n";
-$cwd=cwd;
find(\&parse_dir, $SRC);
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl
index ddaef0767..fdc9720c6 100755
--- a/v4l/scripts/hghead.pl
+++ b/v4l/scripts/hghead.pl
@@ -8,10 +8,11 @@ use Date::Parse;
my $in = shift;
my $line;
my $subject;
-my $from=0;
my $sub_ok=0;
my $init=0;
my $num=0;
+my $hgimport=0;
+my $mmimport=0;
my $maint_ok=0;
my $noblank=1;
my $maintainer_name=$ENV{CHANGE_LOG_NAME};
@@ -33,6 +34,10 @@ while ($line = <IN>) {
if ($line =~ m/^\-\-\- .*/) {
last;
}
+ if ($line =~ m/^\-\-\-\-.*/) {
+ $body="";
+ next;
+ }
if ($line =~ m/^\-\-\-.*/) {
last;
}
@@ -62,7 +67,11 @@ while ($line = <IN>) {
$from= "From: $fromname\n";
next;
}
- print "Bad: author line have a wrong syntax\n";
+ if ($line =~ m/^From:\sakpm\@osdl.org/) {
+ $mmimport=1;
+ next;
+ }
+ print "Bad: author line have a wrong syntax: $line\n";
die;
}
@@ -87,6 +96,21 @@ while ($line = <IN>) {
$signed="$signed$line";
next;
}
+ if ( ($line =~ m/^\# HG changeset patch/) ||
+ ($line =~ m/^has been added to the -mm tree. Its filename is/) ) {
+ $sub_ok=0;
+ $init=0;
+ $num=0;
+ $maint_ok=0;
+ $noblank=1;
+ $from="";
+ $body="";
+ $subject="";
+ $hgimport=1;
+ next;
+ }
+
+
if ($line =~ m/^Acked-by:.*/) {
$signed="$signed$line";
next;
@@ -96,7 +120,7 @@ while ($line = <IN>) {
if ($line =~ m/Changeset:\s*(.*)\n/) {
$num=$1;
}
- print "# $line";
+# print "# $line";
next;
}
@@ -105,12 +129,19 @@ while ($line = <IN>) {
$line="\n";
}
+ if ($line =~ m/^#/) {
+ next;
+ }
if ($sub_ok == 0) {
$sub_ok=1;
substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1));
if ($subject =~ m|V4L\/DVB\s*(.+)|) {
$subject=$1;
}
+ if ($hgimport) {
+ $subject=$line;
+ next;
+ }
if ($line =~ m/^\n/) {
next;
}
@@ -143,8 +174,8 @@ if (!$signed =~ m/$from/) {
die;
}
-$body=~s/\n+$//;
-$body=~s/^\n+$//;
+$body=~s/[\n\s]+$//;
+$body=~s/^[\n\s]+//;
# First from is used by hg to recognize commiter name
print "#Committer: $maintainer_name <$maintainer_email>\n";
diff --git a/v4l/scripts/insmod.sh b/v4l/scripts/insmod.sh
deleted file mode 100755
index 6efab6a82..000000000
--- a/v4l/scripts/insmod.sh
+++ /dev/null
@@ -1,305 +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-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-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-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 b1d6f5d53..d5b34b36c 100755
--- a/v4l/scripts/make_kconfig.pl
+++ b/v4l/scripts/make_kconfig.pl
@@ -4,20 +4,156 @@ use FileHandle;
my %depend = ();
my %minver = ();
my %config = ();
+my %intopt = ();
+my %hexopt = ();
+my %tristate = ();
+my %kernopts = ();
+my %depmods = ();
my $version, $level, $sublevel;
+my $kernel=shift;
+my $force_kconfig=shift;
+
+#!/usr/bin/perl
+use FileHandle;
+
+###########################################################
+# Checks config.h and autoconf.h for current kernel defines
+sub process_config ($)
+{
+ my $filename = shift;
+ my $in = new FileHandle;
+
+ open $in,"$kernel/include/$filename" or die "File not found: $kernel/include/$filename";
+ while (<$in>) {
+ if (m|\#include\s+\<(.*)\>|) {
+ process_config ($1);
+ next;
+ }
+ if (m/\#define\s+CONFIG_([^ ]*)_ON_SMP\s+(.*)\n/) {
+ my $key=$1;
+ my $value=$2;
+# printf "defined $key as $value\n";
+ if ( $value == 1 ) {
+ $value='y';
+ }
+ $kernopts{$key}=$value;
+ next;
+ }
+ if (m/\#define\s+CONFIG_([^ ]*)_MODULE\s+(.*)\n/) {
+ my $key=$1;
+ my $value=$2;
+# printf "defined $key as $value\n";
+ if ( $value == 1 ) {
+ $value='m';
+ }
+ $kernopts{$key}=$value;
+ next;
+ }
+ if (m/\#define\s+CONFIG_([^ ]*)\s+(.*)\n/) {
+ my $key=$1;
+ my $value=$2;
+# printf "defined $key as $value\n";
+ if ( $value == 1 ) {
+ $value='y';
+ }
+ $kernopts{$key}=$value;
+ next;
+ }
+ if (m/\#undef\s+CONFIG_([^ ]*)\n/) {
+# printf "undefined $1\n";
+ $kernopts{$1}='n';
+ next;
+ }
+ }
+
+ close $in;
+}
+
+sub add_bool($)
+{
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown boolean '$arg'";
+ $tristate{$arg}="bool";
+# printf "Boolean:%s\n",$arg;
+
+ $kernopts{$arg}='y';
+}
+
+sub add_tristate($)
+{
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown tristate '$arg'";
+ $tristate{$arg}="tristate";
+
+ $kernopts{$arg}='m';
+}
+
+sub add_int($)
+{
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown int '$arg'";
+ $intopt{$arg} = 0;
+}
+
+sub add_hex($)
+{
+ my $arg=shift;
+
+ exists $config{$arg} or die "Adding unknown hex '$arg'";
+ $hexopt{$arg} = 0;
+}
+
+sub set_int_value($$)
+{
+ my $key = shift;
+ my $val = shift;
+
+ exists $intopt{$key} or die "Default for unknown int option '$key'";
+ $intopt{$key} = $val;
+}
+
+sub set_hex_value($$)
+{
+ my $key = shift;
+ my $val = shift;
+
+ exists $hexopt{$key} or die "Default for unknown hex option '$key'";
+ $hexopt{$key} = "0x".$val;
+}
+
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'";
}
}
-sub check_deps($)
+########################################
+# Turn option off, iff it already exists
+sub disable_config($)
{
+ my $key = shift;
+
+ $config{$key} = 0 if (exists $config{$key});
+}
+
+#################################################################
+# Make a list of dependencies and the number of references for it
+sub check_deps($$)
+{
+ my $key=shift;
my $arg=shift;
+
+ $depmods{$key}=$arg;
$arg=$arg." ";
while ($arg ne "") {
@@ -28,32 +164,122 @@ sub check_deps($)
}
$arg =~ s/^[^ ]+ //;
}
+
+ return $ok;
+}
+
+######################################################
+# Checks if all dependencies for the key are satisfied
+sub deps_ok($)
+{
+ my $key=shift;
+ my $arg=$depmods{$key};
+ my $ok=1;
+
+ if ($arg eq "") {
+ return $ok;
+ }
+
+ $arg=$arg." ";
+
+
+# printf "$key: deps are '$arg'\n";
+
+ while ($arg ne "") {
+ if ($arg =~ m/^([A-Z0-9_]+) /) {
+ if ((! exists $kernopts {$1}) || ($kernopts {$1} eq 'n')) {
+ printf "$key: Required kernel opt '$1' is not present\n";
+ $ok=0;
+ }
+ }
+ if ($arg =~ m/^\!([A-Z0-9_]+) /) {
+ if ($kernopts {$1} eq 'y') {
+ printf "$key: Driver is incompatible with '$1'\n";
+ $ok=0;
+ }
+ }
+ $arg =~ s/^[^ ]+ //;
+ }
+
+ return $ok;
}
sub open_kconfig($$) {
my ($dir,$file)=@_;
my $in = new FileHandle;
- my $skip=0;
+ my $disabled=0;
+ my $key;
#print "opening $file\n";
- open $in,"$file";
+ open $in,"$file" or die "File not found: $file";
while (<$in>) {
# 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|) {
- check_deps ($1);
+ if (m|^\s+depends on\s+(.*)\n|) {
+ check_deps ($key,$1);
}
- if (m|^\s+select (.*)\n|) {
- check_deps ($1);
+ if (m|^\s+select\s+(.*)\n|) {
+ check_deps ($key,$1);
+ }
+ if (m|^\s+bool(ean)?\s|) {
+ add_bool($key);
+ }
+ if (m|^\s+tristate\s|) {
+ add_tristate($key);
+ }
+ if (m|^\s+int\s|) {
+ add_int($key);
+ }
+ if (m|^\s+hex\s|) {
+ add_hex($key);
+ }
+ # Get default for int options
+ if (m|^\s+default "(\d+)"| && exists $intopt{$key}) {
+ set_int_value($key, $1);
+ }
+ # Get default for hex options
+ if (m|^\s+default "(0x)?([[:xdigit:]]+)"| && exists $hexopt{$key}) {
+ set_hex_value($key, $2);
+ }
+ # 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) {
+ if(exists $tristate{$key} && !$default_seen) {
+ print OUT "\tdefault n\n";
+ }
+ 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 (.*)\n|) {
- my $key=$1;
+ if (m|^\s*config (\w+)\s*$|) {
+ $key=$1;
add_config ($1);
my $min=$minver { $key };
@@ -65,27 +291,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;
}
@@ -95,7 +316,7 @@ sub parse_versions ()
my $in = new FileHandle;
my $ver;
- open $in,"versions.txt";
+ open $in,"versions.txt" or die "File not found: versions.txt";
while (<$in>) {
if (m/\[([\d.]*)\]/) {
$ver=$1;
@@ -110,9 +331,11 @@ sub parse_versions ()
close $in;
}
+process_config("linux/config.h");
+
parse_versions;
-open IN,".version";
+open IN,".version" or die "File not found: .version";
while (<IN>) {
if (m/KERNELRELEASE\s*[:]*[=]+\s*(\d+)\.(\d+)\.(\d+)/) {
$version=$1;
@@ -124,24 +347,126 @@ 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";
+open OUT,">Kconfig" or die "Cannot write Kconfig file";
-print OUT "source Kconfig.kern\n";
-open_kconfig ("../linux","../linux/drivers/media/Kconfig");
+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;
while ( my ($key, $value) = each(%config) ) {
delete $depend{$key};
}
-open OUT,">Kconfig.kern";
+open OUT,">Kconfig.kern" or die "Cannot write Kconfig.kern file";
print OUT "config MODULES\n\tboolean\n\tdefault y\n\n";
+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";
+ if ($kernopts{$key}) {
+ print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault ".
+ $kernopts{$key}."\n\n";
+ } else {
+ print OUT "# $key with $value refs\nconfig $key\n\ttristate\n\tdefault n #not found\n\n";
+ }
}
close OUT;
+# These options should default to off
+disable_config('DVB_AV7110_FIRMWARE');
+disable_config('DVB_CINERGYT2_TUNING');
+
+# Hack for check sound/oss/aci.h header
+
+my $mirodep="$kernel/sound/oss/aci.h";
+if (!open IN, $mirodep) {
+ my $key="RADIO_MIROPCM20";
+print <<"EOF2";
+$key: $mirodep is missing.
+
+***WARNING:*** You do not have the full kernel sources installed.
+This does not prevent you from building the v4l-dvb tree if you have the
+kernel headers, but the full kernel source is required in order to use
+make menuconfig / xconfig / qconfig.
+
+If you are experiencing problems building the v4l-dvb tree, please try
+building against a vanilla kernel before reporting a bug.
+
+Vanilla kernels are available at http://kernel.org.
+On most distros, this will compile a newly downloaded kernel:
+
+cp /boot/config-`uname -r` <your kernel dir>/.config
+cd <your kernel dir>
+make all modules_install install
+
+Please see your distro's web site for instructions to build a new kernel.
+
+EOF2
+ $kernopts{$key}='n';
+}
+close IN;
+
+# Recursively check for broken dependencies
+my $i;
+do {
+ $i=0;
+ while ( my ($key,$value) = each(%kernopts) ) {
+ if ($value ne 'n') {
+ if (!deps_ok($key)) {
+ $kernopts{$key}='n';
+ }
+ $i=$i+1;
+ }
+ }
+} until (!$disable);
+
+# 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" or die "Cannot write .config file";
+ while ( my ($key,$value) = each(%tristate) ) {
+ if (!$config{$key}) {
+ print OUT "# CONFIG_$key is not set\n";
+ } elsif ($kernopts{$key}) {
+ if ($kernopts{$key} eq 'n') {
+ print OUT "# CONFIG_$key is not set\n";
+ } else {
+ print OUT "CONFIG_$key=".$kernopts{$key}."\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) ) {
+ print OUT "CONFIG_$key=$value\n";
+ }
+ while ( my ($key,$value) = each(%hexopt) ) {
+ print OUT "CONFIG_$key=$value\n";
+ }
+ close OUT;
+}
diff --git a/v4l/scripts/make_makefile.pl b/v4l/scripts/make_makefile.pl
index 8371f6a4a..e0a099e9b 100755
--- a/v4l/scripts/make_makefile.pl
+++ b/v4l/scripts/make_makefile.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
use FileHandle;
+my $kernel=shift;
my $instdir = ();
sub check_line($$$)
@@ -109,12 +110,13 @@ sub open_makefile($) {
close $in;
}
-open OUT,">Makefile.media";
+open OUT,">Makefile.media.new";
open_makefile ("../linux/drivers/media/Makefile");
# Creating Install rule
-printf OUT "install::\n";
-#printf OUT "\t@strip --strip-debug \$(inst-m)\n\n";
+printf OUT "media-install::\n";
+printf OUT "\t\@echo \"Stripping debug info from files:\"\n";
+printf OUT "\t\@strip --strip-debug \$(inst-m)\n\n";
while ( my ($key, $value) = each(%instdir) ) {
printf OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$key files:\"\n";
@@ -127,7 +129,7 @@ while ( my ($key, $value) = each(%instdir) ) {
printf OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n";
# Creating Remove rule
-printf OUT "remove rminstall::\n";
+printf OUT "media-rminstall::\n";
printf OUT "\t\@echo -e \"\\nRemoving old \$(DEST) files\\n\"\n";
while ( my ($key, $value) = each(%instdir) ) {
@@ -155,10 +157,30 @@ while ( my ($key, $value) = each(%depend) ) {
}
close OUT;
-if (open OUT,".myconfig") {
+if (open IN,"Makefile.media") {
close IN;
+ my $changed=0;
+ if (open IN,"diff Makefile.media Makefile.media.new|") {
+ while (<IN>) {
+ if ($_ ne "") {
+ $changed=1;
+ }
+ }
+ close IN;
+ if ($changed) {
+ printf("One or more linux Makefiles had changed. Makefile.media rewrited.\n");
+ system ("mv Makefile.media.new Makefile.media");
+ } else {
+ system ("rm Makefile.media.new");
+ }
+ }
} else {
- system "make allmodconfig";
+ printf("Creating Makefile.media.\n");
+ system "mv Makefile.media.new Makefile.media";
}
-
+if (open IN,".myconfig") {
+ close IN;
+} else {
+ system "./scripts/make_kconfig.pl $kernel 1";
+}
diff --git a/v4l/scripts/make_myconfig.pl b/v4l/scripts/make_myconfig.pl
new file mode 100755
index 000000000..0bde6f6c0
--- /dev/null
+++ b/v4l/scripts/make_myconfig.pl
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+# The purpose of this script is to produce a file named '.myconfig', in
+# the same style as the '.config' file. Except .myconfig has disabled
+# options explicitly set to 'n' rather than just omitted. This is to
+# make sure they override any corresponding options that may be turned on
+# in the Kernel's config files.
+# The .myconfig file is what will be included in the v4l-dvb Makefile
+# to control which drivers are built.
+
+my %config = ();
+my %allconfig = ();
+
+open IN,".config";
+while (<IN>) {
+ if (m/\s*(\w+)=\s*(\S*)/) {
+#printf "%s=%s\n",$1,$2;
+ $config { $1 } = $2;
+ }
+}
+close IN;
+
+# Build table of _all_ bool and tristate config variables
+my $key = 0;
+open IN,"Kconfig";
+while (<IN>) {
+ if (/^config\s+(\w+)\s*$/) {
+ $key == 0 or die "Couldn't find type of config '$key'";
+ $key = "CONFIG_$1";
+ } elsif (/^\s+bool(ean)?\s/) {
+ $allconfig{$key} = 'bool';
+ $key = 0;
+ } elsif (/^\s+tristate\s/) {
+ $allconfig{$key} = 'tristate';
+ $key = 0;
+ } elsif (/^\s+(int|hex|string)\s/) {
+ $allconfig{$key} = 'data';
+ $key = 0;
+ }
+}
+close IN;
+
+exists $allconfig{0} and die "Unable to correctly parse Kconfig file";
+
+# Produce output for including in a Makefile
+# Explicitly set bool/tri options that didn't appear in .config to n
+# 'data' options are only output if they appeared in .config
+open OUT,">.myconfig";
+while ( my ($key, $value) = each(%allconfig) ) {
+ if ($value eq 'data') {
+ next unless (exists $config{$key});
+ $value = $config{$key};
+ } else {
+ $value = exists $config{$key} ? $config{$key} : 'n';
+ }
+ printf OUT "%-44s := %s\n",$key,$value;
+}
+close OUT;
diff --git a/v4l/scripts/make_noconfig.pl b/v4l/scripts/make_noconfig.pl
deleted file mode 100755
index a47ca4acf..000000000
--- a/v4l/scripts/make_noconfig.pl
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/perl
-
-my $config = ();
-
-open IN,".config";
-while (<IN>) {
- if (m/\s*([\d\w_]+)[=](.*)\n/) {
-#printf "%s=%s\n",$1,$2;
- $config { $1 } = $2;
- }
-}
-close IN;
-
-open IN,".version";
-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/) {
- next;
- }
- 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';
- }
- }
-}
-close IN;
-
-open OUT,">.myconfig";
-while ( my ($key, $value) = each(%config) ) {
- if ($value eq "y") {
- $value="m";
- }
- printf OUT "%-44s := %s\n",$key,$value;
-}
-close OUT;
diff --git a/v4l/scripts/makelinks.sh b/v4l/scripts/makelinks.sh
index a66989771..187145822 100755
--- a/v4l/scripts/makelinks.sh
+++ b/v4l/scripts/makelinks.sh
@@ -5,7 +5,7 @@ if test -z $1 || ! test -d $1 ; then
echo
echo " usage: $0 <path_to_kernel_to_patch>"
echo
- exit
+ exit
fi
echo "patching $1..."
@@ -14,15 +14,15 @@ cd linux
PWD=`pwd`
for x in `find drivers -type d | grep -v CVS` ; do
- mkdir -p -v $1/$x
+ mkdir -p -v $1/$x
done
for x in `find Documentation -type d | grep -v CVS` ; do
- mkdir -p -v $1/$x
+ mkdir -p -v $1/$x
done
for x in `find include -type d | grep -v CVS` ; do
- mkdir -p -v $1/$x
+ mkdir -p -v $1/$x
done
for x in `find Documentation -type f | grep -v CVS | grep -v .cvsignore` ; do
@@ -39,10 +39,12 @@ done
for x in `find include -type d | grep -v CVS` ; do
ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h
+ touch $1/$x/config-compat.h
done
for x in `find drivers/media -type d | grep -v CVS` ; do
ln -f -s $PWD/../v4l/compat.h $1/$x/compat.h
+ touch $1/$x/config-compat.h
done
cd ..
diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl
index ac958667b..a4594c7f9 100755
--- a/v4l/scripts/prep_commit_msg.pl
+++ b/v4l/scripts/prep_commit_msg.pl
@@ -1,34 +1,59 @@
#!/usr/bin/perl
-$f=shift;
-open IN,"hg diff|diffstat -p1 |";
-my $n=2;
-my $from="";
-my $first="";
-my $changed="";
-$out="";
-while (<IN>) {
- $changed="$changed#$_";
-}
+my $autopatch = shift;
+# Get Hg username from environment
my $user = $ENV{HGUSER};
-if ( $user eq "" ) {
+# Didn't work? Try the .hgrc file
+if ($user eq "") {
+ open IN, "<$ENV{HOME}/.hgrc";
+ while (<IN>) {
+ if(/^\s*username\s*=\s*(\S.*)$/) {
+ $user = $1;
+ last;
+ }
+ }
+ close IN;
+}
+
+# Still no luck? Try some other environment variables
+if ($user eq "") {
my $name = $ENV{CHANGE_LOG_NAME};
my $email = $ENV{CHANGE_LOG_EMAIL_ADDRESS};
+ $user = "$name <$email>" if ($name ne "" || $email ne "");
+}
+
+# Last try to come up with something
+if ($user eq "") {
+ $user = "$ENV{USER} <>";
+}
- $user="$name <$email>";
+print "# Added/removed/changed files:\n";
+system "hg diff | diffstat -p1 -c";
+if (-s $autopatch) {
+ print "#\n# Note, a problem with your patch was detected! These changes were made\n";
+ print "# automatically: $autopatch\n";
+ system "diffstat -p0 -c $autopatch";
+ print "#\n# Please review these changes and see if they belong in your patch or not.\n";
}
+print <<"EOF";
+#
+# For better log display, please keep a blank line after subject, after from,
+# and before signed-off-by.
+# First line should be the subject, without Subject:
+#
+
+
+# Now, patch author (just the main one), on a From: field
+# Please change below if the committer is not the patch author.
+#
+From: $user
+
+# Then a detailed description:
+
-$first= "# Please change below if you are not patch author\n#\nFrom: $user";
-$out= "# At the end Signed-off-by: fields by patch author and committer, at least\n#\nSigned-off-by: $user";
-$from= "From: $user";
-
-printf "#Added/removed/changed files:\n%s#\n" .
- "# For better log display, please keep a blank line after subject, after from\n" .
- "# and before signed-off-by\n" .
- "# First line should be the subject, without Subject:\n#\n\n\n" .
- "# Now, patch author (just the main one), on a From: field\n" .
- "# Please change below if the committer is not the patch author\n#\n%s\n\n" .
- "# Then a detailed description:\n\n\n%s",
- $changed,$from,$out;
+# At the end Signed-off-by: fields by patch author and committer, at least.
+#
+Signed-off-by: $user
+EOF
diff --git a/v4l/scripts/rmmod.pl b/v4l/scripts/rmmod.pl
new file mode 100755
index 000000000..19a0a8c61
--- /dev/null
+++ b/v4l/scripts/rmmod.pl
@@ -0,0 +1,194 @@
+#!/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 ()
+{
+ while (my $key=pop @modlist) {
+ my $dep=$key;
+ $dep=~s/[\-]/_/g;
+ if (exists ($loaded{$dep})) {
+ printf "rmmod $dep\n";
+ system "rmmod $dep\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";
+ }
+ }
+ }
+}
diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh
index 1a23e436d..a546a0b9f 100755
--- a/v4l/scripts/strip-trailing-whitespaces.sh
+++ b/v4l/scripts/strip-trailing-whitespaces.sh
@@ -1,37 +1,28 @@
#!/bin/sh
+# Strips trailing whitespace. Leading spaces and spaces after tabs are
+# converted to the equivalent sequence of tabs only.
-# tmp dir for my files
-WORK="${TMPDIR-/tmp}/${0##*/}-$$"
-mkdir "$WORK" || exit 1
-trap 'rm -rf "$WORK"' EXIT
+# Use the option "fast" to only check files Hg thinks are new or modified.
+# The option "manifest" will use Hg's manifest command to check all files
+# under Hg revision control.
+# Otherwise, all files under the linux tree are checked, except files in CVS
+# directories and .cvsignore files. This is the historical behavior.
-for file in `find linux -type d | grep -v CVS | grep -v .cvsignore` ; do
- mkdir -p "$WORK/${file}"
-done
-for file in `find linux -type f | grep -v CVS | grep -v .cvsignore` ; do
- tmpfile="$WORK/${file}.$$"
- perl -ne 's/[ \t]+$//;
- s/^\ \ \ \ \ \ \ \ /\t/;
- s/^\ \ \ \ \ \ \ \t/\t/;
- s/^\ \ \ \ \ \ \t/\t/;
- s/^\ \ \ \ \ \t/\t/;
- s/^\ \ \ \t/\t/;
- s/^\ \ \t/\t/;
- s/^\ \t/\t/;
- $m=1;
- while ($m>0) {
- $m=0;
- $m= s/\t\ \ \ \ \ \ \ \ /\t\t/g;
- $m=$m+s/\t\ \ \ \ \ \ \ \t/\t\t/g;
- $m=$m+s/\t\ \ \ \ \ \ \t/\t\t/g;
- $m=$m+s/\t\ \ \ \ \ \t/\t\t/g;
- $m=$m+s/\t\ \ \ \t/\t\t/g;
- $m=$m+s/\t\ \ \t/\t\t/g;
- $m=$m+s/\t\ \t/\t\t/g;
- }
- print' < "${file}" > "${tmpfile}"
- diff -u "${file}" "${tmpfile}" | sed \
- -e "s|^--- ${file}|--- ${file}.orig|" \
- -e "s|^+++ ${tmpfile}|+++ ${file}|"
- rm -f "$tmpfile"
+
+if [ "x$1" = "xfast" ]; then
+ files="hg status -man"
+elif [ "x$1" = "xmanifest" ]; then
+ files="hg manifest | cut '-d ' -f3"
+else
+ files="find linux -name CVS -prune -o -type f -not -name .cvsignore -print"
+fi
+
+for file in `eval $files`; do
+ perl -ne '
+ s/[ \t]+$//;
+ s<^ {8}> <\t>;
+ s<^ {1,7}\t> <\t>;
+ while( s<\t {8}> <\t\t>g || s<\t {1,7}\t> <\t\t>g ) {};
+ print' < "${file}" | \
+ diff -u --label="$file" "$file" --label="$file" -
done
diff --git a/v4l/scripts/tuner.pl b/v4l/scripts/tuner.pl
index fcfa22e26..104c16dae 100755
--- a/v4l/scripts/tuner.pl
+++ b/v4l/scripts/tuner.pl
@@ -8,12 +8,17 @@ my %data;
my $H = shift;
my $C = shift;
+my %blacklist;
open IN, "<$H";
while (<IN>) {
# defines in header file
if (/#define\s+(TUNER_\w+)\s+(\d+)/) {
- $data{$1}->{nr} = $2;
+ my $num=$2;
+ $data{$1}->{nr} = $num;
+ if (/#define\s+TUNER_TDA9887/) {
+ $blacklist{$num}=1;
+ }
next;
}
}
@@ -37,6 +42,10 @@ while (<IN>) {
}
foreach my $item (sort { $data{$a}->{nr} <=> $data{$b}->{nr} } keys %data) {
+ if ($blacklist{$data{$item}->{nr}}) {
+ next;
+ }
+
printf("tuner=%d - %s", $data{$item}->{nr}, $data{$item}->{name});
print "\n";
}
diff --git a/v4l/versions.txt b/v4l/versions.txt
index 9a992909f..0d7c9e5dc 100644
--- a/v4l/versions.txt
+++ b/v4l/versions.txt
@@ -6,19 +6,22 @@ VIDEO_ZR36120
# This is also marked as broken
VIDEO_PLANB
-# Those are architecture-dependent
-VIDEO_VINO
-VIDEO_M32R_AR_M64278
-
[2.6.16]
VIDEO_USBVIDEO
USB_VICAM
USB_IBMCAM
USB_KONICAWC
+USB_QUICKCAM_MESSENGER
USB_ET61X251
USB_PWC
-USB_SN9C102
+USB_PWC_DEBUG
USB_ZC0301
+VIDEO_ZORAN_AVS6EYES
+VIDEO_TLV320AIC23B
+
+# Those are architecture-dependent
+VIDEO_VINO
+VIDEO_M32R_AR_M64278
[2.6.14]
VIDEO_ZORAN
@@ -75,6 +78,9 @@ RADIO_TYPHOON_MUTEFREQ
RADIO_ZOLTRIX
RADIO_ZOLTRIX_PORT
+[2.6.13]
+USB_SN9C102
+
[2.6.12]
VIDEO_VIVI
VIDEO_DEV
@@ -99,6 +105,7 @@ VIDEO_HEXIUM_GEMINI
VIDEO_CX88_VP3054
VIDEO_CX88
VIDEO_CX88_ALSA
+VIDEO_CX88_BLACKBIRD
VIDEO_CX88_DVB
VIDEO_CX88_DVB_ALL_FRONTENDS
VIDEO_CX88_DVB_MT352
@@ -147,6 +154,7 @@ DVB_USB_VP7045
DVB_USB_VP702X
DVB_USB_NOVA_T_USB2
DVB_USB_DTT200U
+DVB_USB_GP8PSK
DVB_TTUSB_BUDGET
DVB_TTUSB_DEC
DVB_CINERGYT2
@@ -188,6 +196,8 @@ DVB_OR51211
DVB_OR51132
DVB_BCM3510
DVB_LGDT330X
+DVB_LNBP21
+DVB_ISL6421
DVB_TUNER_MT2060
VIDEO_SAA7146
VIDEO_SAA7146_VV
@@ -198,3 +208,4 @@ VIDEO_BUF_DVB
VIDEO_BTCX
VIDEO_IR
VIDEO_TVEEPROM
+VIDEO_CX2341X