From 0d94e41abe271c86df06bcf72d24f9ca7ce771f0 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 28 Jul 2008 19:05:36 +0100 Subject: ALSA: Build jack detection Since jack detection requires the input subsystem which may not be desired on small systems it is not built unless required by a driver that is being built. Drivers using jack detection should use a pattern like this: config SND_FOO tristate "..." ... select SND_JACK if INPUT=y || INPUT=SND to ensure that the jack detection API is enabled if the input subsystem is. If the input subsystem is not enabled then a stub version of the API is provided. Signed-off-by: Mark Brown Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/core/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sound/core/Kconfig') diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 335d45ecde6..9c4da1cd4a6 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig @@ -12,6 +12,12 @@ config SND_HWDEP config SND_RAWMIDI tristate +# To be effective this also requires INPUT - users should say: +# select SND_JACK if INPUT=y || INPUT=SND +# to avoid having to force INPUT on. +config SND_JACK + bool + config SND_SEQUENCER tristate "Sequencer support" select SND_TIMER -- cgit v1.2.3-70-g09d2 From d886e87cb82b0f6636476c1104bb84d7c8dc87d9 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Thu, 28 Aug 2008 16:42:51 +0200 Subject: sound: make OSS sound core optional sound/sound_core.c implements soundcore.ko and contains two parts - sound_class which is shared by both ALSA and OSS and device redirection support for OSS. It's always compiled when any sound support is enabled although it's necessary only when OSS (the actual one or emulation) is enabled. This is slightly wasteful and as device redirection always registers character device region for major 14, it prevents alternative implementation. This patch introduces a new config SOUND_OSS_CORE which is selected iff OSS support is actually necessary and build the OSS core part conditionally. If OSS is disabled, soundcore merely contains sound_class but leaving it that way seems to be the simplest approach as otherwise sound_class should be in ALSA core file if OSS is disabled but should be in soundcore if OSS is enabled. Also, there's also the user confusion factor. Signed-off-by: Tejun Heo Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- arch/um/Kconfig.char | 4 +++ sound/Kconfig | 5 +++ sound/core/Kconfig | 1 + sound/oss/dmasound/Kconfig | 1 + sound/sound_core.c | 79 +++++++++++++++++++++++++++++++++++----------- 5 files changed, 71 insertions(+), 19 deletions(-) (limited to 'sound/core/Kconfig') diff --git a/arch/um/Kconfig.char b/arch/um/Kconfig.char index 1b238ebae6b..70dabd1e065 100644 --- a/arch/um/Kconfig.char +++ b/arch/um/Kconfig.char @@ -203,6 +203,10 @@ config SOUND tristate default UML_SOUND +config SOUND_OSS_CORE + bool + default UML_SOUND + config HOSTAUDIO tristate default UML_SOUND diff --git a/sound/Kconfig b/sound/Kconfig index 8ebf512ced6..200aca1faa7 100644 --- a/sound/Kconfig +++ b/sound/Kconfig @@ -28,6 +28,10 @@ menuconfig SOUND if SOUND +config SOUND_OSS_CORE + bool + default n + source "sound/oss/dmasound/Kconfig" if !M68K @@ -80,6 +84,7 @@ endif # SND menuconfig SOUND_PRIME tristate "Open Sound System (DEPRECATED)" + select SOUND_OSS_CORE help Say 'Y' or 'M' to enable Open Sound System drivers. diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 9c4da1cd4a6..91f91c5cdb4 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig @@ -44,6 +44,7 @@ config SND_SEQ_DUMMY will be called snd-seq-dummy. config SND_OSSEMUL + select SOUND_OSS_CORE bool config SND_MIXER_OSS diff --git a/sound/oss/dmasound/Kconfig b/sound/oss/dmasound/Kconfig index 3eb782720e5..f456574a964 100644 --- a/sound/oss/dmasound/Kconfig +++ b/sound/oss/dmasound/Kconfig @@ -42,3 +42,4 @@ config DMASOUND_Q40 config DMASOUND tristate + select SOUND_OSS_CORE diff --git a/sound/sound_core.c b/sound/sound_core.c index 1b04259a432..68614c3ed54 100644 --- a/sound/sound_core.c +++ b/sound/sound_core.c @@ -1,5 +1,61 @@ /* - * Sound core handling. Breaks out sound functions to submodules + * Sound core. This file is composed of two parts. sound_class + * which is common to both OSS and ALSA and OSS sound core which + * is used OSS or emulation of it. + */ + +/* + * First, the common part. + */ +#include +#include +#include + +#ifdef CONFIG_SOUND_OSS_CORE +static int __init init_oss_soundcore(void); +static void __exit cleanup_oss_soundcore(void); +#else +static inline int init_oss_soundcore(void) { return 0; } +static inline void cleanup_oss_soundcore(void) { } +#endif + +struct class *sound_class; +EXPORT_SYMBOL(sound_class); + +MODULE_DESCRIPTION("Core sound module"); +MODULE_AUTHOR("Alan Cox"); +MODULE_LICENSE("GPL"); + +static int __init init_soundcore(void) +{ + int rc; + + rc = init_oss_soundcore(); + if (rc) + return rc; + + sound_class = class_create(THIS_MODULE, "sound"); + if (IS_ERR(sound_class)) { + cleanup_oss_soundcore(); + return PTR_ERR(sound_class); + } + + return 0; +} + +static void __exit cleanup_soundcore(void) +{ + cleanup_oss_soundcore(); + class_destroy(sound_class); +} + +module_init(init_soundcore); +module_exit(cleanup_soundcore); + + +#ifdef CONFIG_SOUND_OSS_CORE +/* + * OSS sound core handling. Breaks out sound functions to submodules * * Author: Alan Cox * @@ -34,21 +90,17 @@ * locking at some point in 2.3.x. */ -#include #include #include #include #include #include -#include #include #include #include -#include #define SOUND_STEP 16 - struct sound_unit { int unit_minor; @@ -64,9 +116,6 @@ extern int msnd_classic_init(void); extern int msnd_pinnacle_init(void); #endif -struct class *sound_class; -EXPORT_SYMBOL(sound_class); - /* * Low level list operator. Scan the ordered list, find a hole and * join into it. Called with the lock asserted @@ -523,31 +572,23 @@ int soundcore_open(struct inode *inode, struct file *file) return -ENODEV; } -MODULE_DESCRIPTION("Core sound module"); -MODULE_AUTHOR("Alan Cox"); -MODULE_LICENSE("GPL"); MODULE_ALIAS_CHARDEV_MAJOR(SOUND_MAJOR); -static void __exit cleanup_soundcore(void) +static void __exit cleanup_oss_soundcore(void) { /* We have nothing to really do here - we know the lists must be empty */ unregister_chrdev(SOUND_MAJOR, "sound"); - class_destroy(sound_class); } -static int __init init_soundcore(void) +static int __init init_oss_soundcore(void) { if (register_chrdev(SOUND_MAJOR, "sound", &soundcore_fops)==-1) { printk(KERN_ERR "soundcore: sound device already in use.\n"); return -EBUSY; } - sound_class = class_create(THIS_MODULE, "sound"); - if (IS_ERR(sound_class)) - return PTR_ERR(sound_class); return 0; } -module_init(init_soundcore); -module_exit(cleanup_soundcore); +#endif /* CONFIG_SOUND_OSS_CORE */ -- cgit v1.2.3-70-g09d2 From 52948b3f7c481be2cd3a68d1db42dd6906bf853a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 7 Oct 2008 16:13:59 +0200 Subject: ALSA: Add a note on dependency of RTC stuff Added a note on the dependency of old RTC stuff, which is exclusive with the new RTC class drivers. http://bugme.linux-foundation.org/show_bug.cgi?id=11430 Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/core/Kconfig | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound/core/Kconfig') diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 91f91c5cdb4..66348c92f88 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig @@ -108,6 +108,9 @@ config SND_RTCTIMER To compile this driver as a module, choose M here: the module will be called snd-rtctimer. + Note that this option is exclusive with the new RTC drivers + (CONFIG_RTC_CLASS) since this requires the old API. + config SND_SEQ_RTCTIMER_DEFAULT bool "Use RTC as default sequencer timer" depends on SND_RTCTIMER && SND_SEQUENCER -- cgit v1.2.3-70-g09d2