summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/bt856.c8
-rw-r--r--linux/drivers/media/video/cpia.c1
-rw-r--r--v4l/compat.h5
-rw-r--r--v4l/firmware/Makefile11
-rw-r--r--v4l/scripts/headers_convert.pl30
-rw-r--r--v4l2-apps/Makefile17
-rw-r--r--v4l2-apps/lib/Makefile2
-rw-r--r--v4l2-apps/lib/frequencies.c2
-rw-r--r--v4l2-apps/lib/libv4l/libv4l1/Makefile2
-rw-r--r--v4l2-apps/lib/libv4l/libv4l2/Makefile2
-rw-r--r--v4l2-apps/lib/libv4l/libv4lconvert/Makefile2
-rw-r--r--v4l2-apps/test/Makefile2
-rw-r--r--v4l2-apps/test/ioctl-test.c2
-rw-r--r--v4l2-apps/util/Makefile10
-rw-r--r--v4l2-apps/util/qv4l2/qv4l2.pro2
-rw-r--r--v4l2-apps/util/rds/Makefile2
-rw-r--r--v4l2-apps/util/xc3028-firmware/Makefile2
17 files changed, 75 insertions, 27 deletions
diff --git a/linux/drivers/media/video/bt856.c b/linux/drivers/media/video/bt856.c
index 50ca987ad..e31c9d4b9 100644
--- a/linux/drivers/media/video/bt856.c
+++ b/linux/drivers/media/video/bt856.c
@@ -69,8 +69,8 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");
/* ----------------------------------------------------------------------- */
-#define REG_OFFSET 0xDA
-#define BT856_NR_REG 6
+#define BT856_REG_OFFSET 0xDA
+#define BT856_NR_REG 6
struct bt856 {
unsigned char reg[BT856_NR_REG];
@@ -90,7 +90,7 @@ bt856_write (struct i2c_client *client,
{
struct bt856 *encoder = i2c_get_clientdata(client);
- encoder->reg[reg - REG_OFFSET] = value;
+ encoder->reg[reg - BT856_REG_OFFSET] = value;
return i2c_smbus_write_byte_data(client, reg, value);
}
@@ -104,7 +104,7 @@ bt856_setbit (struct i2c_client *client,
return bt856_write(client, reg,
(encoder->
- reg[reg - REG_OFFSET] & ~(1 << bit)) |
+ reg[reg - BT856_REG_OFFSET] & ~(1 << bit)) |
(value ? (1 << bit) : 0));
}
diff --git a/linux/drivers/media/video/cpia.c b/linux/drivers/media/video/cpia.c
index 448dccfb1..0bee440ab 100644
--- a/linux/drivers/media/video/cpia.c
+++ b/linux/drivers/media/video/cpia.c
@@ -44,6 +44,7 @@
#endif
#include "cpia.h"
+#include "compat.h"
static int video_nr = -1;
diff --git a/v4l/compat.h b/v4l/compat.h
index 6df2f6f13..6e90c0e63 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -230,6 +230,11 @@ static inline int list_is_singular(const struct list_head *head)
{
return !list_empty(head) && (head->next == head->prev);
}
+
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27)
+#define current_uid() (current->uid)
#endif
#endif
diff --git a/v4l/firmware/Makefile b/v4l/firmware/Makefile
index a1717922d..272b2e668 100644
--- a/v4l/firmware/Makefile
+++ b/v4l/firmware/Makefile
@@ -7,27 +7,26 @@ TARGETS = ihex2fw vicam/firmware.fw dabusb/firmware.fw dabusb/bitstream.bin ttus
default: $(TARGETS)
clean:
- @for i in $(TARGETS); do if [ -e $$i ]; then rm $$i; fi; done
+ -rm -f $(TARGETS)
distclean: clean
- @for i in $(DIR); do if [ -d $$i ]; then rmdir $$i; fi; done
+ -for i in $(DIRS); do if [ -d $$i ]; then rmdir $$i; fi; done
install: default
- -for i in $(DIRS); do if mkdir /lib/firmware/$$i; done
+ -for i in $(DIRS); do if [ ! -d /lib/firmware/$$i ]; then mkdir -p /lib/firmware/$$i; fi; done
-for i in $(TARGETS); do cp $$i /lib/firmware/$$i; done
-
+
######
mkdir:
- -mkdir $(DIRS)
+ -for i in $(DIRS); do if [ ! -d $$i ]; then mkdir -p $$i; fi; done
ihex2fw: ../../linux/firmware/ihex2fw.c
gcc -Wall -o $@ $<
vicam/firmware.fw: ../../linux/firmware/vicam/firmware.H16 mkdir
- -mkdir vicam
./ihex2fw -w $< $@
dabusb/firmware.fw: ../../linux/firmware/dabusb/firmware.HEX mkdir
diff --git a/v4l/scripts/headers_convert.pl b/v4l/scripts/headers_convert.pl
new file mode 100644
index 000000000..800a453e1
--- /dev/null
+++ b/v4l/scripts/headers_convert.pl
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+#
+# headers_install prepare the listed header files for use in
+# user space and copy the files to their destination.
+#
+
+use strict;
+use warnings;
+
+foreach (@ARGV) {
+ my $file = $_;
+ my $tmpfile = $file . ".tmp";
+
+ open(my $infile, '<', "$file")
+ or die "$file: $!\n";
+ open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n";
+ while (my $line = <$infile>) {
+ $line =~ s/([\s(])__user\s/$1/g;
+ $line =~ s/([\s(])__force\s/$1/g;
+ $line =~ s/([\s(])__iomem\s/$1/g;
+ $line =~ s/\s__attribute_const__\s/ /g;
+ $line =~ s/\s__attribute_const__$//g;
+ $line =~ s/^#include <linux\/compiler.h>//;
+ printf $outfile "%s", $line;
+ }
+ close $outfile;
+ close $infile;
+ system "mv $tmpfile $file";
+}
+exit 0;
diff --git a/v4l2-apps/Makefile b/v4l2-apps/Makefile
index 550473435..2bba8fcd4 100644
--- a/v4l2-apps/Makefile
+++ b/v4l2-apps/Makefile
@@ -1,11 +1,24 @@
# Makefile for linuxtv.org v4l2-apps
-.PHONY: all clean install
+.PHONY: all distclean clean install
-all clean install:
+all:: prepare-includes
+
+all clean install::
$(MAKE) -C lib $@
$(MAKE) -C util $@
$(MAKE) -C test $@
%:
make -C .. $(MAKECMDGOALS)
+
+clean::
+ -$(RM) -rf include
+
+distclean:: clean
+
+prepare-includes:
+ -if [ ! -d include ]; then \
+ cp -r ../linux/include include ; \
+ ../v4l/scripts/headers_convert.pl `find include -type f` ; \
+ fi
diff --git a/v4l2-apps/lib/Makefile b/v4l2-apps/lib/Makefile
index f123f3380..8443039b4 100644
--- a/v4l2-apps/lib/Makefile
+++ b/v4l2-apps/lib/Makefile
@@ -1,6 +1,6 @@
# Makefile for linuxtv.org v4l2-apps/lib
-CPPFLAGS += -I../../linux/include -I..
+CPPFLAGS += -I../include -I..
includes = v4l2.h
diff --git a/v4l2-apps/lib/frequencies.c b/v4l2-apps/lib/frequencies.c
index 77a79e61c..64379d2b0 100644
--- a/v4l2-apps/lib/frequencies.c
+++ b/v4l2-apps/lib/frequencies.c
@@ -21,7 +21,7 @@
#include <stdlib.h>
-#include "linux/videodev2.h"
+#include <linux/videodev2.h>
#include "v4l2.h"
/* This source was originally written by Nathan Laredo <laredo@gnu.org>.
diff --git a/v4l2-apps/lib/libv4l/libv4l1/Makefile b/v4l2-apps/lib/libv4l/libv4l1/Makefile
index d12e747fb..27848477e 100644
--- a/v4l2-apps/lib/libv4l/libv4l1/Makefile
+++ b/v4l2-apps/lib/libv4l/libv4l1/Makefile
@@ -1,4 +1,4 @@
-override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden
+override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden
CFLAGS := -g -O1
CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
diff --git a/v4l2-apps/lib/libv4l/libv4l2/Makefile b/v4l2-apps/lib/libv4l/libv4l2/Makefile
index 5ed35934a..648d27c0c 100644
--- a/v4l2-apps/lib/libv4l/libv4l2/Makefile
+++ b/v4l2-apps/lib/libv4l/libv4l2/Makefile
@@ -1,4 +1,4 @@
-override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden
+override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden
CFLAGS := -g -O1
CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/Makefile b/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
index 798194434..641d19d6e 100644
--- a/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
+++ b/v4l2-apps/lib/libv4l/libv4lconvert/Makefile
@@ -1,4 +1,4 @@
-override CPPFLAGS += -I../include -I../../../../linux/include -fvisibility=hidden
+override CPPFLAGS += -I../include -I../../../include -fvisibility=hidden
CFLAGS := -g -O1
CFLAGS += -Wall -Wno-unused -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes
diff --git a/v4l2-apps/test/Makefile b/v4l2-apps/test/Makefile
index ae8868c21..faafed14d 100644
--- a/v4l2-apps/test/Makefile
+++ b/v4l2-apps/test/Makefile
@@ -1,6 +1,6 @@
# Makefile for linuxtv.org v4l2-apps/test
-CPPFLAGS += -I../../linux/include
+CPPFLAGS += -I../include
binaries = ioctl-test \
sliced-vbi-test \
diff --git a/v4l2-apps/test/ioctl-test.c b/v4l2-apps/test/ioctl-test.c
index f483338fb..99ad717e5 100644
--- a/v4l2-apps/test/ioctl-test.c
+++ b/v4l2-apps/test/ioctl-test.c
@@ -42,7 +42,7 @@
typedef __u8 u8;
typedef __u32 u32;
#include <linux/version.h>
-#include "../linux/include/media/v4l2-common.h"
+#include <media/v4l2-common.h>
#include <linux/video_decoder.h>
#else
typedef u_int32_t u32;
diff --git a/v4l2-apps/util/Makefile b/v4l2-apps/util/Makefile
index 41d4712e1..bfd5a72b8 100644
--- a/v4l2-apps/util/Makefile
+++ b/v4l2-apps/util/Makefile
@@ -4,7 +4,7 @@ ifeq ($(KERNEL_DIR),)
KERNEL_DIR = /usr
endif
-CPPFLAGS += -I../../linux/include -D_GNU_SOURCE
+CPPFLAGS += -I../include -D_GNU_SOURCE
LDFLAGS += -lm
binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl v4l-board-dbg
@@ -26,8 +26,8 @@ clean::
rm -rf keycodes parse.h keytable
qv4l2:
- if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi
- make -C qv4l2
+ -if [ ! -f qv4l2/Makefile ]; then (cd qv4l2; qmake); fi
+ $(MAKE) -C qv4l2
v4l2-dbg: v4l2-dbg.o v4l2-driverids.o v4l2-chipids.o
$(CXX) $^ -o $@
@@ -59,12 +59,12 @@ keytable: keytable.c parse.h keytables
v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h em28xx-dbg.h
-v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h
+v4l2-driverids.cpp: ../include/linux/i2c-id.h
@echo "struct driverid { const char *name; unsigned id; } driverids[] = {" >$@
@grep I2C_DRIVERID_ $^ | sed -e 's/.*I2C_DRIVERID_\([0-9A-Z_]*\)[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@
@echo "{ 0, 0 }};" >>$@
-v4l2-chipids.cpp: ../../linux/include/media/v4l2-chip-ident.h
+v4l2-chipids.cpp: ../include/media/v4l2-chip-ident.h
@echo "struct chipid { const char *name; unsigned id; } chipids[] = {" >$@
@grep V4L2_IDENT_ $^ | sed -e 's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ "\1", \2 },/' | tr A-Z a-z >>$@
@echo "{ 0, 0 }};" >>$@
diff --git a/v4l2-apps/util/qv4l2/qv4l2.pro b/v4l2-apps/util/qv4l2/qv4l2.pro
index c53a098b5..5e0b7555d 100644
--- a/v4l2-apps/util/qv4l2/qv4l2.pro
+++ b/v4l2-apps/util/qv4l2/qv4l2.pro
@@ -3,7 +3,7 @@
######################################################################
TEMPLATE = app
-INCLUDEPATH += . ../../../linux/include ../../lib
+INCLUDEPATH += . ../../include ../../lib
CONFIG += debug
# Input
diff --git a/v4l2-apps/util/rds/Makefile b/v4l2-apps/util/rds/Makefile
index 4f6ebd9f2..fb2213c99 100644
--- a/v4l2-apps/util/rds/Makefile
+++ b/v4l2-apps/util/rds/Makefile
@@ -1,6 +1,6 @@
# Makefile for linuxtv.org v4l2-apps/util/xc3028-firmware
-CPPFLAGS += -I../../../linux/include
+CPPFLAGS += -I../../include
binaries = rds-saa6588
diff --git a/v4l2-apps/util/xc3028-firmware/Makefile b/v4l2-apps/util/xc3028-firmware/Makefile
index 102f712fd..6894e984e 100644
--- a/v4l2-apps/util/xc3028-firmware/Makefile
+++ b/v4l2-apps/util/xc3028-firmware/Makefile
@@ -1,6 +1,6 @@
# Makefile for linuxtv.org v4l2-apps/util/xc3028-firmware
-CPPFLAGS += -I../../../linux/include
+CPPFLAGS += -I../../include
binaries = firmware-tool