rpms/ivtv-utils/devel ivtv-utils-1.3.0-v4l2-register-changes.patch, NONE, 1.1 ivtv-utils.spec, 1.1, 1.2

Jarod Wilson jwilson at fedoraproject.org
Tue Feb 3 21:07:31 UTC 2009


Author: jwilson

Update of /cvs/pkgs/rpms/ivtv-utils/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21748

Modified Files:
	ivtv-utils.spec 
Added Files:
	ivtv-utils-1.3.0-v4l2-register-changes.patch 
Log Message:
* Tue Feb 03 2009 Jarod Wilson <jarod at redhat.com> - 1.3.0-2
- Fix up for current rawhide


ivtv-utils-1.3.0-v4l2-register-changes.patch:

--- NEW FILE ivtv-utils-1.3.0-v4l2-register-changes.patch ---
diff -Naurp ivtv-utils-1.3.0.orig/test/vbi.c ivtv-utils-1.3.0/test/vbi.c
--- ivtv-utils-1.3.0.orig/test/vbi.c	2008-05-24 08:30:05.000000000 -0400
+++ ivtv-utils-1.3.0/test/vbi.c	2009-02-03 16:09:52.555207062 -0500
@@ -529,23 +529,23 @@ static void sigalrm(int s)
 static void cc_readback(int fh)
 {
 	struct v4l2_sliced_vbi_data data;
-	struct v4l2_register v;
+	struct v4l2_dbg_register v;
 	int parity[2];
 	int cc_cnt = 0;
 	int field = -1;
 
-	v.match_type = V4L2_CHIP_MATCH_I2C_DRIVER;
-	v.match_chip = I2C_DRIVERID_CX25840;
+	v.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
+	v.match.addr = I2C_DRIVERID_CX25840;
 	v.reg = 0x444;
 	if (ioctl(fh, VIDIOC_DBG_G_REGISTER, &v)) {
-		v.match_chip = I2C_DRIVERID_SAA711X;
+		v.match.addr = I2C_DRIVERID_SAA711X;
 		printf("saa711x\n");
 	}
 	else
 		printf("cx25840\n");
 
 	while (1) {
-		if (v.match_chip == I2C_DRIVERID_CX25840) {
+		if (v.match.addr == I2C_DRIVERID_CX25840) {
 			v.reg = 0x444;
 			ioctl(fh, VIDIOC_DBG_G_REGISTER, &v);
 			if ((v.val & 32) == 32) {
diff -Naurp ivtv-utils-1.3.0.orig/utils/ivtv-ctl.c ivtv-utils-1.3.0/utils/ivtv-ctl.c
--- ivtv-utils-1.3.0.orig/utils/ivtv-ctl.c	2008-05-25 09:03:47.000000000 -0400
+++ ivtv-utils-1.3.0/utils/ivtv-ctl.c	2009-02-03 16:09:59.819207462 -0500
@@ -563,10 +563,10 @@ int main(int argc, char **argv)
 	}
 
 	if (options[OptSetGPIO]) {
-		struct v4l2_register reg;
+		struct v4l2_dbg_register reg;
 
-		reg.match_type = V4L2_CHIP_MATCH_HOST;
-		reg.match_chip = 0;
+		reg.match.type = V4L2_CHIP_MATCH_HOST;
+		reg.match.addr = 0;
 		reg.reg = IVTV_REG_GPIO_DIR_OFFSET;
 		reg.val = gpio_dir;
 		if (gpio_set_dir && doioctl(fd, VIDIOC_DBG_S_REGISTER, &reg,
@@ -580,10 +580,10 @@ int main(int argc, char **argv)
 	}
 
 	if (options[OptListGPIO]) {
-		struct v4l2_register reg;
+		struct v4l2_dbg_register reg;
 
-		reg.match_type = V4L2_CHIP_MATCH_HOST;
-		reg.match_chip = 0;
+		reg.match.type = V4L2_CHIP_MATCH_HOST;
+		reg.match.addr = 0;
 		reg.reg = IVTV_REG_GPIO_IN_OFFSET;
 		if (ioctl(fd, VIDIOC_DBG_G_REGISTER, &reg) == 0)
 			printf("GPIO in:  0x%04llx\n", reg.val);
diff -Naurp ivtv-utils-1.3.0.orig/utils/v4l2-dbg.cpp ivtv-utils-1.3.0/utils/v4l2-dbg.cpp
--- ivtv-utils-1.3.0.orig/utils/v4l2-dbg.cpp	2009-02-03 15:51:02.863210769 -0500
+++ ivtv-utils-1.3.0/utils/v4l2-dbg.cpp	2009-02-03 16:09:28.346207207 -0500
@@ -47,7 +47,7 @@
 #define I2C_DRIVERID_CX25840   71      /* cx2584x video encoder        */
 #define I2C_DRIVERID_CS5345    96      /* cs5345 audio processor	*/
 
-/* VIDIOC_G_CHIP_IDENT: identifies the actual chip installed on the board */
+/* VIDIOC_DBG_G_CHIP_IDENT: identifies the actual chip installed on the board */
 enum {
 	/* general idents: reserved range 0-49 */
 	V4L2_IDENT_NONE      = 0,       /* No chip matched */
@@ -130,9 +130,9 @@ static void usage(void)
 	printf("  -r, --set-register=type=<host/i2cdrv/i2caddr>,chip=<chip>,reg=<addr>,val=<val>\n");
 	printf("		     set the register [VIDIOC_DBG_S_REGISTER]\n");
 	printf("  -C, --scan-chip-idents\n");
-	printf("		     Scan the available host and i2c chips [VIDIOC_G_CHIP_IDENT]\n");
+	printf("		     Scan the available host and i2c chips [VIDIOC_DBG_G_CHIP_IDENT]\n");
 	printf("  -c, --get-chip-ident=type=<host/i2cdrv/i2caddr>,chip=<chip>\n");
-	printf("		     Get the chip identifier [VIDIOC_G_CHIP_IDENT]\n");
+	printf("		     Get the chip identifier [VIDIOC_DBG_G_CHIP_IDENT]\n");
 	printf("  -w, --wide=<reg length>\n");
 	printf("		     Sets step between two registers\n");
 	printf("  --log-status       log the board status in the kernel log [VIDIOC_LOG_STATUS]\n");
@@ -198,7 +198,7 @@ static std::string cap2s(unsigned cap)
 	return s;
 }
 
-static void print_regs(int fd, struct v4l2_register *reg, unsigned long min, unsigned long max, int stride)
+static void print_regs(int fd, struct v4l2_dbg_register *reg, unsigned long min, unsigned long max, int stride)
 {
 	unsigned long mask = stride > 1 ? 0x1f : 0x0f;
 	unsigned long i;
@@ -232,7 +232,7 @@ static void print_regs(int fd, struct v4
 	printf("\n");
 }
 
-static void print_chip(struct v4l2_chip_ident *chip)
+static void print_chip(struct v4l2_dbg_chip_ident *chip)
 {
 	const char *name = NULL;
 
@@ -292,9 +292,9 @@ int main(int argc, char **argv)
 	int ch;
 	const char *device = "/dev/video0";	/* -d device */
 	struct v4l2_capability vcap;	/* list_cap */
-	struct v4l2_register set_reg;
-	struct v4l2_register get_reg;
-	struct v4l2_chip_ident chip_id;
+	struct v4l2_dbg_register set_reg;
+	struct v4l2_dbg_register get_reg;
+	struct v4l2_dbg_chip_ident chip_id;
 	char short_options[26 * 2 * 2 + 1];
 	int idx = 0;
 	unsigned long long reg_min = 0, reg_max = 0;
@@ -340,7 +340,7 @@ int main(int argc, char **argv)
 			break;
 		case OptSetRegister:
 			subs = optarg;
-			set_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER;
+			set_reg.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
 			while (*subs != '\0') {
 				static const char * const subopts[] = {
 					"type",
@@ -352,10 +352,10 @@ int main(int argc, char **argv)
 
 				switch (parse_subopt(&subs, subopts, &value)) {
 				case 0:
-					set_reg.match_type = parse_type(value);
+					set_reg.match.type = parse_type(value);
 					break;
 				case 1:
-					set_reg.match_chip = parse_chip(set_reg.match_type, value);
+					set_reg.match.addr = parse_chip(set_reg.match.type, value);
 					break;
 				case 2:
 					set_reg.reg = strtoull(value, 0L, 0);
@@ -370,7 +370,7 @@ int main(int argc, char **argv)
 			break;
 		case OptListRegisters:
 			subs = optarg;
-			get_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER;
+			get_reg.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
 			while (*subs != '\0') {
 				static const char * const subopts[] = {
 					"type",
@@ -382,10 +382,10 @@ int main(int argc, char **argv)
 
 				switch (parse_subopt(&subs, subopts, &value)) {
 				case 0:
-					get_reg.match_type = parse_type(value);
+					get_reg.match.type = parse_type(value);
 					break;
 				case 1:
-					get_reg.match_chip = parse_chip(get_reg.match_type, value);
+					get_reg.match.addr = parse_chip(get_reg.match.type, value);
 					break;
 				case 2:
 					reg_min = strtoull(value, 0L, 0);
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
 			break;
 		case OptGetChipIdent:
 			subs = optarg;
-			set_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER;
+			set_reg.match.type = V4L2_CHIP_MATCH_I2C_DRIVER;
 			while (*subs != '\0') {
 				static const char *const subopts[] = {
 					"type",
@@ -410,10 +410,10 @@ int main(int argc, char **argv)
 
 				switch (parse_subopt(&subs, subopts, &value)) {
 				case 0:
-					chip_id.match_type = parse_type(value);
+					chip_id.match.type = parse_type(value);
 					break;
 				case 1:
-					chip_id.match_chip = parse_chip(chip_id.match_type, value);
+					chip_id.match.addr = parse_chip(chip_id.match.type, value);
 					break;
 				}
 			}
@@ -469,26 +469,26 @@ int main(int argc, char **argv)
 	}
 
 	if (options[OptGetChipIdent]) {
-		if (doioctl(fd, VIDIOC_G_CHIP_IDENT, &chip_id, "VIDIOC_G_CHIP_IDENT") == 0)
+		if (doioctl(fd, VIDIOC_DBG_G_CHIP_IDENT, &chip_id, "VIDIOC_DBG_G_CHIP_IDENT") == 0)
 			print_chip(&chip_id);
 	}
 
 	if (options[OptScanChipIdents]) {
 		int i;
 
-		chip_id.match_type = V4L2_CHIP_MATCH_HOST;
-		chip_id.match_chip = 0;
+		chip_id.match.type = V4L2_CHIP_MATCH_HOST;
+		chip_id.match.addr = 0;
 
-		while (doioctl(fd, VIDIOC_G_CHIP_IDENT, &chip_id, "VIDIOC_G_CHIP_IDENT") == 0 && chip_id.ident) {
-			printf("host 0x%x: ", chip_id.match_chip);
+		while (doioctl(fd, VIDIOC_DBG_G_CHIP_IDENT, &chip_id, "VIDIOC_DBG_G_CHIP_IDENT") == 0 && chip_id.ident) {
+			printf("host 0x%x: ", chip_id.match.addr);
 			print_chip(&chip_id);
-			chip_id.match_chip++;
+			chip_id.match.addr++;
 		}
 
-		chip_id.match_type = V4L2_CHIP_MATCH_I2C_ADDR;
+		chip_id.match.type = V4L2_CHIP_MATCH_I2C_ADDR;
 		for (i = 0; i < 128; i++) {
-			chip_id.match_chip = i;
-			if (doioctl(fd, VIDIOC_G_CHIP_IDENT, &chip_id, "VIDIOC_G_CHIP_IDENT") == 0 && chip_id.ident) {
+			chip_id.match.addr = i;
+			if (doioctl(fd, VIDIOC_DBG_G_CHIP_IDENT, &chip_id, "VIDIOC_DBG_G_CHIP_IDENT") == 0 && chip_id.ident) {
 				printf("i2c 0x%02x: ", i);
 				print_chip(&chip_id);
 			}
@@ -500,7 +500,7 @@ int main(int argc, char **argv)
 		if (forcedstride) {
 			stride = forcedstride;
 		} else {
-			if (get_reg.match_type == V4L2_CHIP_MATCH_HOST)
+			if (get_reg.match.type == V4L2_CHIP_MATCH_HOST)
 				stride = 4;
 		}
 		printf("ioctl: VIDIOC_DBG_G_REGISTER\n");
@@ -511,7 +511,7 @@ int main(int argc, char **argv)
 			goto list_done;
 		}
 		/* try to match the i2c chip */
-		switch (get_reg.match_chip) {
+		switch (get_reg.match.addr) {
 		case I2C_DRIVERID_SAA711X:
 			print_regs(fd, &get_reg, 0, 0xff, stride);
 			break;
@@ -540,12 +540,12 @@ int main(int argc, char **argv)
 			print_regs(fd, &get_reg, 0, 0xff, stride);
 			break;
 		}
-		if (get_reg.match_chip != 0) {
+		if (get_reg.match.addr != 0) {
 			/* found i2c chip, we're done */
 			goto list_done;
 		}
 		/* try to figure out which host chip it is */
-		if (doioctl(fd, VIDIOC_G_CHIP_IDENT, &chip_id, "VIDIOC_G_CHIP_IDENT") != 0) {
+		if (doioctl(fd, VIDIOC_DBG_G_CHIP_IDENT, &chip_id, "VIDIOC_DBG_G_CHIP_IDENT") != 0) {
 			chip_id.ident = V4L2_IDENT_NONE;
 		}
 


Index: ivtv-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ivtv-utils/devel/ivtv-utils.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ivtv-utils.spec	2 Dec 2008 19:40:11 -0000	1.1
+++ ivtv-utils.spec	3 Feb 2009 21:07:01 -0000	1.2
@@ -1,10 +1,11 @@
 Summary: Tools for the iTVC15/16 and CX23415/16 driver
 Name: ivtv-utils
 Version: 1.3.0
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2
 Group: Applications/Multimedia
 Source0: http://dl.ivtvdriver.org/ivtv/archive/1.3.x/%{name}-%{version}.tar.gz
+Patch0: ivtv-utils-1.3.0-v4l2-register-changes.patch
 URL: http://ivtvdriver.org/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
 Requires: ivtv-firmware
@@ -22,12 +23,11 @@
 
 %prep
 %setup -q
+%patch0 -p1
 perl -pi -e's,/sbin/depmod,:,g' driver/Makefile
 grep -rl '#include <linux/config.h>' . | xargs perl -pi -e's,#include <linux/config.h>,/* #include <linux/config.h> */,'
 perl -pi -e's at CFLAGS = -D_GNU_SOURCE .*@CFLAGS = -D_GNU_SOURCE -D__user= %{optflags}@' utils/Makefile
 perl -pi -e's,#include "videodev2.h",#include <linux/videodev2.h>,' ./utils/v4l2-dbg.cpp
-grep -l '#include <linux/ivtv.h>' utils/*.c utils/*.cc |\
-  xargs -r perl -pi -e's,#include <linux/ivtv.h>,#include "linux/ivtv.h",'
 
 %build
 make -C utils
@@ -56,6 +56,9 @@
 %{_datadir}/ivtv
 
 %changelog
+* Tue Feb 03 2009 Jarod Wilson <jarod at redhat.com> - 1.3.0-2
+- Fix up for current rawhide
+
 * Tue Dec 02 2008 Jarod Wilson <jarod at redhat.com> - 1.3.0-1
 - Update to 1.3.0.
 




More information about the fedora-extras-commits mailing list