aboutsummaryrefslogtreecommitdiffstats
path: root/dvb-t/fr-Caen-Pincon
diff options
context:
space:
mode:
authorChristoph Pfister <pfister@linuxtv.org>2009-03-13 14:35:20 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-13 14:35:20 +0100
commitd830187bb4ef4b644747344cf2672f23625f9119 (patch)
tree901cd9b2feeae05b994504ac0bb1f3157405e6a1 /dvb-t/fr-Caen-Pincon
parente23f691f7bf3d3779aa1ed85917130e09698dd63 (diff)
downloaddtv-scan-tables-d830187bb4ef4b644747344cf2672f23625f9119.tar.gz
combine scan file for it-Verona
http://www.spinics.net/lists/linux-media/msg02837.html http://article.gmane.org/gmane.linux.drivers.video-input-infrastructure/2861
Diffstat (limited to 'dvb-t/fr-Caen-Pincon')
0 files changed, 0 insertions, 0 deletions
a id='n107' href='#n107'>107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
#! /bin/sh /usr/share/dpatch/dpatch-run
## 03_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 the utility budget_ci_loadkeys

@DPATCH@
diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c
--- linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c	2004-05-14 12:32:12.000000000 +0200
+++ /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/av7110_loadkeys.c	2004-10-16 09:59:28.000000000 +0200
@@ -1,5 +1,6 @@
 #include <asm/types.h>
 #include <stdlib.h>
+#include <stdio.h>
 #include <unistd.h>
 #include <sys/mman.h>
 #include <sys/types.h>
@@ -99,12 +100,20 @@
 
 
 
+#ifdef HW_MSP430
+const char usage [] = "\n\tusage: budget_ci_loadkeys keymap_filename.rc5\n\n";
+#else
 const char usage [] = "\n\tusage: av7110_loadkeys [-i|--invert] [-a|--address <num>] keymap_filename.(rc5|rcmm)\n\n";
-
+#endif
 
 struct ir_setup {
+#ifdef HW_MSP430
+#define KEYTAB_SIZE 64
+#else
+#define KEYTAB_SIZE 256
 	__u32 ir_config;
-	__u16 keytab [256];
+#endif
+	__u16 keytab [KEYTAB_SIZE];
 } __attribute__ ((packed));
 
 
@@ -116,7 +125,10 @@
 	char *buf, *pos, *fname = NULL;
 
 	for (i=1; i<argc; i++) {
+#ifndef HW_MSP430
+		/* AV7110 only; not MSP430 */
 		if (!strcmp("-i", argv[i]) || !strcmp("--invert", argv[i]))
+			
 			setup.ir_config |= 0x8000;
 		else if (!strcmp("-a", argv[i]) || !strcmp("--address", argv[i])) {
 			if (++i < argc) {
@@ -124,6 +136,7 @@
 				setup.ir_config |= 0x4000;
 			}
 		} else
+#endif
 			fname = argv[i];
 	}
 
@@ -132,6 +145,14 @@
 		exit (-1);
 	}
 
+#ifdef HW_MSP430
+	if (strncmp(".rc5", fname + strlen(fname) - 4, 4) != 0) {
+		const char msg [] = "\nERROR: "
+			"input filename must have suffix .rc5\n";
+		write (0, msg, strlen(msg));
+		exit (-1);
+	}
+#else
 	if (strncmp(".rcmm", fname + strlen(fname) - 5, 5) == 0)
 		setup.ir_config |= 0x0001;
 	else if (strncmp(".rc5", fname + strlen(fname) - 4, 4) != 0) {
@@ -140,6 +161,7 @@
 		write (0, msg, strlen(msg));
 		exit (-1);
 	}
+#endif
 
 	if ((fd = open (fname, O_RDONLY)) < 0)
 		print_error ("open", fname);
@@ -161,9 +183,11 @@
 		key = strtol (pos, &pos, 0);
 		keycode = parse_keyname (pos, &pos, buf + len - pos);
 
-		if (key < 0 || key > 0xff) {
-			const char msg [] = 
-				"\nERROR: key must be in range 0 ... 0xff!\n\n";
+		if (key < 0 || key >= KEYTAB_SIZE) {
+			char *msg;
+			asprintf (&msg,
+				"\nERROR: key must be in range 0 ... 0x%02x!\n\n",
+				KEYTAB_SIZE);
 
 			write (0, msg, strlen(msg));
 			exit (-1);
@@ -178,7 +202,7 @@
 	munmap (buf, len);
 	close (fd);
 
-	write (1, &setup, 4 + 256 * sizeof(__u16));
+	write (1, &setup, sizeof (setup));
 
 	return 0;
 }
diff -urNad linuxtv-dvb-apps/util/av7110_loadkeys/Makefile /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile
--- linuxtv-dvb-apps/util/av7110_loadkeys/Makefile	2004-05-14 12:32:12.000000000 +0200
+++ /tmp/dpep.HGK2iu/linuxtv-dvb-apps/util/av7110_loadkeys/Makefile	2004-10-16 09:59:27.000000000 +0200
@@ -1,14 +1,23 @@
 CC = gcc
-CFLAGS = -g -Wall -O2
+CFLAGS = -g -Wall -O2 -D_GNU_SOURCE
 
-all: av7110_loadkeys evtest
+all: av7110_loadkeys budget_ci_loadkeys evtest
 
 av7110_loadkeys: av7110_loadkeys.o
 
+budget_ci_loadkeys: budget_ci_loadkeys.o
+
 evtest: evtest.o
 
+av7110_loadkeys.o: CFLAGS += -UHW_MSP430
 av7110_loadkeys.o: av7110_loadkeys.c input_keynames.h
 
+budget_ci_loadkeys.c: av7110_loadkeys.c
+	ln av7110_loadkeys.c budget_ci_loadkeys.c
+
+budget_ci_loadkeys.o: CFLAGS += -DHW_MSP430
+budget_ci_loadkeys.o: budget_ci_loadkeys.c input_keynames.h
+
 evtest.o: evtest.c input_keynames.h
 
 
@@ -44,5 +53,6 @@
 
 
 clean:
-	$(RM) core* *.o input_keynames.h av7110_loadkeys evtest
+	$(RM) core* *.o input_keynames.h av7110_loadkeys budget_ci_loadkeys \
+		 budget_ci_loadkeys.c evtest