[PATCH] v4l: 784: several improvement on i2c ir handling for em2820

- Several Improvement on I2C IR handling for em2820:
        - moved Pinnacle IR table (ir_codes_em2820) to em2820-input.c
        - IR struct renamed and moved to a header file.
        - New file to handle em2820-specific IR.
        - Some cleanups.
        - attach now detects I2C IR and calls em2820-specific IR code
        - IR compat code moved to compat.h
        - New header with struct IR_i2c there, to allow it to be
          used by board-specific input handlers.

- Some improvements at em28xx board detection:
        - Board detection message improved to show interface and class.
        - Now it doesn't touch audio interfaces.

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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) {