summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-cards.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-05-27 15:32:23 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-05-27 15:32:23 -0300
commit9c9fd460173573929daf32f42a502283a9aaae26 (patch)
treea6b7c0cc7cbb0789f837508394263ccaf1df31ca /linux/drivers/media/video/em28xx/em28xx-cards.c
parentfa6bf06d0bc8a417de4d20da09191a12baf5b6a4 (diff)
downloadmediapointer-dvb-s2-9c9fd460173573929daf32f42a502283a9aaae26.tar.gz
mediapointer-dvb-s2-9c9fd460173573929daf32f42a502283a9aaae26.tar.bz2
Building system: Restore compilation with kernels older than 2.6.29
From: Mauro Carvalho Chehab <mchehab@redhat.com> Mostly due to ir-kdb-i2c, but also due to two new drivers, compilation with kernels older than 2.6.29 were broken. This quick and dirty changeset, generated semi-automatically, restaures backport to the subsystem by adding lots of #ifs. It is possible to write a much more small changeset that would restore backport without adding so many ifs, but, due to the lack of time, this will also solve it. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-cards.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-cards.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-cards.c b/linux/drivers/media/video/em28xx/em28xx-cards.c
index c765d769b..384aead65 100644
--- a/linux/drivers/media/video/em28xx/em28xx-cards.c
+++ b/linux/drivers/media/video/em28xx/em28xx-cards.c
@@ -1981,8 +1981,18 @@ static int em28xx_hint_board(struct em28xx *dev)
}
/* ----------------------------------------------------------------------- */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+void em28xx_set_ir(struct em28xx *dev, struct IR_i2c *ir)
+#else
void em28xx_register_i2c_ir(struct em28xx *dev)
+#endif
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ if (disable_ir) {
+ ir->get_key = NULL;
+ return ;
+ }
+#else
struct i2c_board_info info;
struct IR_i2c_init_data init_data;
const unsigned short addr_list[] = {
@@ -1995,6 +2005,7 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
memset(&info, 0, sizeof(struct i2c_board_info));
memset(&init_data, 0, sizeof(struct IR_i2c_init_data));
strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
+#endif
/* detect & configure */
switch (dev->model) {
@@ -2004,19 +2015,40 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
break;
case (EM2800_BOARD_TERRATEC_CINERGY_200):
case (EM2820_BOARD_TERRATEC_CINERGY_250):
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ ir->ir_codes = ir_codes_em_terratec;
+ ir->get_key = em28xx_get_key_terratec;
+ snprintf(ir->name, sizeof(ir->name),
+ "i2c IR (EM28XX Terratec)");
+#else
init_data.ir_codes = ir_codes_em_terratec;
init_data.get_key = em28xx_get_key_terratec;
init_data.name = "i2c IR (EM28XX Terratec)";
+#endif
break;
case (EM2820_BOARD_PINNACLE_USB_2):
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ ir->ir_codes = ir_codes_pinnacle_grey;
+ ir->get_key = em28xx_get_key_pinnacle_usb_grey;
+ snprintf(ir->name, sizeof(ir->name),
+ "i2c IR (EM28XX Pinnacle PCTV)");
+#else
init_data.ir_codes = ir_codes_pinnacle_grey;
init_data.get_key = em28xx_get_key_pinnacle_usb_grey;
init_data.name = "i2c IR (EM28XX Pinnacle PCTV)";
+#endif
break;
case (EM2820_BOARD_HAUPPAUGE_WINTV_USB_2):
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
+ ir->ir_codes = ir_codes_hauppauge_new;
+ ir->get_key = em28xx_get_key_em_haup;
+ snprintf(ir->name, sizeof(ir->name),
+ "i2c IR (EM2840 Hauppauge)");
+#else
init_data.ir_codes = ir_codes_hauppauge_new;
init_data.get_key = em28xx_get_key_em_haup;
init_data.name = "i2c IR (EM2840 Hauppauge)";
+#endif
break;
case (EM2820_BOARD_MSI_VOX_USB_2):
break;
@@ -2027,10 +2059,12 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
case (EM2800_BOARD_GRABBEEX_USB2800):
break;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
if (init_data.name)
info.platform_data = &init_data;
i2c_new_probed_device(&dev->i2c_adap, &info, addr_list);
+#endif
}
void em28xx_card_setup(struct em28xx *dev)