aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-08 13:04:41 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 12:47:34 -0400
commitac07bb73fe226ae2088f060c63829afddb3f2403 (patch)
tree6bc41b41535236659b5469ef9fb8261eab8819df /drivers
parent7aedd5ec87686c557d48584d69ad880c11a0984d (diff)
V4L/DVB (12712): em28xx: properly load ir-kbd-i2c when needed
Currently, the logic to load ir i2c ancillary module is broken. It is associated to Hauppauge devices with IR flag on their eeprom, no matter if the device uses i2c or em28xx direct IR support. That's wrong. Instead, add a flag to the boards that use i2c IR chips and load the module only for those devices and if ir is not disabled. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c14
-rw-r--r--drivers/media/video/em28xx/em28xx.h1
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index c55634a674ba..a3d6d4ab9bc7 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -299,6 +299,7 @@ struct em28xx_board em28xx_boards[] = {
299 [EM2820_BOARD_TERRATEC_CINERGY_250] = { 299 [EM2820_BOARD_TERRATEC_CINERGY_250] = {
300 .name = "Terratec Cinergy 250 USB", 300 .name = "Terratec Cinergy 250 USB",
301 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 301 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
302 .has_ir_i2c = 1,
302 .tda9887_conf = TDA9887_PRESENT, 303 .tda9887_conf = TDA9887_PRESENT,
303 .decoder = EM28XX_SAA711X, 304 .decoder = EM28XX_SAA711X,
304 .input = { { 305 .input = { {
@@ -318,6 +319,7 @@ struct em28xx_board em28xx_boards[] = {
318 [EM2820_BOARD_PINNACLE_USB_2] = { 319 [EM2820_BOARD_PINNACLE_USB_2] = {
319 .name = "Pinnacle PCTV USB 2", 320 .name = "Pinnacle PCTV USB 2",
320 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 321 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
322 .has_ir_i2c = 1,
321 .tda9887_conf = TDA9887_PRESENT, 323 .tda9887_conf = TDA9887_PRESENT,
322 .decoder = EM28XX_SAA711X, 324 .decoder = EM28XX_SAA711X,
323 .input = { { 325 .input = { {
@@ -342,6 +344,7 @@ struct em28xx_board em28xx_boards[] = {
342 TDA9887_PORT2_ACTIVE, 344 TDA9887_PORT2_ACTIVE,
343 .decoder = EM28XX_TVP5150, 345 .decoder = EM28XX_TVP5150,
344 .has_msp34xx = 1, 346 .has_msp34xx = 1,
347 .has_ir_i2c = 1,
345 .input = { { 348 .input = { {
346 .type = EM28XX_VMUX_TELEVISION, 349 .type = EM28XX_VMUX_TELEVISION,
347 .vmux = TVP5150_COMPOSITE0, 350 .vmux = TVP5150_COMPOSITE0,
@@ -960,6 +963,7 @@ struct em28xx_board em28xx_boards[] = {
960 [EM2800_BOARD_TERRATEC_CINERGY_200] = { 963 [EM2800_BOARD_TERRATEC_CINERGY_200] = {
961 .name = "Terratec Cinergy 200 USB", 964 .name = "Terratec Cinergy 200 USB",
962 .is_em2800 = 1, 965 .is_em2800 = 1,
966 .has_ir_i2c = 1,
963 .tuner_type = TUNER_LG_PAL_NEW_TAPC, 967 .tuner_type = TUNER_LG_PAL_NEW_TAPC,
964 .tda9887_conf = TDA9887_PRESENT, 968 .tda9887_conf = TDA9887_PRESENT,
965 .decoder = EM28XX_SAA711X, 969 .decoder = EM28XX_SAA711X,
@@ -2277,7 +2281,7 @@ void em28xx_card_setup(struct em28xx *dev)
2277 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: 2281 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
2278 { 2282 {
2279 struct tveeprom tv; 2283 struct tveeprom tv;
2280#ifdef CONFIG_MODULES 2284#if defined(CONFIG_MODULES) && defined(MODULE)
2281 request_module("tveeprom"); 2285 request_module("tveeprom");
2282#endif 2286#endif
2283 /* Call first TVeeprom */ 2287 /* Call first TVeeprom */
@@ -2291,10 +2295,6 @@ void em28xx_card_setup(struct em28xx *dev)
2291 dev->i2s_speed = 2048000; 2295 dev->i2s_speed = 2048000;
2292 dev->board.has_msp34xx = 1; 2296 dev->board.has_msp34xx = 1;
2293 } 2297 }
2294#ifdef CONFIG_MODULES
2295 if (tv.has_ir)
2296 request_module("ir-kbd-i2c");
2297#endif
2298 break; 2298 break;
2299 } 2299 }
2300 case EM2882_BOARD_KWORLD_ATSC_315U: 2300 case EM2882_BOARD_KWORLD_ATSC_315U:
@@ -2335,6 +2335,10 @@ void em28xx_card_setup(struct em28xx *dev)
2335 break; 2335 break;
2336 } 2336 }
2337 2337
2338#if defined(CONFIG_MODULES) && defined(MODULE)
2339 if (dev->board.has_ir_i2c && !disable_ir)
2340 request_module("ir-kbd-i2c");
2341#endif
2338 if (dev->board.has_snapshot_button) 2342 if (dev->board.has_snapshot_button)
2339 em28xx_register_snapshot_button(dev); 2343 em28xx_register_snapshot_button(dev);
2340 2344
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index bc825bdd65be..0f2ba9a40d17 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -399,6 +399,7 @@ struct em28xx_board {
399 unsigned int has_snapshot_button:1; 399 unsigned int has_snapshot_button:1;
400 unsigned int is_webcam:1; 400 unsigned int is_webcam:1;
401 unsigned int valid:1; 401 unsigned int valid:1;
402 unsigned int has_ir_i2c:1;
402 403
403 unsigned char xclk, i2c_speed; 404 unsigned char xclk, i2c_speed;
404 unsigned char radio_addr; 405 unsigned char radio_addr;