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_intelhdmi.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_intelhdmi.c')
-rw-r--r-- | sound/pci/hda/patch_intelhdmi.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c index fe08bef897cd..290da562f29b 100644 --- a/sound/pci/hda/patch_intelhdmi.c +++ b/sound/pci/hda/patch_intelhdmi.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <sound/core.h> | 32 | #include <sound/core.h> |
33 | #include "hda_codec.h" | 33 | #include "hda_codec.h" |
34 | #include "hda_local.h" | 34 | #include "hda_local.h" |
35 | #include "hda_patch.h" | ||
36 | 35 | ||
37 | #define CVT_NID 0x02 /* audio converter */ | 36 | #define CVT_NID 0x02 /* audio converter */ |
38 | #define PIN_NID 0x03 /* HDMI output pin */ | 37 | #define PIN_NID 0x03 /* HDMI output pin */ |
@@ -675,7 +674,7 @@ static int patch_intel_hdmi(struct hda_codec *codec) | |||
675 | return 0; | 674 | return 0; |
676 | } | 675 | } |
677 | 676 | ||
678 | struct hda_codec_preset snd_hda_preset_intelhdmi[] = { | 677 | static struct hda_codec_preset snd_hda_preset_intelhdmi[] = { |
679 | { .id = 0x808629fb, .name = "INTEL G45 DEVCL", .patch = patch_intel_hdmi }, | 678 | { .id = 0x808629fb, .name = "INTEL G45 DEVCL", .patch = patch_intel_hdmi }, |
680 | { .id = 0x80862801, .name = "INTEL G45 DEVBLC", .patch = patch_intel_hdmi }, | 679 | { .id = 0x80862801, .name = "INTEL G45 DEVBLC", .patch = patch_intel_hdmi }, |
681 | { .id = 0x80862802, .name = "INTEL G45 DEVCTG", .patch = patch_intel_hdmi }, | 680 | { .id = 0x80862802, .name = "INTEL G45 DEVCTG", .patch = patch_intel_hdmi }, |
@@ -683,3 +682,30 @@ struct hda_codec_preset snd_hda_preset_intelhdmi[] = { | |||
683 | { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi }, | 682 | { .id = 0x10951392, .name = "SiI1392 HDMI", .patch = patch_intel_hdmi }, |
684 | {} /* terminator */ | 683 | {} /* terminator */ |
685 | }; | 684 | }; |
685 | |||
686 | MODULE_ALIAS("snd-hda-codec-id:808629fb"); | ||
687 | MODULE_ALIAS("snd-hda-codec-id:80862801"); | ||
688 | MODULE_ALIAS("snd-hda-codec-id:80862802"); | ||
689 | MODULE_ALIAS("snd-hda-codec-id:80862803"); | ||
690 | MODULE_ALIAS("snd-hda-codec-id:10951392"); | ||
691 | |||
692 | MODULE_LICENSE("GPL"); | ||
693 | MODULE_DESCRIPTION("Intel HDMI HD-audio codec"); | ||
694 | |||
695 | static struct hda_codec_preset_list intel_list = { | ||
696 | .preset = snd_hda_preset_intelhdmi, | ||
697 | .owner = THIS_MODULE, | ||
698 | }; | ||
699 | |||
700 | static int __init patch_intelhdmi_init(void) | ||
701 | { | ||
702 | return snd_hda_add_codec_preset(&intel_list); | ||
703 | } | ||
704 | |||
705 | static void __exit patch_intelhdmi_exit(void) | ||
706 | { | ||
707 | snd_hda_delete_codec_preset(&intel_list); | ||
708 | } | ||
709 | |||
710 | module_init(patch_intelhdmi_init) | ||
711 | module_exit(patch_intelhdmi_exit) | ||