aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorEzequiel GarcĂ­a <elezegarcia@gmail.com>2012-03-26 08:13:32 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-04-10 19:41:39 -0400
commit2fd6f8d15371686e3fee87d6119cab9bc4d76349 (patch)
tree4ecf022b24d5fdda0d915f0034bc6aded16d07aa /drivers/media
parent37e65dceccf1b556afc17328fbdd782693807af9 (diff)
[media] em28xx: Move ir/rc related initialization to em28xx_ir_init()
Moving this helps isolating em28xx_input and will help converting it into a separate module. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c10
-rw-r--r--drivers/media/video/em28xx/em28xx-i2c.c3
-rw-r--r--drivers/media/video/em28xx/em28xx-input.c11
3 files changed, 11 insertions, 13 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 9fd8cc7dbb23..e3df8594ba26 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2849,13 +2849,6 @@ void em28xx_card_setup(struct em28xx *dev)
2849 break; 2849 break;
2850 } 2850 }
2851 2851
2852#if defined(CONFIG_MODULES) && defined(MODULE)
2853 if (dev->board.has_ir_i2c && !disable_ir)
2854 request_module("ir-kbd-i2c");
2855#endif
2856 if (dev->board.has_snapshot_button)
2857 em28xx_register_snapshot_button(dev);
2858
2859 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { 2852 if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
2860 em28xx_errdev("\n\n"); 2853 em28xx_errdev("\n\n");
2861 em28xx_errdev("The support for this board weren't " 2854 em28xx_errdev("The support for this board weren't "
@@ -2972,9 +2965,6 @@ static void flush_request_modules(struct em28xx *dev)
2972*/ 2965*/
2973void em28xx_release_resources(struct em28xx *dev) 2966void em28xx_release_resources(struct em28xx *dev)
2974{ 2967{
2975 if (dev->sbutton_input_dev)
2976 em28xx_deregister_snapshot_button(dev);
2977
2978 if (dev->ir) 2968 if (dev->ir)
2979 em28xx_ir_fini(dev); 2969 em28xx_ir_fini(dev);
2980 2970
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c
index a88e169dba23..185db65b766e 100644
--- a/drivers/media/video/em28xx/em28xx-i2c.c
+++ b/drivers/media/video/em28xx/em28xx-i2c.c
@@ -553,9 +553,6 @@ int em28xx_i2c_register(struct em28xx *dev)
553 if (i2c_scan) 553 if (i2c_scan)
554 em28xx_do_i2c_scan(dev); 554 em28xx_do_i2c_scan(dev);
555 555
556 /* Instantiate the IR receiver device, if present */
557 em28xx_register_i2c_ir(dev);
558
559 return 0; 556 return 0;
560} 557}
561 558
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c
index 2630b265b0e8..dd6e3f2dfba9 100644
--- a/drivers/media/video/em28xx/em28xx-input.c
+++ b/drivers/media/video/em28xx/em28xx-input.c
@@ -448,6 +448,15 @@ int em28xx_ir_init(struct em28xx *dev)
448 if (err) 448 if (err)
449 goto err_out_stop; 449 goto err_out_stop;
450 450
451 em28xx_register_i2c_ir(dev);
452
453#if defined(CONFIG_MODULES) && defined(MODULE)
454 if (dev->board.has_ir_i2c)
455 request_module("ir-kbd-i2c");
456#endif
457 if (dev->board.has_snapshot_button)
458 em28xx_register_snapshot_button(dev);
459
451 return 0; 460 return 0;
452 461
453 err_out_stop: 462 err_out_stop:
@@ -462,6 +471,8 @@ int em28xx_ir_fini(struct em28xx *dev)
462{ 471{
463 struct em28xx_IR *ir = dev->ir; 472 struct em28xx_IR *ir = dev->ir;
464 473
474 em28xx_deregister_snapshot_button(dev);
475
465 /* skip detach on non attached boards */ 476 /* skip detach on non attached boards */
466 if (!ir) 477 if (!ir)
467 return 0; 478 return 0;