diff -r 1557237aa2eb -r 83476a81ce48 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c	Tue May 19 22:29:10 2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mb.c	Sun Aug 02 19:52:22 2009 +0100
@@ -213,7 +213,7 @@

 	.rc_interval      = DEFAULT_RC_INTERVAL,
 	.rc_key_map       = dibusb_rc_keys,
-	.rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+	.rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
 	.rc_query         = dibusb_rc_query,

 	.i2c_algo         = &dibusb_i2c_algo,
@@ -297,7 +297,7 @@

 	.rc_interval      = DEFAULT_RC_INTERVAL,
 	.rc_key_map       = dibusb_rc_keys,
-	.rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+	.rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
 	.rc_query         = dibusb_rc_query,

 	.i2c_algo         = &dibusb_i2c_algo,
@@ -361,7 +361,7 @@

 	.rc_interval      = DEFAULT_RC_INTERVAL,
 	.rc_key_map       = dibusb_rc_keys,
-	.rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+	.rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
 	.rc_query         = dibusb_rc_query,

 	.i2c_algo         = &dibusb_i2c_algo,
@@ -418,7 +418,7 @@

 	.rc_interval      = DEFAULT_RC_INTERVAL,
 	.rc_key_map       = dibusb_rc_keys,
-	.rc_key_map_size  = 111, /* wow, that is ugly ... I want to load it
to the driver dynamically */
+	.rc_key_map_size  = 135, /* wow, that is ugly ... I want to load it
to the driver dynamically */
 	.rc_query         = dibusb_rc_query,

 	.i2c_algo         = &dibusb_i2c_algo,
diff -r 1557237aa2eb -r 83476a81ce48 linux/drivers/media/dvb/dvb-usb/dibusb-mc.c
--- a/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c	Tue May 19 22:29:10 2009 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dibusb-mc.c	Sun Aug 02 19:52:22 2009 +0100
@@ -81,7 +81,7 @@

 	.rc_interval      = DEFAULT_RC_INTERVAL,
 	.rc_key_map       = dibusb_rc_keys,
-	.rc_key_map_size  = 111, /* FIXME */
+	.rc_key_map_size  = 135, /* FIXME */
 	.rc_query         = dibusb_rc_query,

 	.i2c_algo         = &dibusb_i2c_algo,
diff -r 1557237aa2eb -r 83476a81ce48 linux/drivers/media/dvb/rtl2831/rtd2830u.c
--- a/linux/drivers/media/dvb/rtl2831/rtd2830u.c	Tue May 19 22:29:10 2009 +0200
+++ b/linux/drivers/media/dvb/rtl2831/rtd2830u.c	Sun Aug 02 19:52:22 2009 +0100
@@ -24,6 +24,7 @@

 #include "rtd2831u.h"
 #include "tuner_demod_io.h"
+#include "dibusb.h"

 DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);

@@ -58,45 +59,6 @@
 #define USB_EPA_CTL			0x0148
 /*(prev.line) epa contrl register */

