diff options
-rw-r--r-- | include/sound/minors.h | 4 | ||||
-rw-r--r-- | sound/core/seq/seq.c | 4 | ||||
-rw-r--r-- | sound/core/sound.c | 18 | ||||
-rw-r--r-- | sound/core/timer.c | 3 |
4 files changed, 22 insertions, 7 deletions
diff --git a/include/sound/minors.h b/include/sound/minors.h index a81798ab73ed..8f764204a856 100644 --- a/include/sound/minors.h +++ b/include/sound/minors.h | |||
@@ -31,8 +31,8 @@ | |||
31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ | 31 | /* these minors can still be used for autoloading devices (/dev/aload*) */ |
32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ | 32 | #define SNDRV_MINOR_CONTROL 0 /* 0 */ |
33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ | 33 | #define SNDRV_MINOR_GLOBAL 1 /* 1 */ |
34 | #define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) | 34 | #define SNDRV_MINOR_SEQUENCER 1 /* SNDRV_MINOR_GLOBAL + 0 * 32 */ |
35 | #define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) | 35 | #define SNDRV_MINOR_TIMER 33 /* SNDRV_MINOR_GLOBAL + 1 * 32 */ |
36 | 36 | ||
37 | #ifndef CONFIG_SND_DYNAMIC_MINORS | 37 | #ifndef CONFIG_SND_DYNAMIC_MINORS |
38 | /* 2 - 3 (reserved) */ | 38 | /* 2 - 3 (reserved) */ |
diff --git a/sound/core/seq/seq.c b/sound/core/seq/seq.c index bf09a5ad1865..119fddb6fc99 100644 --- a/sound/core/seq/seq.c +++ b/sound/core/seq/seq.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "seq_timer.h" | 32 | #include "seq_timer.h" |
33 | #include "seq_system.h" | 33 | #include "seq_system.h" |
34 | #include "seq_info.h" | 34 | #include "seq_info.h" |
35 | #include <sound/minors.h> | ||
35 | #include <sound/seq_device.h> | 36 | #include <sound/seq_device.h> |
36 | 37 | ||
37 | #if defined(CONFIG_SND_SEQ_DUMMY_MODULE) | 38 | #if defined(CONFIG_SND_SEQ_DUMMY_MODULE) |
@@ -73,6 +74,9 @@ MODULE_PARM_DESC(seq_default_timer_subdevice, "The default timer subdevice numbe | |||
73 | module_param(seq_default_timer_resolution, int, 0644); | 74 | module_param(seq_default_timer_resolution, int, 0644); |
74 | MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz."); | 75 | MODULE_PARM_DESC(seq_default_timer_resolution, "The default timer resolution in Hz."); |
75 | 76 | ||
77 | MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_SEQUENCER); | ||
78 | MODULE_ALIAS("devname:snd/seq"); | ||
79 | |||
76 | /* | 80 | /* |
77 | * INIT PART | 81 | * INIT PART |
78 | */ | 82 | */ |
diff --git a/sound/core/sound.c b/sound/core/sound.c index 62a093efb453..345caea2d749 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -189,14 +189,22 @@ static const struct file_operations snd_fops = | |||
189 | }; | 189 | }; |
190 | 190 | ||
191 | #ifdef CONFIG_SND_DYNAMIC_MINORS | 191 | #ifdef CONFIG_SND_DYNAMIC_MINORS |
192 | static int snd_find_free_minor(void) | 192 | static int snd_find_free_minor(int type) |
193 | { | 193 | { |
194 | int minor; | 194 | int minor; |
195 | 195 | ||
196 | /* static minors for module auto loading */ | ||
197 | if (type == SNDRV_DEVICE_TYPE_SEQUENCER) | ||
198 | return SNDRV_MINOR_SEQUENCER; | ||
199 | if (type == SNDRV_DEVICE_TYPE_TIMER) | ||
200 | return SNDRV_MINOR_TIMER; | ||
201 | |||
196 | for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { | 202 | for (minor = 0; minor < ARRAY_SIZE(snd_minors); ++minor) { |
197 | /* skip minors still used statically for autoloading devices */ | 203 | /* skip static minors still used for module auto loading */ |
198 | if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL || | 204 | if (SNDRV_MINOR_DEVICE(minor) == SNDRV_MINOR_CONTROL) |
199 | minor == SNDRV_MINOR_SEQUENCER) | 205 | continue; |
206 | if (minor == SNDRV_MINOR_SEQUENCER || | ||
207 | minor == SNDRV_MINOR_TIMER) | ||
200 | continue; | 208 | continue; |
201 | if (!snd_minors[minor]) | 209 | if (!snd_minors[minor]) |
202 | return minor; | 210 | return minor; |
@@ -270,7 +278,7 @@ int snd_register_device_for_dev(int type, struct snd_card *card, int dev, | |||
270 | preg->private_data = private_data; | 278 | preg->private_data = private_data; |
271 | mutex_lock(&sound_mutex); | 279 | mutex_lock(&sound_mutex); |
272 | #ifdef CONFIG_SND_DYNAMIC_MINORS | 280 | #ifdef CONFIG_SND_DYNAMIC_MINORS |
273 | minor = snd_find_free_minor(); | 281 | minor = snd_find_free_minor(type); |
274 | #else | 282 | #else |
275 | minor = snd_kernel_minor(type, card, dev); | 283 | minor = snd_kernel_minor(type, card, dev); |
276 | if (minor >= 0 && snd_minors[minor]) | 284 | if (minor >= 0 && snd_minors[minor]) |
diff --git a/sound/core/timer.c b/sound/core/timer.c index b3aaa600dcc2..ed016329e911 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -52,6 +52,9 @@ MODULE_PARM_DESC(timer_limit, "Maximum global timers in system."); | |||
52 | module_param(timer_tstamp_monotonic, int, 0444); | 52 | module_param(timer_tstamp_monotonic, int, 0444); |
53 | MODULE_PARM_DESC(timer_tstamp_monotonic, "Use posix monotonic clock source for timestamps (default)."); | 53 | MODULE_PARM_DESC(timer_tstamp_monotonic, "Use posix monotonic clock source for timestamps (default)."); |
54 | 54 | ||
55 | MODULE_ALIAS_CHARDEV(CONFIG_SND_MAJOR, SNDRV_MINOR_TIMER); | ||
56 | MODULE_ALIAS("devname:snd/timer"); | ||
57 | |||
55 | struct snd_timer_user { | 58 | struct snd_timer_user { |
56 | struct snd_timer_instance *timeri; | 59 | struct snd_timer_instance *timeri; |
57 | int tread; /* enhanced read with timestamps and events */ | 60 | int tread; /* enhanced read with timestamps and events */ |