diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 91c70eb..919520f 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -143,7 +143,7 @@
 		.tuner_type	= TUNER_PHILIPS_PAL,
 		.tda9887_conf	= TDA9887_PRESENT|TDA9887_PORT1_ACTIVE|TDA9887_PORT2_ACTIVE,
 		.has_tuner	= 1,
-		.decoder      = EM2820_SAA7114,
+		.decoder        = EM2820_SAA7114,
 		.input          = {{
 			.type     = EM2820_VMUX_TELEVISION,
 			.vmux     = 2,
@@ -250,6 +250,7 @@
 		struct tveeprom tv;
 #ifdef CONFIG_MODULES
 		request_module("tveeprom");
+		request_module("ir-kbd-i2c");
 #endif
 		/* Call first TVeeprom */
 
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index a7b6f67..f6bfc03 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -26,10 +26,10 @@
 #include <linux/kernel.h>
 #include <linux/usb.h>
 #include <linux/i2c.h>
-#include <media/tuner.h>
 #include <linux/video_decoder.h>
 
 #include "em2820.h"
+#include <media/tuner.h>
 
 /* ----------------------------------------------------------- */
 
@@ -41,14 +41,11 @@
 module_param(i2c_debug, int, 0644);
 MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
 
-#define dprintk(fmt, args...) if (i2c_debug) do {\
-			printk(KERN_DEBUG "%s: %s: " fmt "\n",\
-			dev->name, __FUNCTION__ , ##args); } while (0)
-#define dprintk1(fmt, args...) if (i2c_debug) do{ \
-			printk(KERN_DEBUG "%s: %s: " fmt, \
-			dev->name, __FUNCTION__ , ##args); } while (0)
-#define dprintk2(fmt, args...) if (i2c_debug) do {\
+#define dprintk1(lvl,fmt, args...) if (i2c_debug>=lvl) do {\
 			printk(fmt , ##args); } while (0)
+#define dprintk2(lvl,fmt, args...) if (i2c_debug>=lvl) do{ \
+			printk(KERN_DEBUG "%s at %s: " fmt, \
+			dev->name, __FUNCTION__ , ##args); } while (0)
 
 /*
  * em2800_i2c_send_max4()
@@ -238,7 +235,7 @@
 		return 0;
 	for (i = 0; i < num; i++) {
 		addr = msgs[i].addr << 1;
-		dprintk1("%s %s addr=%x len=%d:",
+		dprintk2(2,"%s %s addr=%x len=%d:",
 			 (msgs[i].flags & I2C_M_RD) ? "read" : "write",
 			 i == num - 1 ? "stop" : "nonstop", addr, msgs[i].len);
 		if (!msgs[i].len) {	/* no len: check only for device presence */
@@ -247,7 +244,7 @@
 			else
 				rc = em2820_i2c_check_for_device(dev, addr);
 			if (rc < 0) {
-				dprintk2(" no device\n");
+				dprintk2(2," no device\n");
 				return rc;
 			}
 
@@ -261,14 +258,14 @@
 				rc = em2820_i2c_recv_bytes(dev, addr,
 							   msgs[i].buf,
 							   msgs[i].len);
-			if (i2c_debug) {
+			if (i2c_debug>=2) {
 				for (byte = 0; byte < msgs[i].len; byte++) {
 					printk(" %02x", msgs[i].buf[byte]);
 				}
 			}
 		} else {
 			/* write bytes */
-			if (i2c_debug) {
+			if (i2c_debug>=2) {
 				for (byte = 0; byte < msgs[i].len; byte++)
 					printk(" %02x", msgs[i].buf[byte]);
 			}
@@ -284,13 +281,13 @@
 			if (rc < 0)
 				goto err;
 		}
-		if (i2c_debug)
+		if (i2c_debug>=2)
 			printk("\n");
 	}
 
 	return num;
       err:
-	dprintk2(" ERROR: %i\n", rc);
+	dprintk2(2," ERROR: %i\n", rc);
 	return rc;
 }
 
@@ -436,26 +433,34 @@
 {
 	struct em2820 *dev = client->adapter->algo_data;
 
-	dprintk("address %x", client->addr << 1);
 	switch (client->addr << 1) {
 		case 0x86:
 			em2820_i2c_call_clients(dev, TDA9887_SET_CONFIG, &dev->tda9887_conf);
 			break;
 		case 0x4a:
-			dprintk1("attach_inform: saa7113 detected.\n");
+			dprintk1(1,"attach_inform: saa7113 detected.\n");
 			break;
 		case 0xa0:
-			dprintk1("attach_inform: eeprom detected.\n");
+			dprintk1(1,"attach_inform: eeprom detected.\n");
 			break;
+		case 0x60:
+		case 0x8e:
+		{
+			struct IR_i2c *ir = i2c_get_clientdata(client);
+			dprintk1(1,"attach_inform: IR detected (%s).\n",ir->phys);
+			em2820_set_ir(dev,ir);
+			break;
+		}
 		case 0x80:
 		case 0x88:
-			dprintk1("attach_inform: msp34xx detected.\n");
+			dprintk1(1,"attach_inform: msp34xx detected.\n");
 			break;
 		case 0xb8:
 		case 0xba:
-			dprintk1("attach_inform: tvp5150 detected.\n");
+			dprintk1(1,"attach_inform: tvp5150 detected.\n");
 			break;
 		default:
+			dprintk1(1,"attach inform: detected I2C address %x\n", client->addr << 1);
 			dev->tuner_addr = client->addr;
 			em2820_set_tuner(-1, client);
 	}
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
new file mode 100644
index 0000000..d6b3e15
--- /dev/null
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -0,0 +1,150 @@
+/*
+ *
+ * handle saa7134 IR remotes via linux kernel input layer.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/sched.h>
+#include <linux/interrupt.h>
+#include <linux/input.h>
+#include <linux/usb.h>
+
+#include "em2820.h"
+
+static unsigned int disable_ir = 0;
+module_param(disable_ir, int, 0444);
+MODULE_PARM_DESC(disable_ir,"disable infrared remote support");
+
+static unsigned int ir_debug = 0;
+module_param(ir_debug, int, 0644);
+MODULE_PARM_DESC(ir_debug,"enable debug messages [IR]");
+
+#define dprintk(fmt, arg...)	if (ir_debug) \
+	printk(KERN_DEBUG "%s/ir: " fmt, ir->c.name , ## arg)
+
+/* ---------------------------------------------------------------------- */
+
+static IR_KEYTAB_TYPE ir_codes_em_pinnacle[IR_KEYTAB_SIZE] = {
+	[  0 ] = KEY_CHANNEL,
+	[  1 ] = KEY_SELECT,
+	[  2 ] = KEY_MUTE,
+	[  3 ] = KEY_POWER,
+	[  4 ] = KEY_KP1,
+	[  5 ] = KEY_KP2,
+	[  6 ] = KEY_KP3,
+	[  7 ] = KEY_CHANNELUP,
+	[  8 ] = KEY_KP4,
+	[  9 ] = KEY_KP5,
+	[ 10 ] = KEY_KP6,
+
+	[ 11 ] = KEY_CHANNELDOWN,
+	[ 12 ] = KEY_KP7,
+	[ 13 ] = KEY_KP8,
+	[ 14 ] = KEY_KP9,
+	[ 15 ] = KEY_VOLUMEUP,
+	[ 16 ] = KEY_KP0,
+	[ 17 ] = KEY_MENU,
+	[ 18 ] = KEY_PRINT,
+
+	[ 19 ] = KEY_VOLUMEDOWN,
+	[ 21 ] = KEY_PAUSE,
+	[ 23 ] = KEY_RECORD,
+	[ 24 ] = KEY_REWIND,
+	[ 25 ] = KEY_PLAY,
+	[ 27 ] = KEY_BACKSPACE,
+	[ 29 ] = KEY_STOP,
+	[ 31 ] = KEY_ZOOM,
+};
+
+/* ----------------------------------------------------------------------- */
+
+static int get_key_em_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
+{
+	unsigned char buf[2];
+	unsigned char code;
+
+	/* poll IR chip */
+	if (2 != i2c_master_recv(&ir->c,buf,2))
+		return -EIO;
+
+	/* Does eliminate repeated parity code */
+	if (buf[1]==0xff)
+		return 0;
+
+	/* avoid fast reapeating */
+	if (buf[1]==ir->old)
+		return 0;
+	ir->old=buf[1];
+
+	/* Rearranges bits to the right order */
+	code=    ((buf[0]&0x01)<<5) | /* 0010 0000 */
+		 ((buf[0]&0x02)<<3) | /* 0001 0000 */
+		 ((buf[0]&0x04)<<1) | /* 0000 1000 */
+		 ((buf[0]&0x08)>>1) | /* 0000 0100 */
+		 ((buf[0]&0x10)>>3) | /* 0000 0010 */
+		 ((buf[0]&0x20)>>5);  /* 0000 0001 */
+
+	dprintk("ir hauppauge (em2840): code=0x%02x (rcv=0x%02x)\n",code,buf[0]);
+
+	/* return key */
+	*ir_key = code;
+	*ir_raw = code;
+	return 1;
+}
+
+/* ----------------------------------------------------------------------- */
+void em2820_set_ir(struct em2820 * dev,struct IR_i2c *ir)
+{
+	if (disable_ir)
+		return ;
+
+	/* detect & configure */
+	switch (dev->model) {
+	case (EM2800_BOARD_UNKNOWN):
+		break;
+	case (EM2820_BOARD_UNKNOWN):
+		break;
+	case (EM2820_BOARD_TERRATEC_CINERGY_250):
+		break;
+	case (EM2820_BOARD_PINNACLE_USB_2):
+		ir->ir_codes = ir_codes_em_pinnacle;
+		break;
+	case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
+		ir->ir_codes = ir_codes_hauppauge_new;
+		ir->get_key = get_key_em_haup;
+		snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (EM2840 Hauppage)");
+		break;
+	case (EM2820_BOARD_MSI_VOX_USB_2):
+		break;
+	case (EM2800_BOARD_TERRATEC_CINERGY_200):
+		break;
+	case (EM2800_BOARD_LEADTEK_WINFAST_USBII):
+		break;
+	case (EM2800_BOARD_KWORLD_USB2800):
+		break;
+	}
+}
+
+/* ----------------------------------------------------------------------
+ * Local variables:
+ * c-basic-offset: 8
+ * End:
+ */
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index d3a959b..f3fc44b 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -28,10 +28,10 @@
 #include <linux/kernel.h>
 #include <linux/usb.h>
 #include <linux/i2c.h>
-#include <media/tuner.h>
 #include <linux/video_decoder.h>
 
 #include "em2820.h"
+#include <media/tuner.h>
 
 #define DRIVER_AUTHOR "Markus Rechberger <mrechberger@gmail.com>, " \
 			"Ludovico Cavedon <cavedon@sssup.it>, " \
@@ -1699,15 +1699,22 @@
 	struct usb_device *udev;
 	struct em2820 *dev = NULL;
 	int retval = -ENODEV;
-	int model,i,nr;
+	int model,i,nr,ifnum;
 
 	udev = usb_get_dev(interface_to_usbdev(interface));
-	endpoint = &interface->cur_altsetting->endpoint[1].desc;
+	ifnum = interface->altsetting[0].desc.bInterfaceNumber;
+
+	em2820_err(DRIVER_NAME " new device (%04x:%04x): interface %i, class %i\n",
+			udev->descriptor.idVendor,udev->descriptor.idProduct,
+			ifnum,
+			interface->altsetting[0].desc.bInterfaceClass);
 
 	/* Don't register audio interfaces */
-	if (interface->altsetting[1].desc.bInterfaceClass == USB_CLASS_AUDIO)
+	if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO)
 		return -ENODEV;
 
+	endpoint = &interface->cur_altsetting->endpoint[1].desc;
+
 	/* check if the the device has the iso in endpoint at the correct place */
 	if ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) !=
 	    USB_ENDPOINT_XFER_ISOC) {
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 4115938..31b23f0 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -27,6 +27,7 @@
 
 #include <linux/videodev.h>
 #include <linux/i2c.h>
+#include <media/ir-kbd-i2c.h>
 
 /* Boards supported by driver */
 
@@ -53,19 +54,12 @@
 /* number of buffers for isoc transfers */
 #define EM2820_NUM_BUFS 5
 
-/* number of packets for each buffer */
-// windows requests only 40 packets .. so we better do the same
-// this is what I found out for all alternate numbers there!
-
+/* number of packets for each buffer
+   windows requests only 40 packets .. so we better do the same
+   this is what I found out for all alternate numbers there!
+ */
 #define EM2820_NUM_PACKETS 40
 
-/* packet size for each packet */
-/* no longer needed: read from endpoint descriptor */
-//#define EM2820_MAX_PACKET_SIZE 3072 //7
-//#define EM2820_MAX_PACKET_SIZE 2892 //6
-//#define EM2820_MAX_PACKET_SIZE 2580 //5
-//#define EM2820_MAX_PACKET_SIZE 1448 //2
-
 /* default alternate; 0 means choose the best */
 #define EM2820_PINOUT 0
 #define EM2820_MAX_ALT 7
@@ -292,6 +286,10 @@
 int em2820_i2c_register(struct em2820 *dev);
 int em2820_i2c_unregister(struct em2820 *dev);
 
+/* Provided by em2820-input.c */
+
+void em2820_set_ir(struct em2820 * dev,struct IR_i2c *ir);
+
 /* Provided by em2820-core.c */
 
 void em2820_print_ioctl(char *name, unsigned int cmd);
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index aec710f..8cc3f8a 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -41,101 +41,71 @@
 #include <linux/workqueue.h>
 #include <asm/semaphore.h>
 #include <media/ir-common.h>
-
-static IR_KEYTAB_TYPE ir_codes_em2820[IR_KEYTAB_SIZE] = {
- 	[ 0x01 ] = KEY_CHANNEL,
- 	[ 0x02 ] = KEY_SELECT,
- 	[ 0x03 ] = KEY_MUTE,
- 	[ 0x04 ] = KEY_POWER,
- 	[ 0x05 ] = KEY_KP1,
- 	[ 0x06 ] = KEY_KP2,
- 	[ 0x07 ] = KEY_KP3,
- 	[ 0x08 ] = KEY_CHANNELUP,
- 	[ 0x09 ] = KEY_KP4,
- 	[ 0x0a ] = KEY_KP5,
- 	[ 0x0b ] = KEY_KP6,
- 	[ 0x0c ] = KEY_CHANNELDOWN,
- 	[ 0x0d ] = KEY_KP7,
- 	[ 0x0e ] = KEY_KP8,
- 	[ 0x0f ] = KEY_KP9,
- 	[ 0x10 ] = KEY_VOLUMEUP,
- 	[ 0x11 ] = KEY_KP0,
- 	[ 0x12 ] = KEY_MENU,
- 	[ 0x13 ] = KEY_PRINT,
- 	[ 0x14 ] = KEY_VOLUMEDOWN,
- 	[ 0x16 ] = KEY_PAUSE,
- 	[ 0x18 ] = KEY_RECORD,
- 	[ 0x19 ] = KEY_REWIND,
- 	[ 0x1a ] = KEY_PLAY,
-	[ 0x1b ] = KEY_FORWARD,
-	[ 0x1c ] = KEY_BACKSPACE,
- 	[ 0x1e ] = KEY_STOP,
- 	[ 0x40 ] = KEY_ZOOM,
-};
+#include <media/ir-kbd-i2c.h>
 
 /* Mark Phalan <phalanm@o2.ie> */
 static IR_KEYTAB_TYPE ir_codes_pv951[IR_KEYTAB_SIZE] = {
-	[ 0x00 ] = KEY_KP0,
-	[ 0x01 ] = KEY_KP1,
-	[ 0x02 ] = KEY_KP2,
-	[ 0x03 ] = KEY_KP3,
-	[ 0x04 ] = KEY_KP4,
-	[ 0x05 ] = KEY_KP5,
-	[ 0x06 ] = KEY_KP6,
-	[ 0x07 ] = KEY_KP7,
-	[ 0x08 ] = KEY_KP8,
-	[ 0x09 ] = KEY_KP9,
+	[  0 ] = KEY_KP0,
+	[  1 ] = KEY_KP1,
+	[  2 ] = KEY_KP2,
+	[  3 ] = KEY_KP3,
+	[  4 ] = KEY_KP4,
+	[  5 ] = KEY_KP5,
+	[  6 ] = KEY_KP6,
+	[  7 ] = KEY_KP7,
+	[  8 ] = KEY_KP8,
+	[  9 ] = KEY_KP9,
 
-	[ 0x12 ] = KEY_POWER,
-	[ 0x10 ] = KEY_MUTE,
-	[ 0x1f ] = KEY_VOLUMEDOWN,
-	[ 0x1b ] = KEY_VOLUMEUP,
-	[ 0x1a ] = KEY_CHANNELUP,
-	[ 0x1e ] = KEY_CHANNELDOWN,
-	[ 0x0e ] = KEY_PAGEUP,
-	[ 0x1d ] = KEY_PAGEDOWN,
-	[ 0x13 ] = KEY_SOUND,
+	[ 18 ] = KEY_POWER,
+	[ 16 ] = KEY_MUTE,
+	[ 31 ] = KEY_VOLUMEDOWN,
+	[ 27 ] = KEY_VOLUMEUP,
+	[ 26 ] = KEY_CHANNELUP,
+	[ 30 ] = KEY_CHANNELDOWN,
+	[ 14 ] = KEY_PAGEUP,
+	[ 29 ] = KEY_PAGEDOWN,
+	[ 19 ] = KEY_SOUND,
 
-	[ 0x18 ] = KEY_KPPLUSMINUS,	/* CH +/- */
-	[ 0x16 ] = KEY_SUBTITLE,		/* CC */
-	[ 0x0d ] = KEY_TEXT,		/* TTX */
-	[ 0x0b ] = KEY_TV,		/* AIR/CBL */
-	[ 0x11 ] = KEY_PC,		/* PC/TV */
-	[ 0x17 ] = KEY_OK,		/* CH RTN */
-	[ 0x19 ] = KEY_MODE, 		/* FUNC */
-	[ 0x0c ] = KEY_SEARCH, 		/* AUTOSCAN */
+	[ 24 ] = KEY_KPPLUSMINUS,	/* CH +/- */
+	[ 22 ] = KEY_SUBTITLE,		/* CC */
+	[ 13 ] = KEY_TEXT,		/* TTX */
+	[ 11 ] = KEY_TV,		/* AIR/CBL */
+	[ 17 ] = KEY_PC,		/* PC/TV */
+	[ 23 ] = KEY_OK,		/* CH RTN */
+	[ 25 ] = KEY_MODE, 		/* FUNC */
+	[ 12 ] = KEY_SEARCH, 		/* AUTOSCAN */
 
 	/* Not sure what to do with these ones! */
-	[ 0x0f ] = KEY_SELECT, 		/* SOURCE */
-	[ 0x0a ] = KEY_KPPLUS,		/* +100 */
-	[ 0x14 ] = KEY_KPEQUAL,		/* SYNC */
-	[ 0x1c ] = KEY_MEDIA,             /* PC/TV */
+	[ 15 ] = KEY_SELECT, 		/* SOURCE */
+	[ 10 ] = KEY_KPPLUS,		/* +100 */
+	[ 20 ] = KEY_KPEQUAL,		/* SYNC */
+	[ 28 ] = KEY_MEDIA,             /* PC/TV */
 };
 
 static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = {
-	[ 0x03 ] = KEY_POWER,
+	[ 0x3  ] = KEY_POWER,
 	[ 0x6f ] = KEY_MUTE,
 	[ 0x10 ] = KEY_BACKSPACE,	/* Recall */
 
 	[ 0x11 ] = KEY_KP0,
-	[ 0x04 ] = KEY_KP1,
-	[ 0x05 ] = KEY_KP2,
-	[ 0x06 ] = KEY_KP3,
-	[ 0x08 ] = KEY_KP4,
-	[ 0x09 ] = KEY_KP5,
-	[ 0x0a ] = KEY_KP6,
-	[ 0x0c ] = KEY_KP7,
-	[ 0x0d ] = KEY_KP8,
-	[ 0x0e ] = KEY_KP9,
+	[ 0x4  ] = KEY_KP1,
+	[ 0x5  ] = KEY_KP2,
+	[ 0x6  ] = KEY_KP3,
+	[ 0x8  ] = KEY_KP4,
+	[ 0x9  ] = KEY_KP5,
+	[ 0xa  ] = KEY_KP6,
+	[ 0xc  ] = KEY_KP7,
+	[ 0xd  ] = KEY_KP8,
+	[ 0xe  ] = KEY_KP9,
 	[ 0x12 ] = KEY_KPDOT,		/* 100+ */
 
-	[ 0x07 ] = KEY_VOLUMEUP,
-	[ 0x0b ] = KEY_VOLUMEDOWN,
+	[ 0x7  ] = KEY_VOLUMEUP,
+	[ 0xb  ] = KEY_VOLUMEDOWN,
 	[ 0x1a ] = KEY_KPPLUS,
 	[ 0x18 ] = KEY_KPMINUS,
 	[ 0x15 ] = KEY_UP,
 	[ 0x1d ] = KEY_DOWN,
-	[ 0x0f ] = KEY_CHANNELUP,
+	[ 0xf  ] = KEY_CHANNELUP,
 	[ 0x13 ] = KEY_CHANNELDOWN,
 	[ 0x48 ] = KEY_ZOOM,
 
@@ -152,17 +122,6 @@
 
 };
 
-struct IR {
-	struct i2c_client      c;
-	struct input_dev       *input;
-	struct ir_input_state  ir;
-
-	struct work_struct     work;
-	struct timer_list      timer;
-	char                   phys[32];
-	int                    (*get_key)(struct IR*, u32*, u32*);
-};
-
 /* ----------------------------------------------------------------------- */
 /* insmod parameters                                                       */
 
@@ -173,12 +132,9 @@
 #define dprintk(level, fmt, arg...)	if (debug >= level) \
 	printk(KERN_DEBUG DEVNAME ": " fmt , ## arg)
 
-#define IR_PINNACLE_REMOTE 0x01
-#define IR_TERRATEC_REMOTE 0x02
-
 /* ----------------------------------------------------------------------- */
 
-static int get_key_haup(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
 	unsigned char buf[3];
 	int start, toggle, dev, code;
@@ -205,7 +161,7 @@
 	return 1;
 }
 
-static int get_key_pixelview(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_pixelview(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
         unsigned char b;
 
@@ -219,7 +175,7 @@
 	return 1;
 }
 
-static int get_key_pv951(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_pv951(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
         unsigned char b;
 
@@ -239,7 +195,7 @@
 	return 1;
 }
 
-static int get_key_knc1(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_knc1(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
 	unsigned char b;
 
@@ -267,7 +223,7 @@
 	return 1;
 }
 
-static int get_key_purpletv(struct IR *ir, u32 *ir_key, u32 *ir_raw)
+static int get_key_purpletv(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
         unsigned char b;
 
@@ -289,10 +245,9 @@
 	*ir_raw = b;
 	return 1;
 }
-
 /* ----------------------------------------------------------------------- */
 
-static void ir_key_poll(struct IR *ir)
+static void ir_key_poll(struct IR_i2c *ir)
 {
 	static u32 ir_key, ir_raw;
 	int rc;
@@ -313,13 +268,13 @@
 
 static void ir_timer(unsigned long data)
 {
-	struct IR *ir = (struct IR*)data;
+	struct IR_i2c *ir = (struct IR_i2c*)data;
 	schedule_work(&ir->work);
 }
 
 static void ir_work(void *data)
 {
-	struct IR *ir = data;
+	struct IR_i2c *ir = data;
 	ir_key_poll(ir);
 	mod_timer(&ir->timer, jiffies+HZ/10);
 }
@@ -351,10 +306,10 @@
 	IR_KEYTAB_TYPE *ir_codes = NULL;
 	char *name;
 	int ir_type;
-        struct IR *ir;
+        struct IR_i2c *ir;
 	struct input_dev *input_dev;
 
-	ir = kzalloc(sizeof(struct IR), GFP_KERNEL);
+	ir = kzalloc(sizeof(struct IR_i2c), GFP_KERNEL);
 	input_dev = input_allocate_device();
 	if (!ir || !input_dev) {
 		kfree(ir);
@@ -390,36 +345,18 @@
 		ir_codes    = ir_codes_rc5_tv;
 		break;
 	case 0x30:
-		switch(kind){
-		case IR_TERRATEC_REMOTE:
-			name        = "Terratec IR";
-			ir->get_key = get_key_knc1;
-			ir_type     = IR_TYPE_OTHER;
-			ir_codes    = ir_codes_em2820;
-			break;
-		default:
-			name        = "KNC One";
-			ir->get_key = get_key_knc1;
-			ir_type     = IR_TYPE_OTHER;
-			ir_codes    = ir_codes_empty;
-		}
+		name        = "KNC One";
+		ir->get_key = get_key_knc1;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_empty;
 		break;
-	case 0x47:
 	case 0x7a:
-		switch(kind){
-		case IR_PINNACLE_REMOTE:
-			name        = "Pinnacle IR Remote";
-			ir->get_key = get_key_purpletv;
-			ir_type     = IR_TYPE_OTHER;
-			ir_codes    = ir_codes_em2820;
-			break;
-		default:
-			name        = "Purple TV";
-			ir->get_key = get_key_purpletv;
-			ir_type     = IR_TYPE_OTHER;
-			ir_codes    = ir_codes_purpletv;
-		}
+		name        = "Purple TV";
+		ir->get_key = get_key_purpletv;
+		ir_type     = IR_TYPE_OTHER;
+		ir_codes    = ir_codes_purpletv;
 		break;
+
 	default:
 		/* shouldn't happen */
 		printk(DEVNAME ": Huh? unknown i2c address (0x%02x)?\n",addr);
@@ -427,12 +364,18 @@
 		return -1;
 	}
 
-	/* register i2c device */
-	i2c_attach_client(&ir->c);
+	/* Sets name and its physical addr */
 	snprintf(ir->c.name, sizeof(ir->c.name), "i2c IR (%s)", name);
 	snprintf(ir->phys, sizeof(ir->phys), "%s/%s/ir0",
 		 ir->c.adapter->dev.bus_id,
 		 ir->c.dev.bus_id);
+	ir->ir_codes=ir_codes;
+
+	/* register i2c device
+	 * At device register, IR codes may be changed to be
+	 * board dependent.
+	*/
+	i2c_attach_client(&ir->c);
 
 	/* init + register input device */
 	ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
@@ -440,6 +383,7 @@
 	input_dev->name		= ir->c.name;
 	input_dev->phys		= ir->phys;
 
+	/* register event device */
 	input_register_device(ir->input);
 
 	/* start polling via eventd */
@@ -454,7 +398,7 @@
 
 static int ir_detach(struct i2c_client *client)
 {
-        struct IR *ir = i2c_get_clientdata(client);
+        struct IR_i2c *ir = i2c_get_clientdata(client);
 
 	/* kill outstanding polls */
 	del_timer(&ir->timer);
@@ -483,11 +427,9 @@
 
 	static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
 	static const int probe_saa7134[] = { 0x7a, -1 };
-	static const int probe_em2820[] = { 0x47, 0x30, -1 };
+	static const int probe_em2820[] = { 0x30, 0x47, -1 };
 	const int *probe = NULL;
-	int attached = 0;
-
-	struct i2c_client c; unsigned char buf; int i,rc;
+	struct i2c_client c; char buf; int i,rc;
 
 	switch (adap->id) {
 	case I2C_HW_B_BT848:
@@ -505,27 +447,15 @@
 
 	memset(&c,0,sizeof(c));
 	c.adapter = adap;
-	for (i = 0; -1 != probe[i] && attached != 1; i++) {
+	for (i = 0; -1 != probe[i]; i++) {
 		c.addr = probe[i];
-		rc = i2c_master_recv(&c,&buf,1);
+		rc = i2c_master_recv(&c,&buf,0);
 		dprintk(1,"probe 0x%02x @ %s: %s\n",
 			probe[i], adap->name,
-			(1 == rc) ? "yes" : "no");
-		switch(adap->id){
-			case I2C_HW_B_BT848:
-			case I2C_HW_SAA7134:
-				if (1 == rc) {
-					ir_attach(adap,probe[i],0,0);
-					attached=1;
-					break;
-				}
-			case I2C_HW_B_EM2820:
-				/* windows logs are needed for fixing the pinnacle device */
-				if (1 == rc && 0xff == buf){
-					ir_attach(adap,probe[i],0,IR_TERRATEC_REMOTE);
-					attached=1;
-				}
-				break;
+			(0 == rc) ? "yes" : "no");
+		if (0 == rc) {
+			ir_attach(adap,probe[i],0,0);
+			break;
 		}
 	}
 	return 0;
