aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/sound.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-09-05 11:15:37 -0400
committerJaroslav Kysela <perex@suse.cz>2005-09-12 04:41:49 -0400
commitecbcfe36fa882e9f8f2be63ac0c42978336bf997 (patch)
treeb43fe6845a9de4e077cfba15c214d66e74866486 /sound/core/sound.c
parent6243008b82222d6244b055beeeba94b14f23b7e2 (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.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sound/core/sound.c b/sound/core/sound.c
index 3271e924549..9e76bddb2c0 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
332extern struct device_driver snd_generic_driver;
333#endif
334
331static int __init alsa_sound_init(void) 335static 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);
416EXPORT_SYMBOL(snd_component_add); 426EXPORT_SYMBOL(snd_component_add);
417EXPORT_SYMBOL(snd_card_file_add); 427EXPORT_SYMBOL(snd_card_file_add);
418EXPORT_SYMBOL(snd_card_file_remove); 428EXPORT_SYMBOL(snd_card_file_remove);
429#ifdef CONFIG_SND_GENERIC_DRIVER
430EXPORT_SYMBOL(snd_card_set_generic_dev);
431#endif
419#ifdef CONFIG_PM 432#ifdef CONFIG_PM
420EXPORT_SYMBOL(snd_power_wait); 433EXPORT_SYMBOL(snd_power_wait);
421EXPORT_SYMBOL(snd_card_set_pm_callback); 434EXPORT_SYMBOL(snd_card_set_pm_callback);
422#if defined(CONFIG_PM) && defined(CONFIG_SND_GENERIC_PM) 435#ifdef CONFIG_SND_GENERIC_DRIVER
423EXPORT_SYMBOL(snd_card_set_generic_pm_callback); 436EXPORT_SYMBOL(snd_card_set_generic_pm_callback);
424#endif 437#endif
425#ifdef CONFIG_PCI 438#ifdef CONFIG_PCI