Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110948
b: refs/heads/master
c: d886e87
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jaroslav Kysela committed Aug 29, 2008
1 parent fcb1246 commit 30c5849
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f99a6386eb1ad1197a401495669315de2f19039
refs/heads/master: d886e87cb82b0f6636476c1104bb84d7c8dc87d9
4 changes: 4 additions & 0 deletions trunk/arch/um/Kconfig.char
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ config SOUND
tristate
default UML_SOUND

config SOUND_OSS_CORE
bool
default UML_SOUND

config HOSTAUDIO
tristate
default UML_SOUND
Expand Down
5 changes: 5 additions & 0 deletions trunk/sound/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ menuconfig SOUND

if SOUND

config SOUND_OSS_CORE
bool
default n

source "sound/oss/dmasound/Kconfig"

if !M68K
Expand Down Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions trunk/sound/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions trunk/sound/oss/dmasound/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ config DMASOUND_Q40

config DMASOUND
tristate
select SOUND_OSS_CORE
79 changes: 60 additions & 19 deletions trunk/sound/sound_core.c
Original file line number Diff line number Diff line change
@@ -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 <linux/module.h>
#include <linux/device.h>
#include <linux/err.h>

#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 <alan.cox@linux.org>
*
Expand Down Expand Up @@ -34,21 +90,17 @@
* locking at some point in 2.3.x.
*/

#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sound.h>
#include <linux/major.h>
#include <linux/kmod.h>
#include <linux/device.h>

#define SOUND_STEP 16


struct sound_unit
{
int unit_minor;
Expand All @@ -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
Expand Down Expand Up @@ -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 */

0 comments on commit 30c5849

Please sign in to comment.