dvb/linuxtv-dvb/debian/patches 11_budget_ci_loadkeys.dpatch 00list 10_Makefile_fix.dpatch

Thomas Schmidt pkg-vdr-dvb-changes@lists.alioth.debian.org
Sat, 16 Oct 2004 10:46:52 +0000


Update of /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/debian/patches
In directory haydn:/tmp/cvs-serv18052/dvb/linuxtv-dvb/debian/patches

Modified Files:
	00list 10_Makefile_fix.dpatch 
Added Files:
	11_budget_ci_loadkeys.dpatch 
Log Message:
* added patch from Darren Salt (closes: #276083)
* build-dep on dptch (>= 2.0.9)
* converted existing dpatch-file to short format

Index: 00list
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/debian/patches/00list,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- 00list	24 May 2004 21:37:50 -0000	1.3
+++ 00list	16 Oct 2004 10:46:50 -0000	1.4
@@ -1 +1,2 @@
 10_Makefile_fix
+11_budget_ci_loadkeys

--- NEW FILE: 11_budget_ci_loadkeys.dpatch ---
#! /bin/sh /usr/share/dpatch/dpatch-run
## 11_budget_ci_loadkeys.dpatch by Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: adds /proc/budget_ci_ir to be able to programm keymaps of remote controls
## DP: on budget_ci-cards

@DPATCH@
diff -urNad linuxtv-dvb/linux/drivers/media/dvb/ttpci/budget-ci.c /tmp/dpep.FpWcLr/linuxtv-dvb/linux/drivers/media/dvb/ttpci/budget-ci.c
--- linuxtv-dvb/linux/drivers/media/dvb/ttpci/budget-ci.c	2004-05-23 11:09:05.000000000 +0200
+++ /tmp/dpep.FpWcLr/linuxtv-dvb/linux/drivers/media/dvb/ttpci/budget-ci.c	2004-10-16 12:37:40.000000000 +0200
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
+#include <linux/proc_fs.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
 #include "input_fake.h"
@@ -181,10 +182,48 @@
 }
 
 
+static int budget_ci_ir_write_proc (struct file *file,
+				    const char __user *buffer,
+				    unsigned long count, void *data)
+{
+	/* adapted from av7110_ir.c */
+	char *page;
+	int i;
+	struct input_dev *input = (struct input_dev *)data;
+
+	if (count < sizeof (key_map))
+		return -EINVAL;
+	
+	page = (char *)vmalloc(sizeof (key_map));
+	if (!page)
+		return -ENOMEM;
+	
+	if (copy_from_user(page, buffer, sizeof (key_map))) {
+		vfree(page);
+		return -EFAULT;
+	}
+
+	memcpy (&key_map, page, sizeof (key_map));
+	vfree(page);
+
+	memset (input->keybit, 0, sizeof(input->keybit));
+
+	for (i=0; i<sizeof(key_map)/sizeof(key_map[0]); i++) {
+		if (key_map[i] > KEY_MAX)
+			key_map[i] = 0;
+		else if (key_map[i] > KEY_RESERVED)
+			set_bit (key_map[i], input->keybit);
+	}
+
+	return count;
+}
+
+
 static int msp430_ir_init (struct budget_ci *budget_ci)
 {
 	struct saa7146_dev *saa = budget_ci->budget.dev;
 	int i;
+	static struct proc_dir_entry *e;
 
 	memset(&budget_ci->input_dev, 0, sizeof(struct input_dev));
 
@@ -204,6 +243,13 @@
 
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); 
 
+	e = create_proc_entry ("budget_ci_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
+	if (e) {
+		e->write_proc = budget_ci_ir_write_proc;
+		e->data = &budget_ci->input_dev;
+		e->size = sizeof (key_map);
+	}
+
 	return 0;
 }
 
@@ -213,6 +259,8 @@
 	struct saa7146_dev *saa = budget_ci->budget.dev;
 	struct input_dev *dev = &budget_ci->input_dev;
 
+	remove_proc_entry ("budget_ci_ir", NULL);
+
 	saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06);
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
 	saa7146_setgpio(saa, 2, SAA7146_GPIO_INPUT);

Index: 10_Makefile_fix.dpatch
===================================================================
RCS file: /cvsroot/pkg-vdr-dvb/dvb/linuxtv-dvb/debian/patches/10_Makefile_fix.dpatch,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- 10_Makefile_fix.dpatch	4 Sep 2004 11:59:59 -0000	1.7
+++ 10_Makefile_fix.dpatch	16 Oct 2004 10:46:50 -0000	1.8
@@ -1,27 +1,9 @@
-#! /bin/sh -e
+#! /bin/sh /usr/share/dpatch/dpatch-run
 ## 10_Makefile_fix.dpatch by Thomas Schmidt <thomas.schmidt@in.stud.tu-ilmenau.de>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Changes the Makefile to be able to compile a modules-package without
 ## DP: a real kernel-dir, using a kernel-headers-package
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
 
 @DPATCH@
 diff -urNad /home/chelli/vdr/cvs/dvb/linuxtv-dvb/build-2.4/getlinks linuxtv-dvb/build-2.4/getlinks