-#ifdef RTL2831U_NEC_PROTOCOL
-static struct dvb_usb_rc_key rtd2831u_nec_keys[] = {
-	{0x03, 0xfc, KEY_1},
-	{0x01, 0xfe, KEY_2},
-	{0x06, 0xf9, KEY_3},
-	{0x09, 0xf6, KEY_4},
-	{0x1d, 0xe2, KEY_5},
-	{0x1f, 0xe0, KEY_6},
-	{0x0D, 0xf2, KEY_7},
-	{0x19, 0xe6, KEY_8},
-	{0x1b, 0xe4, KEY_9},
-	{0x15, 0xea, KEY_0},
-
-	{0x17, 0xe8, KEY_S},	/*show scan page */
-	{0x14, 0xeb, KEY_G},	/*start scan */
-	{0x1a, 0xe5, KEY_X},	/*stop scan */
-
-	{0x08, 0xf7, KEY_A},	/*de-interlace  ---> advance scanpage */
-
-	{0x0a, 0xf5, KEY_LEFT},	/*key_left */
-	{0x1e, 0xe1, KEY_RIGHT},	/*key_right */
-	{0x11, 0xee, KEY_BACKSPACE},	/*backspace */
-
-	{0x0a, 0xf5, KEY_VOLUMEDOWN},	/*vol- */
-	{0x1e, 0xe1, KEY_VOLUMEUP},	/*vol+ */
-	{0x10, 0xef, KEY_MUTE},	/*mute */
-
-	{0x05, 0xfa, KEY_CHANNELUP},	/*channel+ */
-	{0x02, 0xfd, KEY_CHANNELDOWN},	/*channel- */
-	{0x4f, 0xb0, KEY_LAST},	/*last channel */
-
-	{0x05, 0xfa, KEY_UP},	/*country + */
-	{0x02, 0xfd, KEY_DOWN},	/*country- */
-
-	{0x16, 0xe9, KEY_POWER},	/*End(poweroff) */
-	{0x4c, 0xb3, KEY_R},	/*Reboot  */
-};
-#endif
-
 #ifdef RTL2831U_RC5_PROTOCOL
 /* philip rc5 keys */
 static struct dvb_usb_rc_key rtd2831u_rc5_keys[] = {
@@ -137,28 +99,28 @@
 */

 static struct dvb_usb_rc_key rtd2831u_conceptronic_keys[] = {
-	{0x04, 0xfb, KEY_1},
-	{0x05, 0xfa, KEY_2},
-	{0x06, 0xf9, KEY_3},
-	{0x07, 0xf8, KEY_4},
-	{0x08, 0xf7, KEY_5},
-	{0x09, 0xf6, KEY_6},
-	{0x0a, 0xf5, KEY_7},
-	{0x1b, 0xe4, KEY_8},
-	{0x1f, 0xe0, KEY_9},
-	{0x0d, 0xf2, KEY_0},
+	{0x80, 0x04, KEY_1},
+	{0x80, 0x05, KEY_2},
+	{0x80, 0x06, KEY_3},
+	{0x80, 0x07, KEY_4},
+	{0x80, 0x08, KEY_5},
+	{0x80, 0x09, KEY_6},
+	{0x80, 0x0a, KEY_7},
+	{0x80, 0x1b, KEY_8},
+	{0x80, 0x1f, KEY_9},
+	{0x80, 0x0d, KEY_0},

-	{0x02, 0xfd, KEY_VOLUMEDOWN},	/*vol- */
-	{0x1a, 0xe5, KEY_VOLUMEUP},	/*vol+ */
-	{0x01, 0xfe, KEY_MUTE},	/*mute */
+	{0x80, 0x02, KEY_VOLUMEDOWN},	/*vol- */
+	{0x80, 0x1a, KEY_VOLUMEUP},	/*vol+ */
+	{0x80, 0x01, KEY_MUTE},	/*mute */

-	{0x1e, 0xe1, KEY_CHANNELUP},	/*channel+ */
-	{0x03, 0xfc, KEY_CHANNELDOWN},	/*channel- */
+	{0x80, 0x1e, KEY_CHANNELUP},	/*channel+ */
+	{0x80, 0x03, KEY_CHANNELDOWN},	/*channel- */

-	{0x12, 0xed, KEY_POWER},	/*End(poweroff) */
-	{0x0e, 0xf1, KEY_LAST},	/*last channel */
+	{0x80, 0x12, KEY_POWER},	/*End(poweroff) */
+	{0x80, 0x0e, KEY_LAST},	/*last channel */

-	{0x0c, 0xf3, KEY_ZOOM},	/* zoom was not assigned, now Z */
+	{0x80, 0x0c, KEY_ZOOM},	/* zoom was not assigned, now Z */
 };

 #endif
@@ -196,8 +158,8 @@
 	case RTL2831U_NEC_TYPE:
 		deb_info("Selected IR type 0x%02x\n", ir_protocol);
 		memcpy(reg_val, NEC_REG_VAL, sizeof(u8) * ARRAY_SIZE(reg_val));
-		d->props.rc_key_map = rtd2831u_nec_keys;
-		d->props.rc_key_map_size = ARRAY_SIZE(rtd2831u_nec_keys);
+		d->props.rc_key_map = dibusb_rc_keys;
+		d->props.rc_key_map_size = 135;
 		break;
 	case RTL2831U_RC5_TYPE:
 		deb_info("Selected IR type 0x%02x\n", ir_protocol);
@@ -237,47 +199,9 @@
 	return 1;
 }

-static int rtd2831u_rc_key_to_event(struct dvb_usb_device *d,
-				    u8 keybuf[4], u32 * event, int *state)
-{
-	int i;
-	struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
-	*event = 0;
-	*state = REMOTE_NO_KEY_PRESSED;
-
-	switch (ir_protocol) {
-	case RTL2831U_RC5_TYPE:
-		keybuf[0] = (keybuf[0] & 0x00);
-		keybuf[1] = (keybuf[1] & 0x00);
-		keybuf[2] = (keybuf[2] & 0x00);
-		keybuf[3] = (keybuf[3] & 0xff);
-		break;
-	}
-
-/* deb_info("raw key code 0x%02x, 0x%02x, 0x%02x,
0x%02x\n",keybuf[0], keybuf[1], keybuf[2], keybuf[3]); */
-	/* See if we can match the raw key code. */
-	for (i = 0; i < d->props.rc_key_map_size; i++)
-		if (keymap[i].custom == keybuf[2]
-		    && keymap[i].data == keybuf[3]) {
-			*event = keymap[i].event;
-			*state = REMOTE_KEY_PRESSED;
-			return 0;
-		}
-
-	if (*state != REMOTE_KEY_PRESSED) {
-		deb_info
-		    ("Unmatched raw key code 0x%02x, 0x%02x, 0x%02x, 0x%02x: please
try other setting for parameter ir_protocol\n",
-		     keybuf[0], keybuf[1], keybuf[2], keybuf[3]);
-	}
-
-	return 0;
-
-}
-
 static int rtd2831u_rc_query(struct dvb_usb_device *d, u32 * event, int *state)
 {
-	u8 key[4];
-	u8 b = 0xcc;
+	u8 key[5] = {0xcc, 0, 0, 0, 0};
 	struct rtl2831u_rc_state *p_rc_state = d->priv;
