diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-09-05 11:15:37 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-09-12 04:41:49 -0400 |
commit | ecbcfe36fa882e9f8f2be63ac0c42978336bf997 (patch) | |
tree | b43fe6845a9de4e077cfba15c214d66e74866486 /sound/core/sound.c | |
parent | 6243008b82222d6244b055beeeba94b14f23b7e2 (diff) |
[ALSA] Introduce snd_card_set_generic_dev()
ALSA Core
A new function snd_card_set_generic_dev() is introduced to add the
'generic device' support for devices without proper bus on sysfs.
It's a last resort, and should be removed in future when they have
a proper bus, instead.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/sound.c')
-rw-r--r-- | sound/core/sound.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c index 3271e9245490..9e76bddb2c0b 100644 --- a/sound/core/sound.c +++ b/sound/core/sound.c | |||
@@ -328,6 +328,10 @@ int __exit snd_minor_info_done(void) | |||
328 | * INIT PART | 328 | * INIT PART |
329 | */ | 329 | */ |
330 | 330 | ||
331 | #ifdef CONFIG_SND_GENERIC_DRIVER | ||
332 | extern struct device_driver snd_generic_driver; | ||
333 | #endif | ||
334 | |||
331 | static int __init alsa_sound_init(void) | 335 | static int __init alsa_sound_init(void) |
332 | { | 336 | { |
333 | short controlnum; | 337 | short controlnum; |
@@ -354,6 +358,9 @@ static int __init alsa_sound_init(void) | |||
354 | return -ENOMEM; | 358 | return -ENOMEM; |
355 | } | 359 | } |
356 | snd_info_minor_register(); | 360 | snd_info_minor_register(); |
361 | #ifdef CONFIG_SND_GENERIC_DRIVER | ||
362 | driver_register(&snd_generic_driver); | ||
363 | #endif | ||
357 | for (controlnum = 0; controlnum < cards_limit; controlnum++) | 364 | for (controlnum = 0; controlnum < cards_limit; controlnum++) |
358 | devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); | 365 | devfs_mk_cdev(MKDEV(major, controlnum<<5), S_IFCHR | device_mode, "snd/controlC%d", controlnum); |
359 | #ifndef MODULE | 366 | #ifndef MODULE |
@@ -369,6 +376,9 @@ static void __exit alsa_sound_exit(void) | |||
369 | for (controlnum = 0; controlnum < cards_limit; controlnum++) | 376 | for (controlnum = 0; controlnum < cards_limit; controlnum++) |
370 | devfs_remove("snd/controlC%d", controlnum); | 377 | devfs_remove("snd/controlC%d", controlnum); |
371 | 378 | ||
379 | #ifdef CONFIG_SND_GENERIC_DRIVER | ||
380 | driver_unregister(&snd_generic_driver); | ||
381 | #endif | ||
372 | snd_info_minor_unregister(); | 382 | snd_info_minor_unregister(); |
373 | snd_info_done(); | 383 | snd_info_done(); |
374 | snd_memory_done(); | 384 | snd_memory_done(); |
@@ -416,10 +426,13 @@ EXPORT_SYMBOL(snd_card_register); | |||
416 | EXPORT_SYMBOL(snd_component_add); | 426 | EXPORT_SYMBOL(snd_component_add); |
417 | EXPORT_SYMBOL(snd_card_file_add); | 427 | EXPORT_SYMBOL(snd_card_file_add); |
418 | EXPORT_SYMBOL(snd_card_file_remove); | 428 | EXPORT_SYMBOL(snd_card_file_remove); |
429 | #ifdef CONFIG_SND_GENERIC_DRIVER | ||
430 | EXPORT_SYMBOL(snd_card_set_generic_dev); | ||
431 | #endif | ||
419 | #ifdef CONFIG_PM | 432 | #ifdef CONFIG_PM |
420 | EXPORT_SYMBOL(snd_power_wait); | 433 | EXPORT_SYMBOL(snd_power_wait); |
421 | EXPORT_SYMBOL(snd_card_set_pm_callback); | 434 | EXPORT_SYMBOL(snd_card_set_pm_callback); |
422 | #if defined(CONFIG_PM) && defined(CONFIG_SND_GENERIC_PM) | 435 | #ifdef CONFIG_SND_GENERIC_DRIVER |
423 | EXPORT_SYMBOL(snd_card_set_generic_pm_callback); | 436 | EXPORT_SYMBOL(snd_card_set_generic_pm_callback); |
424 | #endif | 437 | #endif |
425 | #ifdef CONFIG_PCI | 438 | #ifdef CONFIG_PCI |