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_nvhdmi.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_nvhdmi.c')
-rw-r--r-- | sound/pci/hda/patch_nvhdmi.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 1360d54a7d01..e23de5594b6e 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.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 | 31 | ||
33 | struct nvhdmi_spec { | 32 | struct nvhdmi_spec { |
34 | struct hda_multi_out multiout; | 33 | struct hda_multi_out multiout; |
@@ -159,8 +158,32 @@ static int patch_nvhdmi(struct hda_codec *codec) | |||
159 | /* | 158 | /* |
160 | * patch entries | 159 | * patch entries |
161 | */ | 160 | */ |
162 | struct hda_codec_preset snd_hda_preset_nvhdmi[] = { | 161 | static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { |
163 | { .id = 0x10de0002, .name = "NVIDIA MCP78 HDMI", .patch = patch_nvhdmi }, | 162 | { .id = 0x10de0002, .name = "NVIDIA MCP78 HDMI", .patch = patch_nvhdmi }, |
164 | { .id = 0x10de0007, .name = "NVIDIA MCP7A HDMI", .patch = patch_nvhdmi }, | 163 | { .id = 0x10de0007, .name = "NVIDIA MCP7A HDMI", .patch = patch_nvhdmi }, |
165 | {} /* terminator */ | 164 | {} /* terminator */ |
166 | }; | 165 | }; |
166 | |||
167 | MODULE_ALIAS("snd-hda-codec-id:10de0002"); | ||
168 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); | ||
169 | |||
170 | MODULE_LICENSE("GPL"); | ||
171 | MODULE_DESCRIPTION("Nvidia HDMI HD-audio codec"); | ||
172 | |||
173 | static struct hda_codec_preset_list nvhdmi_list = { | ||
174 | .preset = snd_hda_preset_nvhdmi, | ||
175 | .owner = THIS_MODULE, | ||
176 | }; | ||
177 | |||
178 | static int __init patch_nvhdmi_init(void) | ||
179 | { | ||
180 | return snd_hda_add_codec_preset(&nvhdmi_list); | ||
181 | } | ||
182 | |||
183 | static void __exit patch_nvhdmi_exit(void) | ||
184 | { | ||
185 | snd_hda_delete_codec_preset(&nvhdmi_list); | ||
186 | } | ||
187 | |||
188 | module_init(patch_nvhdmi_init) | ||
189 | module_exit(patch_nvhdmi_exit) | ||