diff options
author | Ezequiel GarcĂa <elezegarcia@gmail.com> | 2012-03-26 08:13:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-10 19:45:41 -0400 |
commit | f4d4e7656b26a6013bc5072c946920d2e2c44e8e (patch) | |
tree | cdc8d2054dbe27d4b4cbf93e615fa0700ea7e2d8 | |
parent | 769af2146a93c27c8834dbca54c02cd67468036d (diff) |
[media] em28xx: Make em28xx-input.c a separate module
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
[mchehab@redhat.com: Changed the default to follow the em28xx selection]
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/em28xx/Kconfig | 4 | ||||
-rw-r--r-- | drivers/media/video/em28xx/Makefile | 5 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 8 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-input.c | 27 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 15 |
5 files changed, 32 insertions, 27 deletions
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index f6f622e123bd..928ef0d0429f 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig | |||
@@ -49,10 +49,10 @@ config VIDEO_EM28XX_DVB | |||
49 | Empiatech em28xx chips. | 49 | Empiatech em28xx chips. |
50 | 50 | ||
51 | config VIDEO_EM28XX_RC | 51 | config VIDEO_EM28XX_RC |
52 | bool "EM28XX Remote Controller support" | 52 | tristate "EM28XX Remote Controller support" |
53 | depends on RC_CORE | 53 | depends on RC_CORE |
54 | depends on VIDEO_EM28XX | 54 | depends on VIDEO_EM28XX |
55 | depends on !(RC_CORE=m && VIDEO_EM28XX=y) | 55 | depends on !(RC_CORE=m && VIDEO_EM28XX=y) |
56 | default y | 56 | default VIDEO_EM28XX |
57 | ---help--- | 57 | ---help--- |
58 | Enables Remote Controller support on em28xx driver. | 58 | Enables Remote Controller support on em28xx driver. |
diff --git a/drivers/media/video/em28xx/Makefile b/drivers/media/video/em28xx/Makefile index 2abdf76c5203..c8b338d4be05 100644 --- a/drivers/media/video/em28xx/Makefile +++ b/drivers/media/video/em28xx/Makefile | |||
@@ -1,16 +1,15 @@ | |||
1 | em28xx-y := em28xx-video.o em28xx-i2c.o em28xx-cards.o | 1 | em28xx-y := em28xx-video.o em28xx-i2c.o em28xx-cards.o |
2 | em28xx-y += em28xx-core.o em28xx-vbi.o | 2 | em28xx-y += em28xx-core.o em28xx-vbi.o |
3 | 3 | ||
4 | em28xx-$(CONFIG_VIDEO_EM28XX_RC) += em28xx-input.o | ||
5 | |||
6 | em28xx-alsa-objs := em28xx-audio.o | 4 | em28xx-alsa-objs := em28xx-audio.o |
5 | em28xx-rc-objs := em28xx-input.o | ||
7 | 6 | ||
8 | obj-$(CONFIG_VIDEO_EM28XX) += em28xx.o | 7 | obj-$(CONFIG_VIDEO_EM28XX) += em28xx.o |
9 | obj-$(CONFIG_VIDEO_EM28XX_ALSA) += em28xx-alsa.o | 8 | obj-$(CONFIG_VIDEO_EM28XX_ALSA) += em28xx-alsa.o |
10 | obj-$(CONFIG_VIDEO_EM28XX_DVB) += em28xx-dvb.o | 9 | obj-$(CONFIG_VIDEO_EM28XX_DVB) += em28xx-dvb.o |
10 | obj-$(CONFIG_VIDEO_EM28XX_RC) += em28xx-rc.o | ||
11 | 11 | ||
12 | ccflags-y += -Idrivers/media/video | 12 | ccflags-y += -Idrivers/media/video |
13 | ccflags-y += -Idrivers/media/common/tuners | 13 | ccflags-y += -Idrivers/media/common/tuners |
14 | ccflags-y += -Idrivers/media/dvb/dvb-core | 14 | ccflags-y += -Idrivers/media/dvb/dvb-core |
15 | ccflags-y += -Idrivers/media/dvb/frontends | 15 | ccflags-y += -Idrivers/media/dvb/frontends |
16 | |||
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 160f21966b18..0ac117c23c47 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -2874,9 +2874,6 @@ void em28xx_card_setup(struct em28xx *dev) | |||
2874 | } | 2874 | } |
2875 | 2875 | ||
2876 | em28xx_tuner_setup(dev); | 2876 | em28xx_tuner_setup(dev); |
2877 | |||
2878 | if(!disable_ir) | ||
2879 | em28xx_ir_init(dev); | ||
2880 | } | 2877 | } |
2881 | 2878 | ||
2882 | 2879 | ||
@@ -2893,6 +2890,8 @@ static void request_module_async(struct work_struct *work) | |||
2893 | 2890 | ||
2894 | if (dev->board.has_dvb) | 2891 | if (dev->board.has_dvb) |
2895 | request_module("em28xx-dvb"); | 2892 | request_module("em28xx-dvb"); |
2893 | if (dev->board.has_ir_i2c && !disable_ir) | ||
2894 | request_module("em28xx-rc"); | ||
2896 | } | 2895 | } |
2897 | 2896 | ||
2898 | static void request_modules(struct em28xx *dev) | 2897 | static void request_modules(struct em28xx *dev) |
@@ -2917,9 +2916,6 @@ static void flush_request_modules(struct em28xx *dev) | |||
2917 | */ | 2916 | */ |
2918 | void em28xx_release_resources(struct em28xx *dev) | 2917 | void em28xx_release_resources(struct em28xx *dev) |
2919 | { | 2918 | { |
2920 | if (dev->ir) | ||
2921 | em28xx_ir_fini(dev); | ||
2922 | |||
2923 | /*FIXME: I2C IR should be disconnected */ | 2919 | /*FIXME: I2C IR should be disconnected */ |
2924 | 2920 | ||
2925 | em28xx_release_analog_resources(dev); | 2921 | em28xx_release_analog_resources(dev); |
diff --git a/drivers/media/video/em28xx/em28xx-input.c b/drivers/media/video/em28xx/em28xx-input.c index 249662597c0c..fce5f7680c99 100644 --- a/drivers/media/video/em28xx/em28xx-input.c +++ b/drivers/media/video/em28xx/em28xx-input.c | |||
@@ -519,7 +519,7 @@ static void em28xx_deregister_snapshot_button(struct em28xx *dev) | |||
519 | return; | 519 | return; |
520 | } | 520 | } |
521 | 521 | ||
522 | int em28xx_ir_init(struct em28xx *dev) | 522 | static int em28xx_ir_init(struct em28xx *dev) |
523 | { | 523 | { |
524 | struct em28xx_IR *ir; | 524 | struct em28xx_IR *ir; |
525 | struct rc_dev *rc; | 525 | struct rc_dev *rc; |
@@ -599,7 +599,7 @@ int em28xx_ir_init(struct em28xx *dev) | |||
599 | return err; | 599 | return err; |
600 | } | 600 | } |
601 | 601 | ||
602 | int em28xx_ir_fini(struct em28xx *dev) | 602 | static int em28xx_ir_fini(struct em28xx *dev) |
603 | { | 603 | { |
604 | struct em28xx_IR *ir = dev->ir; | 604 | struct em28xx_IR *ir = dev->ir; |
605 | 605 | ||
@@ -618,3 +618,26 @@ int em28xx_ir_fini(struct em28xx *dev) | |||
618 | return 0; | 618 | return 0; |
619 | } | 619 | } |
620 | 620 | ||
621 | static struct em28xx_ops rc_ops = { | ||
622 | .id = EM28XX_RC, | ||
623 | .name = "Em28xx Input Extension", | ||
624 | .init = em28xx_ir_init, | ||
625 | .fini = em28xx_ir_fini, | ||
626 | }; | ||
627 | |||
628 | static int __init em28xx_rc_register(void) | ||
629 | { | ||
630 | return em28xx_register_extension(&rc_ops); | ||
631 | } | ||
632 | |||
633 | static void __exit em28xx_rc_unregister(void) | ||
634 | { | ||
635 | em28xx_unregister_extension(&rc_ops); | ||
636 | } | ||
637 | |||
638 | MODULE_LICENSE("GPL"); | ||
639 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>"); | ||
640 | MODULE_DESCRIPTION("Em28xx Input driver"); | ||
641 | |||
642 | module_init(em28xx_rc_register); | ||
643 | module_exit(em28xx_rc_unregister); | ||
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 005316fd071d..9a2bd5c40163 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -453,6 +453,7 @@ enum em28xx_dev_state { | |||
453 | /* em28xx extensions */ | 453 | /* em28xx extensions */ |
454 | #define EM28XX_AUDIO 0x10 | 454 | #define EM28XX_AUDIO 0x10 |
455 | #define EM28XX_DVB 0x20 | 455 | #define EM28XX_DVB 0x20 |
456 | #define EM28XX_RC 0x30 | ||
456 | 457 | ||
457 | /* em28xx resource types (used for res_get/res_lock etc */ | 458 | /* em28xx resource types (used for res_get/res_lock etc */ |
458 | #define EM28XX_RESOURCE_VIDEO 0x01 | 459 | #define EM28XX_RESOURCE_VIDEO 0x01 |
@@ -705,20 +706,6 @@ extern const unsigned int em28xx_bcount; | |||
705 | int em28xx_tuner_callback(void *ptr, int component, int command, int arg); | 706 | int em28xx_tuner_callback(void *ptr, int component, int command, int arg); |
706 | void em28xx_release_resources(struct em28xx *dev); | 707 | void em28xx_release_resources(struct em28xx *dev); |
707 | 708 | ||
708 | /* Provided by em28xx-input.c */ | ||
709 | |||
710 | #ifdef CONFIG_VIDEO_EM28XX_RC | ||
711 | |||
712 | int em28xx_ir_init(struct em28xx *dev); | ||
713 | int em28xx_ir_fini(struct em28xx *dev); | ||
714 | |||
715 | #else | ||
716 | |||
717 | static inline int em28xx_ir_init(struct em28xx *dev) { return 0; } | ||
718 | static inline int em28xx_ir_fini(struct em28xx *dev) { return 0; } | ||
719 | |||
720 | #endif | ||
721 | |||
722 | /* Provided by em28xx-vbi.c */ | 709 | /* Provided by em28xx-vbi.c */ |
723 | extern struct videobuf_queue_ops em28xx_vbi_qops; | 710 | extern struct videobuf_queue_ops em28xx_vbi_qops; |
724 | 711 | ||