diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-11-27 09:47:11 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-27 09:47:11 -0500 |
commit | 1289e9e8b42f973f2ab39e5f4f2239ff826c27e9 (patch) | |
tree | f0462154211f734f278e981a5d5ae1ec66f1fb03 /sound/pci/hda/patch_cmedia.c | |
parent | 30d72e9f614e7bd76e28d4d92bd54d90a96905bb (diff) |
ALSA: hda - Modularize HD-audio driver
Split the monolithc HD-audio driver into several pieces:
- snd-hda-intel HD-audio PCI controller driver; loaded via udev
- snd-hda-codec HD-audio codec bus driver
- snd-hda-codec-* Specific HD-audio codec drivers
When built as modules, snd-hda-codec (that is invoked by snd-hda-intel)
looks up the codec vendor ID and loads the corresponding codec module
automatically via request_module().
When built in a kernel, each codec drivers are statically hooked up
before probing the PCI.
This patch adds appropriate EXPORT_SYMBOL_GPL()'s and the module
information for each driver, and driver-linking codes between
codec-bus and codec drivers.
TODO:
- Avoid EXPORT_SYMBOL*() when built-in kernel
- Restore __devinit appropriately depending on the condition
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_cmedia.c')
-rw-r--r-- | sound/pci/hda/patch_cmedia.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c index 6ef57fbfb6eb..f3ebe837f2d5 100644 --- a/sound/pci/hda/patch_cmedia.c +++ b/sound/pci/hda/patch_cmedia.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <sound/core.h> | 28 | #include <sound/core.h> |
29 | #include "hda_codec.h" | 29 | #include "hda_codec.h" |
30 | #include "hda_local.h" | 30 | #include "hda_local.h" |
31 | #include "hda_patch.h" | ||
32 | #define NUM_PINS 11 | 31 | #define NUM_PINS 11 |
33 | 32 | ||
34 | 33 | ||
@@ -736,8 +735,32 @@ static int patch_cmi9880(struct hda_codec *codec) | |||
736 | /* | 735 | /* |
737 | * patch entries | 736 | * patch entries |
738 | */ | 737 | */ |
739 | struct hda_codec_preset snd_hda_preset_cmedia[] = { | 738 | static struct hda_codec_preset snd_hda_preset_cmedia[] = { |
740 | { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 }, | 739 | { .id = 0x13f69880, .name = "CMI9880", .patch = patch_cmi9880 }, |
741 | { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 }, | 740 | { .id = 0x434d4980, .name = "CMI9880", .patch = patch_cmi9880 }, |
742 | {} /* terminator */ | 741 | {} /* terminator */ |
743 | }; | 742 | }; |
743 | |||
744 | MODULE_ALIAS("snd-hda-codec-id:13f69880"); | ||
745 | MODULE_ALIAS("snd-hda-codec-id:434d4980"); | ||
746 | |||
747 | MODULE_LICENSE("GPL"); | ||
748 | MODULE_DESCRIPTION("C-Media HD-audio codec"); | ||
749 | |||
750 | static struct hda_codec_preset_list cmedia_list = { | ||
751 | .preset = snd_hda_preset_cmedia, | ||
752 | .owner = THIS_MODULE, | ||
753 | }; | ||
754 | |||
755 | static int __init patch_cmedia_init(void) | ||
756 | { | ||
757 | return snd_hda_add_codec_preset(&cmedia_list); | ||
758 | } | ||
759 | |||
760 | static void __exit patch_cmedia_exit(void) | ||
761 | { | ||
762 | snd_hda_delete_codec_preset(&cmedia_list); | ||
763 | } | ||
764 | |||
765 | module_init(patch_cmedia_init) | ||
766 | module_exit(patch_cmedia_exit) | ||