Skip to contentSkip to conversation

Mantis VP-2033 remote control patch ported for Manu's Mantis tree

linux-dvb Pauli Borodulin 1 participant 1 message Mar 3, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Heya!

Kristian Slavov posted a patch[1] to enable remote controller support on Mantis VP-2033 for almost a year ago. Since then, I have not seen any new versions of this patch, but since Manu's current Mantis driver[2] works pretty well and I have such card, I decided to port the old patch for the current tree. The patch is attached.

I modified the original patch a bit: The ir keymap is now contained in the Mantis driver instead of media/common/ir-keymaps.c, because I saw no
point in putting it under common. This may well be incorrect... :)

I have tested the patch using Manu's tree from 2008-02-27, Linux 2.6.24.3, VDR 1.5.17 and vdr-remote 0.4.0. Here's some tips to get it working:

1. Get a snapshot of Manu's tree from http://www.jusst.de/hg/mantis/

2. Extract the tree and apply the patch:

tar jfx mantis-a9ecd19a37c9.tar.bz2
cd mantis-a9ecd19a37c9
patch -p1 < mantis-rc.patch

3. Compile, install and so on...

make
make install
...

The remote control will be visible through /dev/input/eventX. If you are not sure which one is it, try "cat /dev/input/eventX" for each, press some rc buttons and see if you get some (probably binary) output. To use the remote control with VDR you will need something like vdr-remote[3].

Have fun!

[1] http://www.linuxtv.org/pipermail/linux-dvb/2007-April/017279.html
[2] http://www.jusst.de/hg/mantis/
[3] http://www.escape-edv.de/endriss/vdr/

Regards,
Pauli Borodulin

linux/drivers/media/dvb/mantis/Makefile +2 -1
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/Makefile mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/Makefile
@@ -8,7 +8,8 @@
 		mantis_vp1041.o \
 		mantis_vp2033.o	\
 		mantis_vp2040.o	\
-		mantis_vp3030.o
+		mantis_vp3030.o \
+		mantis_rc.o
 
 obj-$(CONFIG_DVB_MANTIS) += mantis.o
 
linux/drivers/media/dvb/mantis/mantis_common.h +20 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_common.h mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_common.h
@@ -26,6 +26,8 @@
 #include <linux/kernel.h>
 #include <linux/pci.h>
 #include <linux/mutex.h>
+#include <linux/input.h>
+#include <media/ir-common.h>
 
 #include "dvbdev.h"
 #include "dvb_demux.h"
@@ -72,8 +74,23 @@
 	char			*model_name;
 	char			*dev_type;
 	u32			ts_size;
+	IR_KEYTAB_TYPE		*ir_codes;
 };
 
+struct mantis_ir {
+	struct input_dev	*rc_dev;
+	char			rc_name[80];
+	char			rc_phys[80];
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+	struct work_struct	rc_query_work;
+#else
+	struct delayed_work	rc_query_work;
+#endif
+	u32			ir_last_code;
+	struct ir_input_state	ir;
+};
+
+
 struct mantis_pci {
 	/*	PCI stuff		*/
 	u16			vendor_id;
@@ -134,6 +151,9 @@
 
 	 /*	A12 A13 A14		*/
 	int			gpio_status;
+
+	/* 	RC			*/
+	struct mantis_ir	ir;
 };
 
 extern unsigned int verbose;
linux/drivers/media/dvb/mantis/mantis_core.c +4 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_core.c mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_core.c
@@ -163,6 +163,10 @@
 		dprintk(verbose, MANTIS_DEBUG, 1, "Mantis DVB init failed");
 		return err;
 	}
+	if ((err = mantis_rc_init(mantis)) < 0) {
+		dprintk(verbose, MANTIS_DEBUG, 1, "mantis RC init failed");
+		return err;
+	}
 
 	return 0;
 }
linux/drivers/media/dvb/mantis/mantis_core.h +2 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_core.h mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_core.h
@@ -53,6 +53,8 @@
 extern int mantis_i2c_exit(struct mantis_pci *mantis);
 extern int mantis_core_init(struct mantis_pci *mantis);
 extern int mantis_core_exit(struct mantis_pci *mantis);
+extern int mantis_rc_init(struct mantis_pci *mantis);
+extern int mantis_rc_exit(struct mantis_pci *mantis);
 //extern void mantis_fe_powerup(struct mantis_pci *mantis);
 //extern void mantis_fe_powerdown(struct mantis_pci *mantis);
 //extern void mantis_fe_reset(struct dvb_frontend *fe);
linux/drivers/media/dvb/mantis/mantis_pci.c +2 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_pci.c mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_pci.c
@@ -82,6 +82,7 @@
 		dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-0 *");
 	}
 	if (stat & MANTIS_INT_IRQ1) {
+		mantis->ir.ir_last_code = mmread(0xe8);
 		dprintk(verbose, MANTIS_DEBUG, 0, "* INT IRQ-1 *");
 	}
 	if (stat & MANTIS_INT_OCERR) {
@@ -245,6 +246,7 @@
 		dprintk(verbose, MANTIS_ERROR, 1, "Aeio, Mantis NULL ptr");
 		return;
 	}
+	mantis_rc_exit(mantis);
 	mantis_core_exit(mantis);
 	dprintk(verbose, MANTIS_ERROR, 1, "Removing -->Mantis irq: %d, latency: %d\n memory: 0x%lx, mmio: 0x%p",
 		pdev->irq, mantis->latency, mantis->mantis_addr,
linux/drivers/media/dvb/mantis/mantis_rc.c +154 -0

154 lines not on this page · raw message

linux/drivers/media/dvb/mantis/mantis_rc.h +1 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_rc.h mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_rc.h
@@ -0,0 +1 @@
+extern IR_KEYTAB_TYPE ir_codes_mantis_vp2033[IR_KEYTAB_SIZE];
linux/drivers/media/dvb/mantis/mantis_vp2033.c +2 -0
diff -urN mantis-a9ecd19a37c9.ORIG/linux/drivers/media/dvb/mantis/mantis_vp2033.c mantis-a9ecd19a37c9/linux/drivers/media/dvb/mantis/mantis_vp2033.c
@@ -20,6 +20,7 @@
 
 #include "mantis_common.h"
 #include "mantis_vp2033.h"
+#include "mantis_rc.h"
 
 #define MANTIS_MODEL_NAME	"VP-2033"
 #define MANTIS_DEV_TYPE		"DVB-C"
@@ -28,6 +29,7 @@
 	.model_name	= MANTIS_MODEL_NAME,
 	.dev_type	= MANTIS_DEV_TYPE,
 	.ts_size	= MANTIS_TS_204,
+	.ir_codes	= ir_codes_mantis_vp2033,
 };
 
 struct tda1002x_config philips_cu1216_config = {

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb