diff options
author | Ricardo Cerqueira <v4l@cerqueira.org> | 2005-12-20 15:26:26 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-12-22 04:55:06 -0500 |
commit | 7bb9529602f8bb41a92275825b808a42ed33e5be (patch) | |
tree | d719928ae348342b47e50578155ef51f8e85fae3 /drivers/media/video | |
parent | d5ea4e26602fa7f5141872f2c17a862f1974a73f (diff) |
V4L/DVB (3200): Fix saa7134 ALSA/OSS collisions
- When ALSA or OSS are loaded, check if the other is present
Fixed hotplug notifiers cleanup on module removal
- The saa7134 DMA sound modules now have their own Kconfig entries, and
if built statically enforce exclusivity
- SND_PCM_OSS isn't necessary for the OSS driver
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/saa7134/Kconfig | 26 | ||||
-rw-r--r-- | drivers/media/video/saa7134/Makefile | 7 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-alsa.c | 13 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-oss.c | 15 |
4 files changed, 51 insertions, 10 deletions
diff --git a/drivers/media/video/saa7134/Kconfig b/drivers/media/video/saa7134/Kconfig index c512c4411b38..c0f604a6fe42 100644 --- a/drivers/media/video/saa7134/Kconfig +++ b/drivers/media/video/saa7134/Kconfig | |||
@@ -1,11 +1,10 @@ | |||
1 | config VIDEO_SAA7134 | 1 | config VIDEO_SAA7134 |
2 | tristate "Philips SAA7134 support" | 2 | tristate "Philips SAA7134 support" |
3 | depends on VIDEO_DEV && PCI && I2C && SOUND && SND | 3 | depends on VIDEO_DEV && PCI && I2C |
4 | select VIDEO_BUF | 4 | select VIDEO_BUF |
5 | select VIDEO_IR | 5 | select VIDEO_IR |
6 | select VIDEO_TUNER | 6 | select VIDEO_TUNER |
7 | select CRC32 | 7 | select CRC32 |
8 | select SND_PCM_OSS | ||
9 | ---help--- | 8 | ---help--- |
10 | This is a video4linux driver for Philips SAA713x based | 9 | This is a video4linux driver for Philips SAA713x based |
11 | TV cards. | 10 | TV cards. |
@@ -13,6 +12,29 @@ config VIDEO_SAA7134 | |||
13 | To compile this driver as a module, choose M here: the | 12 | To compile this driver as a module, choose M here: the |
14 | module will be called saa7134. | 13 | module will be called saa7134. |
15 | 14 | ||
15 | config VIDEO_SAA7134_ALSA | ||
16 | tristate "Philips SAA7134 DMA audio support" | ||
17 | depends on VIDEO_SAA7134 && SOUND && SND && (!VIDEO_SAA7134_OSS || VIDEO_SAA7134_OSS = m) | ||
18 | select SND_PCM_OSS | ||
19 | ---help--- | ||
20 | This is a video4linux driver for direct (DMA) audio in | ||
21 | Philips SAA713x based TV cards using ALSA | ||
22 | |||
23 | To compile this driver as a module, choose M here: the | ||
24 | module will be called saa7134-alsa. | ||
25 | |||
26 | config VIDEO_SAA7134_OSS | ||
27 | tristate "Philips SAA7134 DMA audio support (OSS, DEPRECATED)" | ||
28 | depends on VIDEO_SAA7134 && SOUND_PRIME && (!VIDEO_SAA7134_ALSA || VIDEO_SAA7134_ALSA = m) | ||
29 | ---help--- | ||
30 | This is a video4linux driver for direct (DMA) audio in | ||
31 | Philips SAA713x based TV cards using OSS | ||
32 | |||
33 | This is deprecated in favor of the ALSA module | ||
34 | |||
35 | To compile this driver as a module, choose M here: the | ||
36 | module will be called saa7134-oss. | ||
37 | |||
16 | config VIDEO_SAA7134_DVB | 38 | config VIDEO_SAA7134_DVB |
17 | tristate "DVB/ATSC Support for saa7134 based TV cards" | 39 | tristate "DVB/ATSC Support for saa7134 based TV cards" |
18 | depends on VIDEO_SAA7134 && DVB_CORE | 40 | depends on VIDEO_SAA7134 && DVB_CORE |
diff --git a/drivers/media/video/saa7134/Makefile b/drivers/media/video/saa7134/Makefile index 134f83a96218..1ba998424bbd 100644 --- a/drivers/media/video/saa7134/Makefile +++ b/drivers/media/video/saa7134/Makefile | |||
@@ -4,8 +4,11 @@ saa7134-objs := saa7134-cards.o saa7134-core.o saa7134-i2c.o \ | |||
4 | saa7134-video.o saa7134-input.o | 4 | saa7134-video.o saa7134-input.o |
5 | 5 | ||
6 | obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ | 6 | obj-$(CONFIG_VIDEO_SAA7134) += saa7134.o saa7134-empress.o \ |
7 | saa6752hs.o saa7134-alsa.o \ | 7 | saa6752hs.o |
8 | saa7134-oss.o | 8 | |
9 | obj-$(CONFIG_VIDEO_SAA7134_ALSA) += saa7134-alsa.o | ||
10 | obj-$(CONFIG_VIDEO_SAA7134_OSS) += saa7134-oss.o | ||
11 | |||
9 | obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o | 12 | obj-$(CONFIG_VIDEO_SAA7134_DVB) += saa7134-dvb.o |
10 | 13 | ||
11 | EXTRA_CFLAGS += -I$(src)/.. | 14 | EXTRA_CFLAGS += -I$(src)/.. |
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index 6752dd1c1e8a..ade05f75fdb0 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c | |||
@@ -989,6 +989,14 @@ static int saa7134_alsa_init(void) | |||
989 | struct saa7134_dev *dev = NULL; | 989 | struct saa7134_dev *dev = NULL; |
990 | struct list_head *list; | 990 | struct list_head *list; |
991 | 991 | ||
992 | if (!dmasound_init && !dmasound_exit) { | ||
993 | dmasound_init = alsa_device_init; | ||
994 | dmasound_exit = alsa_device_exit; | ||
995 | } else { | ||
996 | printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n"); | ||
997 | return -EBUSY; | ||
998 | } | ||
999 | |||
992 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); | 1000 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n"); |
993 | 1001 | ||
994 | list_for_each(list,&saa7134_devlist) { | 1002 | list_for_each(list,&saa7134_devlist) { |
@@ -1001,9 +1009,6 @@ static int saa7134_alsa_init(void) | |||
1001 | } | 1009 | } |
1002 | } | 1010 | } |
1003 | 1011 | ||
1004 | dmasound_init = alsa_device_init; | ||
1005 | dmasound_exit = alsa_device_exit; | ||
1006 | |||
1007 | if (dev == NULL) | 1012 | if (dev == NULL) |
1008 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); | 1013 | printk(KERN_INFO "saa7134 ALSA: no saa7134 cards found\n"); |
1009 | 1014 | ||
@@ -1023,6 +1028,8 @@ static void saa7134_alsa_exit(void) | |||
1023 | snd_card_free(snd_saa7134_cards[idx]); | 1028 | snd_card_free(snd_saa7134_cards[idx]); |
1024 | } | 1029 | } |
1025 | 1030 | ||
1031 | dmasound_init = NULL; | ||
1032 | dmasound_exit = NULL; | ||
1026 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); | 1033 | printk(KERN_INFO "saa7134 ALSA driver for DMA sound unloaded\n"); |
1027 | 1034 | ||
1028 | return; | 1035 | return; |
diff --git a/drivers/media/video/saa7134/saa7134-oss.c b/drivers/media/video/saa7134/saa7134-oss.c index c450d57b2949..8badd2a9cb2f 100644 --- a/drivers/media/video/saa7134/saa7134-oss.c +++ b/drivers/media/video/saa7134/saa7134-oss.c | |||
@@ -959,8 +959,17 @@ static int saa7134_oss_init(void) | |||
959 | struct saa7134_dev *dev = NULL; | 959 | struct saa7134_dev *dev = NULL; |
960 | struct list_head *list; | 960 | struct list_head *list; |
961 | 961 | ||
962 | if (!dmasound_init && !dmasound_exit) { | ||
963 | dmasound_init = oss_device_init; | ||
964 | dmasound_exit = oss_device_exit; | ||
965 | } else { | ||
966 | printk(KERN_WARNING "saa7134 OSS: can't load, DMA sound handler already assigned (probably to ALSA)\n"); | ||
967 | return -EBUSY; | ||
968 | } | ||
969 | |||
962 | printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); | 970 | printk(KERN_INFO "saa7134 OSS driver for DMA sound loaded\n"); |
963 | 971 | ||
972 | |||
964 | list_for_each(list,&saa7134_devlist) { | 973 | list_for_each(list,&saa7134_devlist) { |
965 | dev = list_entry(list, struct saa7134_dev, devlist); | 974 | dev = list_entry(list, struct saa7134_dev, devlist); |
966 | if (dev->dmasound.priv_data == NULL) { | 975 | if (dev->dmasound.priv_data == NULL) { |
@@ -974,9 +983,6 @@ static int saa7134_oss_init(void) | |||
974 | if (dev == NULL) | 983 | if (dev == NULL) |
975 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); | 984 | printk(KERN_INFO "saa7134 OSS: no saa7134 cards found\n"); |
976 | 985 | ||
977 | dmasound_init = oss_device_init; | ||
978 | dmasound_exit = oss_device_exit; | ||
979 | |||
980 | return 0; | 986 | return 0; |
981 | 987 | ||
982 | } | 988 | } |
@@ -997,6 +1003,9 @@ static void saa7134_oss_exit(void) | |||
997 | 1003 | ||
998 | } | 1004 | } |
999 | 1005 | ||
1006 | dmasound_init = NULL; | ||
1007 | dmasound_exit = NULL; | ||
1008 | |||
1000 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); | 1009 | printk(KERN_INFO "saa7134 OSS driver for DMA sound unloaded\n"); |
1001 | 1010 | ||
1002 | return; | 1011 | return; |