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/hda_codec.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/hda_codec.c')
-rw-r--r-- | sound/pci/hda/hda_codec.c | 187 |
1 files changed, 143 insertions, 44 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 1cb85b73e19b..4aa7b1b72877 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include <sound/initval.h> | 31 | #include <sound/initval.h> |
32 | #include "hda_local.h" | 32 | #include "hda_local.h" |
33 | #include <sound/hda_hwdep.h> | 33 | #include <sound/hda_hwdep.h> |
34 | #include "hda_patch.h" /* codec presets */ | ||
35 | 34 | ||
36 | /* | 35 | /* |
37 | * vendor / preset table | 36 | * vendor / preset table |
@@ -62,39 +61,26 @@ static struct hda_vendor_id hda_vendor_ids[] = { | |||
62 | {} /* terminator */ | 61 | {} /* terminator */ |
63 | }; | 62 | }; |
64 | 63 | ||
65 | static const struct hda_codec_preset *hda_preset_tables[] = { | 64 | static DEFINE_MUTEX(preset_mutex); |
66 | #ifdef CONFIG_SND_HDA_CODEC_REALTEK | 65 | static LIST_HEAD(hda_preset_tables); |
67 | snd_hda_preset_realtek, | 66 | |
68 | #endif | 67 | int snd_hda_add_codec_preset(struct hda_codec_preset_list *preset) |
69 | #ifdef CONFIG_SND_HDA_CODEC_CMEDIA | 68 | { |
70 | snd_hda_preset_cmedia, | 69 | mutex_lock(&preset_mutex); |
71 | #endif | 70 | list_add_tail(&preset->list, &hda_preset_tables); |
72 | #ifdef CONFIG_SND_HDA_CODEC_ANALOG | 71 | mutex_unlock(&preset_mutex); |
73 | snd_hda_preset_analog, | 72 | return 0; |
74 | #endif | 73 | } |
75 | #ifdef CONFIG_SND_HDA_CODEC_SIGMATEL | 74 | EXPORT_SYMBOL_GPL(snd_hda_add_codec_preset); |
76 | snd_hda_preset_sigmatel, | 75 | |
77 | #endif | 76 | int snd_hda_delete_codec_preset(struct hda_codec_preset_list *preset) |
78 | #ifdef CONFIG_SND_HDA_CODEC_SI3054 | 77 | { |
79 | snd_hda_preset_si3054, | 78 | mutex_lock(&preset_mutex); |
80 | #endif | 79 | list_del(&preset->list); |
81 | #ifdef CONFIG_SND_HDA_CODEC_ATIHDMI | 80 | mutex_unlock(&preset_mutex); |
82 | snd_hda_preset_atihdmi, | 81 | return 0; |
83 | #endif | 82 | } |
84 | #ifdef CONFIG_SND_HDA_CODEC_CONEXANT | 83 | EXPORT_SYMBOL_GPL(snd_hda_delete_codec_preset); |
85 | snd_hda_preset_conexant, | ||
86 | #endif | ||
87 | #ifdef CONFIG_SND_HDA_CODEC_VIA | ||
88 | snd_hda_preset_via, | ||
89 | #endif | ||
90 | #ifdef CONFIG_SND_HDA_CODEC_NVHDMI | ||
91 | snd_hda_preset_nvhdmi, | ||
92 | #endif | ||
93 | #ifdef CONFIG_SND_HDA_CODEC_INTELHDMI | ||
94 | snd_hda_preset_intelhdmi, | ||
95 | #endif | ||
96 | NULL | ||
97 | }; | ||
98 | 84 | ||
99 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 85 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
100 | static void hda_power_work(struct work_struct *work); | 86 | static void hda_power_work(struct work_struct *work); |
@@ -128,6 +114,7 @@ const char *snd_hda_get_jack_location(u32 cfg) | |||
128 | } | 114 | } |
129 | return "UNKNOWN"; | 115 | return "UNKNOWN"; |
130 | } | 116 | } |
117 | EXPORT_SYMBOL_GPL(snd_hda_get_jack_location); | ||
131 | 118 | ||
132 | const char *snd_hda_get_jack_connectivity(u32 cfg) | 119 | const char *snd_hda_get_jack_connectivity(u32 cfg) |
133 | { | 120 | { |
@@ -135,6 +122,7 @@ const char *snd_hda_get_jack_connectivity(u32 cfg) | |||
135 | 122 | ||
136 | return jack_locations[(cfg >> (AC_DEFCFG_LOCATION_SHIFT + 4)) & 3]; | 123 | return jack_locations[(cfg >> (AC_DEFCFG_LOCATION_SHIFT + 4)) & 3]; |
137 | } | 124 | } |
125 | EXPORT_SYMBOL_GPL(snd_hda_get_jack_connectivity); | ||
138 | 126 | ||
139 | const char *snd_hda_get_jack_type(u32 cfg) | 127 | const char *snd_hda_get_jack_type(u32 cfg) |
140 | { | 128 | { |
@@ -148,6 +136,7 @@ const char *snd_hda_get_jack_type(u32 cfg) | |||
148 | return jack_types[(cfg & AC_DEFCFG_DEVICE) | 136 | return jack_types[(cfg & AC_DEFCFG_DEVICE) |
149 | >> AC_DEFCFG_DEVICE_SHIFT]; | 137 | >> AC_DEFCFG_DEVICE_SHIFT]; |
150 | } | 138 | } |
139 | EXPORT_SYMBOL_GPL(snd_hda_get_jack_type); | ||
151 | 140 | ||
152 | /* | 141 | /* |
153 | * Compose a 32bit command word to be sent to the HD-audio controller | 142 | * Compose a 32bit command word to be sent to the HD-audio controller |
@@ -196,6 +185,7 @@ unsigned int snd_hda_codec_read(struct hda_codec *codec, hda_nid_t nid, | |||
196 | snd_hda_power_down(codec); | 185 | snd_hda_power_down(codec); |
197 | return res; | 186 | return res; |
198 | } | 187 | } |
188 | EXPORT_SYMBOL_GPL(snd_hda_codec_read); | ||
199 | 189 | ||
200 | /** | 190 | /** |
201 | * snd_hda_codec_write - send a single command without waiting for response | 191 | * snd_hda_codec_write - send a single command without waiting for response |
@@ -224,6 +214,7 @@ int snd_hda_codec_write(struct hda_codec *codec, hda_nid_t nid, int direct, | |||
224 | snd_hda_power_down(codec); | 214 | snd_hda_power_down(codec); |
225 | return err; | 215 | return err; |
226 | } | 216 | } |
217 | EXPORT_SYMBOL_GPL(snd_hda_codec_write); | ||
227 | 218 | ||
228 | /** | 219 | /** |
229 | * snd_hda_sequence_write - sequence writes | 220 | * snd_hda_sequence_write - sequence writes |
@@ -238,6 +229,7 @@ void snd_hda_sequence_write(struct hda_codec *codec, const struct hda_verb *seq) | |||
238 | for (; seq->nid; seq++) | 229 | for (; seq->nid; seq++) |
239 | snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param); | 230 | snd_hda_codec_write(codec, seq->nid, 0, seq->verb, seq->param); |
240 | } | 231 | } |
232 | EXPORT_SYMBOL_GPL(snd_hda_sequence_write); | ||
241 | 233 | ||
242 | /** | 234 | /** |
243 | * snd_hda_get_sub_nodes - get the range of sub nodes | 235 | * snd_hda_get_sub_nodes - get the range of sub nodes |
@@ -259,6 +251,7 @@ int snd_hda_get_sub_nodes(struct hda_codec *codec, hda_nid_t nid, | |||
259 | *start_id = (parm >> 16) & 0x7fff; | 251 | *start_id = (parm >> 16) & 0x7fff; |
260 | return (int)(parm & 0x7fff); | 252 | return (int)(parm & 0x7fff); |
261 | } | 253 | } |
254 | EXPORT_SYMBOL_GPL(snd_hda_get_sub_nodes); | ||
262 | 255 | ||
263 | /** | 256 | /** |
264 | * snd_hda_get_connections - get connection list | 257 | * snd_hda_get_connections - get connection list |
@@ -347,6 +340,7 @@ int snd_hda_get_connections(struct hda_codec *codec, hda_nid_t nid, | |||
347 | } | 340 | } |
348 | return conns; | 341 | return conns; |
349 | } | 342 | } |
343 | EXPORT_SYMBOL_GPL(snd_hda_get_connections); | ||
350 | 344 | ||
351 | 345 | ||
352 | /** | 346 | /** |
@@ -381,6 +375,7 @@ int snd_hda_queue_unsol_event(struct hda_bus *bus, u32 res, u32 res_ex) | |||
381 | 375 | ||
382 | return 0; | 376 | return 0; |
383 | } | 377 | } |
378 | EXPORT_SYMBOL_GPL(snd_hda_queue_unsol_event); | ||
384 | 379 | ||
385 | /* | 380 | /* |
386 | * process queued unsolicited events | 381 | * process queued unsolicited events |
@@ -482,7 +477,7 @@ static int snd_hda_bus_dev_register(struct snd_device *device) | |||
482 | * | 477 | * |
483 | * Returns 0 if successful, or a negative error code. | 478 | * Returns 0 if successful, or a negative error code. |
484 | */ | 479 | */ |
485 | int __devinit snd_hda_bus_new(struct snd_card *card, | 480 | int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, |
486 | const struct hda_bus_template *temp, | 481 | const struct hda_bus_template *temp, |
487 | struct hda_bus **busp) | 482 | struct hda_bus **busp) |
488 | { | 483 | { |
@@ -526,6 +521,7 @@ int __devinit snd_hda_bus_new(struct snd_card *card, | |||
526 | *busp = bus; | 521 | *busp = bus; |
527 | return 0; | 522 | return 0; |
528 | } | 523 | } |
524 | EXPORT_SYMBOL_GPL(snd_hda_bus_new); | ||
529 | 525 | ||
530 | #ifdef CONFIG_SND_HDA_GENERIC | 526 | #ifdef CONFIG_SND_HDA_GENERIC |
531 | #define is_generic_config(codec) \ | 527 | #define is_generic_config(codec) \ |
@@ -534,19 +530,33 @@ int __devinit snd_hda_bus_new(struct snd_card *card, | |||
534 | #define is_generic_config(codec) 0 | 530 | #define is_generic_config(codec) 0 |
535 | #endif | 531 | #endif |
536 | 532 | ||
533 | #ifdef CONFIG_SND_HDA_INTEL_MODULE | ||
534 | #define HDA_MODREQ_MAX_COUNT 2 /* two request_modules()'s */ | ||
535 | #else | ||
536 | #define HDA_MODREQ_MAX_COUNT 0 | ||
537 | #endif | ||
538 | |||
537 | /* | 539 | /* |
538 | * find a matching codec preset | 540 | * find a matching codec preset |
539 | */ | 541 | */ |
540 | static const struct hda_codec_preset * | 542 | static const struct hda_codec_preset * |
541 | find_codec_preset(struct hda_codec *codec) | 543 | find_codec_preset(struct hda_codec *codec) |
542 | { | 544 | { |
543 | const struct hda_codec_preset **tbl, *preset; | 545 | struct hda_codec_preset_list *tbl; |
546 | const struct hda_codec_preset *preset; | ||
547 | int mod_requested = 0; | ||
544 | 548 | ||
545 | if (is_generic_config(codec)) | 549 | if (is_generic_config(codec)) |
546 | return NULL; /* use the generic parser */ | 550 | return NULL; /* use the generic parser */ |
547 | 551 | ||
548 | for (tbl = hda_preset_tables; *tbl; tbl++) { | 552 | again: |
549 | for (preset = *tbl; preset->id; preset++) { | 553 | mutex_lock(&preset_mutex); |
554 | list_for_each_entry(tbl, &hda_preset_tables, list) { | ||
555 | if (!try_module_get(tbl->owner)) { | ||
556 | snd_printk(KERN_ERR "hda_codec: cannot module_get\n"); | ||
557 | continue; | ||
558 | } | ||
559 | for (preset = tbl->preset; preset->id; preset++) { | ||
550 | u32 mask = preset->mask; | 560 | u32 mask = preset->mask; |
551 | if (preset->afg && preset->afg != codec->afg) | 561 | if (preset->afg && preset->afg != codec->afg) |
552 | continue; | 562 | continue; |
@@ -556,9 +566,27 @@ find_codec_preset(struct hda_codec *codec) | |||
556 | mask = ~0; | 566 | mask = ~0; |
557 | if (preset->id == (codec->vendor_id & mask) && | 567 | if (preset->id == (codec->vendor_id & mask) && |
558 | (!preset->rev || | 568 | (!preset->rev || |
559 | preset->rev == codec->revision_id)) | 569 | preset->rev == codec->revision_id)) { |
570 | mutex_unlock(&preset_mutex); | ||
571 | codec->owner = tbl->owner; | ||
560 | return preset; | 572 | return preset; |
573 | } | ||
561 | } | 574 | } |
575 | module_put(tbl->owner); | ||
576 | } | ||
577 | mutex_unlock(&preset_mutex); | ||
578 | |||
579 | if (mod_requested < HDA_MODREQ_MAX_COUNT) { | ||
580 | char name[32]; | ||
581 | if (!mod_requested) | ||
582 | snprintf(name, sizeof(name), "snd-hda-codec-id:%08x", | ||
583 | codec->vendor_id); | ||
584 | else | ||
585 | snprintf(name, sizeof(name), "snd-hda-codec-id:%04x*", | ||
586 | (codec->vendor_id >> 16) & 0xffff); | ||
587 | request_module(name); | ||
588 | mod_requested++; | ||
589 | goto again; | ||
562 | } | 590 | } |
563 | return NULL; | 591 | return NULL; |
564 | } | 592 | } |
@@ -598,7 +626,7 @@ static int get_codec_name(struct hda_codec *codec) | |||
598 | /* | 626 | /* |
599 | * look for an AFG and MFG nodes | 627 | * look for an AFG and MFG nodes |
600 | */ | 628 | */ |
601 | static void __devinit setup_fg_nodes(struct hda_codec *codec) | 629 | static void /*__devinit*/ setup_fg_nodes(struct hda_codec *codec) |
602 | { | 630 | { |
603 | int i, total_nodes; | 631 | int i, total_nodes; |
604 | hda_nid_t nid; | 632 | hda_nid_t nid; |
@@ -661,6 +689,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
661 | codec->bus->caddr_tbl[codec->addr] = NULL; | 689 | codec->bus->caddr_tbl[codec->addr] = NULL; |
662 | if (codec->patch_ops.free) | 690 | if (codec->patch_ops.free) |
663 | codec->patch_ops.free(codec); | 691 | codec->patch_ops.free(codec); |
692 | module_put(codec->owner); | ||
664 | free_hda_cache(&codec->amp_cache); | 693 | free_hda_cache(&codec->amp_cache); |
665 | free_hda_cache(&codec->cmd_cache); | 694 | free_hda_cache(&codec->cmd_cache); |
666 | kfree(codec->name); | 695 | kfree(codec->name); |
@@ -677,7 +706,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
677 | * | 706 | * |
678 | * Returns 0 if successful, or a negative error code. | 707 | * Returns 0 if successful, or a negative error code. |
679 | */ | 708 | */ |
680 | int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | 709 | int /*__devinit*/ snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, |
681 | struct hda_codec **codecp) | 710 | struct hda_codec **codecp) |
682 | { | 711 | { |
683 | struct hda_codec *codec; | 712 | struct hda_codec *codec; |
@@ -779,6 +808,7 @@ int __devinit snd_hda_codec_new(struct hda_bus *bus, unsigned int codec_addr, | |||
779 | *codecp = codec; | 808 | *codecp = codec; |
780 | return 0; | 809 | return 0; |
781 | } | 810 | } |
811 | EXPORT_SYMBOL_GPL(snd_hda_codec_new); | ||
782 | 812 | ||
783 | int snd_hda_codec_configure(struct hda_codec *codec) | 813 | int snd_hda_codec_configure(struct hda_codec *codec) |
784 | { | 814 | { |
@@ -838,6 +868,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid, | |||
838 | msleep(1); | 868 | msleep(1); |
839 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format); | 869 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, format); |
840 | } | 870 | } |
871 | EXPORT_SYMBOL_GPL(snd_hda_codec_setup_stream); | ||
841 | 872 | ||
842 | void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | 873 | void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) |
843 | { | 874 | { |
@@ -851,6 +882,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | |||
851 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0); | 882 | snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_STREAM_FORMAT, 0); |
852 | #endif | 883 | #endif |
853 | } | 884 | } |
885 | EXPORT_SYMBOL_GPL(snd_hda_codec_cleanup_stream); | ||
854 | 886 | ||
855 | /* | 887 | /* |
856 | * amp access functions | 888 | * amp access functions |
@@ -862,7 +894,7 @@ void snd_hda_codec_cleanup_stream(struct hda_codec *codec, hda_nid_t nid) | |||
862 | #define INFO_AMP_VOL(ch) (1 << (1 + (ch))) | 894 | #define INFO_AMP_VOL(ch) (1 << (1 + (ch))) |
863 | 895 | ||
864 | /* initialize the hash table */ | 896 | /* initialize the hash table */ |
865 | static void __devinit init_hda_cache(struct hda_cache_rec *cache, | 897 | static void /*__devinit*/ init_hda_cache(struct hda_cache_rec *cache, |
866 | unsigned int record_size) | 898 | unsigned int record_size) |
867 | { | 899 | { |
868 | memset(cache, 0, sizeof(*cache)); | 900 | memset(cache, 0, sizeof(*cache)); |
@@ -932,6 +964,7 @@ u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) | |||
932 | } | 964 | } |
933 | return info->amp_caps; | 965 | return info->amp_caps; |
934 | } | 966 | } |
967 | EXPORT_SYMBOL_GPL(query_amp_caps); | ||
935 | 968 | ||
936 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | 969 | int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, |
937 | unsigned int caps) | 970 | unsigned int caps) |
@@ -945,6 +978,7 @@ int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, | |||
945 | info->head.val |= INFO_AMP_CAPS; | 978 | info->head.val |= INFO_AMP_CAPS; |
946 | return 0; | 979 | return 0; |
947 | } | 980 | } |
981 | EXPORT_SYMBOL_GPL(snd_hda_override_amp_caps); | ||
948 | 982 | ||
949 | /* | 983 | /* |
950 | * read the current volume to info | 984 | * read the current volume to info |
@@ -998,6 +1032,7 @@ int snd_hda_codec_amp_read(struct hda_codec *codec, hda_nid_t nid, int ch, | |||
998 | return 0; | 1032 | return 0; |
999 | return get_vol_mute(codec, info, nid, ch, direction, index); | 1033 | return get_vol_mute(codec, info, nid, ch, direction, index); |
1000 | } | 1034 | } |
1035 | EXPORT_SYMBOL_GPL(snd_hda_codec_amp_read); | ||
1001 | 1036 | ||
1002 | /* | 1037 | /* |
1003 | * update the AMP value, mask = bit mask to set, val = the value | 1038 | * update the AMP value, mask = bit mask to set, val = the value |
@@ -1017,6 +1052,7 @@ int snd_hda_codec_amp_update(struct hda_codec *codec, hda_nid_t nid, int ch, | |||
1017 | put_vol_mute(codec, info, nid, ch, direction, idx, val); | 1052 | put_vol_mute(codec, info, nid, ch, direction, idx, val); |
1018 | return 1; | 1053 | return 1; |
1019 | } | 1054 | } |
1055 | EXPORT_SYMBOL_GPL(snd_hda_codec_amp_update); | ||
1020 | 1056 | ||
1021 | /* | 1057 | /* |
1022 | * update the AMP stereo with the same mask and value | 1058 | * update the AMP stereo with the same mask and value |
@@ -1030,6 +1066,7 @@ int snd_hda_codec_amp_stereo(struct hda_codec *codec, hda_nid_t nid, | |||
1030 | idx, mask, val); | 1066 | idx, mask, val); |
1031 | return ret; | 1067 | return ret; |
1032 | } | 1068 | } |
1069 | EXPORT_SYMBOL_GPL(snd_hda_codec_amp_stereo); | ||
1033 | 1070 | ||
1034 | #ifdef SND_HDA_NEEDS_RESUME | 1071 | #ifdef SND_HDA_NEEDS_RESUME |
1035 | /* resume the all amp commands from the cache */ | 1072 | /* resume the all amp commands from the cache */ |
@@ -1055,6 +1092,7 @@ void snd_hda_codec_resume_amp(struct hda_codec *codec) | |||
1055 | } | 1092 | } |
1056 | } | 1093 | } |
1057 | } | 1094 | } |
1095 | EXPORT_SYMBOL_GPL(snd_hda_codec_resume_amp); | ||
1058 | #endif /* SND_HDA_NEEDS_RESUME */ | 1096 | #endif /* SND_HDA_NEEDS_RESUME */ |
1059 | 1097 | ||
1060 | /* volume */ | 1098 | /* volume */ |
@@ -1082,6 +1120,7 @@ int snd_hda_mixer_amp_volume_info(struct snd_kcontrol *kcontrol, | |||
1082 | uinfo->value.integer.max = caps; | 1120 | uinfo->value.integer.max = caps; |
1083 | return 0; | 1121 | return 0; |
1084 | } | 1122 | } |
1123 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_info); | ||
1085 | 1124 | ||
1086 | int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, | 1125 | int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, |
1087 | struct snd_ctl_elem_value *ucontrol) | 1126 | struct snd_ctl_elem_value *ucontrol) |
@@ -1101,6 +1140,7 @@ int snd_hda_mixer_amp_volume_get(struct snd_kcontrol *kcontrol, | |||
1101 | & HDA_AMP_VOLMASK; | 1140 | & HDA_AMP_VOLMASK; |
1102 | return 0; | 1141 | return 0; |
1103 | } | 1142 | } |
1143 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_get); | ||
1104 | 1144 | ||
1105 | int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, | 1145 | int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, |
1106 | struct snd_ctl_elem_value *ucontrol) | 1146 | struct snd_ctl_elem_value *ucontrol) |
@@ -1125,6 +1165,7 @@ int snd_hda_mixer_amp_volume_put(struct snd_kcontrol *kcontrol, | |||
1125 | snd_hda_power_down(codec); | 1165 | snd_hda_power_down(codec); |
1126 | return change; | 1166 | return change; |
1127 | } | 1167 | } |
1168 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_volume_put); | ||
1128 | 1169 | ||
1129 | int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, | 1170 | int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, |
1130 | unsigned int size, unsigned int __user *_tlv) | 1171 | unsigned int size, unsigned int __user *_tlv) |
@@ -1151,6 +1192,7 @@ int snd_hda_mixer_amp_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1151 | return -EFAULT; | 1192 | return -EFAULT; |
1152 | return 0; | 1193 | return 0; |
1153 | } | 1194 | } |
1195 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_tlv); | ||
1154 | 1196 | ||
1155 | /* | 1197 | /* |
1156 | * set (static) TLV for virtual master volume; recalculated as max 0dB | 1198 | * set (static) TLV for virtual master volume; recalculated as max 0dB |
@@ -1170,6 +1212,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir, | |||
1170 | tlv[2] = -nums * step; | 1212 | tlv[2] = -nums * step; |
1171 | tlv[3] = step; | 1213 | tlv[3] = step; |
1172 | } | 1214 | } |
1215 | EXPORT_SYMBOL_GPL(snd_hda_set_vmaster_tlv); | ||
1173 | 1216 | ||
1174 | /* find a mixer control element with the given name */ | 1217 | /* find a mixer control element with the given name */ |
1175 | static struct snd_kcontrol * | 1218 | static struct snd_kcontrol * |
@@ -1189,6 +1232,7 @@ struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec, | |||
1189 | { | 1232 | { |
1190 | return _snd_hda_find_mixer_ctl(codec, name, 0); | 1233 | return _snd_hda_find_mixer_ctl(codec, name, 0); |
1191 | } | 1234 | } |
1235 | EXPORT_SYMBOL_GPL(snd_hda_find_mixer_ctl); | ||
1192 | 1236 | ||
1193 | /* Add a control element and assign to the codec */ | 1237 | /* Add a control element and assign to the codec */ |
1194 | int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl) | 1238 | int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl) |
@@ -1205,6 +1249,7 @@ int snd_hda_ctl_add(struct hda_codec *codec, struct snd_kcontrol *kctl) | |||
1205 | *knewp = kctl; | 1249 | *knewp = kctl; |
1206 | return 0; | 1250 | return 0; |
1207 | } | 1251 | } |
1252 | EXPORT_SYMBOL_GPL(snd_hda_ctl_add); | ||
1208 | 1253 | ||
1209 | #ifdef CONFIG_SND_HDA_RECONFIG | 1254 | #ifdef CONFIG_SND_HDA_RECONFIG |
1210 | /* Clear all controls assigned to the given codec */ | 1255 | /* Clear all controls assigned to the given codec */ |
@@ -1243,6 +1288,8 @@ void snd_hda_codec_reset(struct hda_codec *codec) | |||
1243 | codec->num_pcms = 0; | 1288 | codec->num_pcms = 0; |
1244 | codec->pcm_info = NULL; | 1289 | codec->pcm_info = NULL; |
1245 | codec->preset = NULL; | 1290 | codec->preset = NULL; |
1291 | module_put(codec->owner); | ||
1292 | codec->owner = NULL; | ||
1246 | } | 1293 | } |
1247 | #endif /* CONFIG_SND_HDA_RECONFIG */ | 1294 | #endif /* CONFIG_SND_HDA_RECONFIG */ |
1248 | 1295 | ||
@@ -1281,6 +1328,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | |||
1281 | } | 1328 | } |
1282 | return 0; | 1329 | return 0; |
1283 | } | 1330 | } |
1331 | EXPORT_SYMBOL_GPL(snd_hda_add_vmaster); | ||
1284 | 1332 | ||
1285 | /* switch */ | 1333 | /* switch */ |
1286 | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, | 1334 | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, |
@@ -1294,6 +1342,7 @@ int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, | |||
1294 | uinfo->value.integer.max = 1; | 1342 | uinfo->value.integer.max = 1; |
1295 | return 0; | 1343 | return 0; |
1296 | } | 1344 | } |
1345 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_info); | ||
1297 | 1346 | ||
1298 | int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, | 1347 | int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, |
1299 | struct snd_ctl_elem_value *ucontrol) | 1348 | struct snd_ctl_elem_value *ucontrol) |
@@ -1313,6 +1362,7 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, | |||
1313 | HDA_AMP_MUTE) ? 0 : 1; | 1362 | HDA_AMP_MUTE) ? 0 : 1; |
1314 | return 0; | 1363 | return 0; |
1315 | } | 1364 | } |
1365 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_get); | ||
1316 | 1366 | ||
1317 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | 1367 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, |
1318 | struct snd_ctl_elem_value *ucontrol) | 1368 | struct snd_ctl_elem_value *ucontrol) |
@@ -1343,6 +1393,7 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | |||
1343 | snd_hda_power_down(codec); | 1393 | snd_hda_power_down(codec); |
1344 | return change; | 1394 | return change; |
1345 | } | 1395 | } |
1396 | EXPORT_SYMBOL_GPL(snd_hda_mixer_amp_switch_put); | ||
1346 | 1397 | ||
1347 | /* | 1398 | /* |
1348 | * bound volume controls | 1399 | * bound volume controls |
@@ -1368,6 +1419,7 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, | |||
1368 | mutex_unlock(&codec->spdif_mutex); | 1419 | mutex_unlock(&codec->spdif_mutex); |
1369 | return err; | 1420 | return err; |
1370 | } | 1421 | } |
1422 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_get); | ||
1371 | 1423 | ||
1372 | int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | 1424 | int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, |
1373 | struct snd_ctl_elem_value *ucontrol) | 1425 | struct snd_ctl_elem_value *ucontrol) |
@@ -1391,6 +1443,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | |||
1391 | mutex_unlock(&codec->spdif_mutex); | 1443 | mutex_unlock(&codec->spdif_mutex); |
1392 | return err < 0 ? err : change; | 1444 | return err < 0 ? err : change; |
1393 | } | 1445 | } |
1446 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_switch_put); | ||
1394 | 1447 | ||
1395 | /* | 1448 | /* |
1396 | * generic bound volume/swtich controls | 1449 | * generic bound volume/swtich controls |
@@ -1410,6 +1463,7 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, | |||
1410 | mutex_unlock(&codec->spdif_mutex); | 1463 | mutex_unlock(&codec->spdif_mutex); |
1411 | return err; | 1464 | return err; |
1412 | } | 1465 | } |
1466 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_info); | ||
1413 | 1467 | ||
1414 | int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, | 1468 | int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, |
1415 | struct snd_ctl_elem_value *ucontrol) | 1469 | struct snd_ctl_elem_value *ucontrol) |
@@ -1426,6 +1480,7 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, | |||
1426 | mutex_unlock(&codec->spdif_mutex); | 1480 | mutex_unlock(&codec->spdif_mutex); |
1427 | return err; | 1481 | return err; |
1428 | } | 1482 | } |
1483 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_get); | ||
1429 | 1484 | ||
1430 | int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | 1485 | int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, |
1431 | struct snd_ctl_elem_value *ucontrol) | 1486 | struct snd_ctl_elem_value *ucontrol) |
@@ -1448,6 +1503,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | |||
1448 | mutex_unlock(&codec->spdif_mutex); | 1503 | mutex_unlock(&codec->spdif_mutex); |
1449 | return err < 0 ? err : change; | 1504 | return err < 0 ? err : change; |
1450 | } | 1505 | } |
1506 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_ctls_put); | ||
1451 | 1507 | ||
1452 | int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, | 1508 | int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, |
1453 | unsigned int size, unsigned int __user *tlv) | 1509 | unsigned int size, unsigned int __user *tlv) |
@@ -1464,6 +1520,7 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1464 | mutex_unlock(&codec->spdif_mutex); | 1520 | mutex_unlock(&codec->spdif_mutex); |
1465 | return err; | 1521 | return err; |
1466 | } | 1522 | } |
1523 | EXPORT_SYMBOL_GPL(snd_hda_mixer_bind_tlv); | ||
1467 | 1524 | ||
1468 | struct hda_ctl_ops snd_hda_bind_vol = { | 1525 | struct hda_ctl_ops snd_hda_bind_vol = { |
1469 | .info = snd_hda_mixer_amp_volume_info, | 1526 | .info = snd_hda_mixer_amp_volume_info, |
@@ -1471,6 +1528,7 @@ struct hda_ctl_ops snd_hda_bind_vol = { | |||
1471 | .put = snd_hda_mixer_amp_volume_put, | 1528 | .put = snd_hda_mixer_amp_volume_put, |
1472 | .tlv = snd_hda_mixer_amp_tlv | 1529 | .tlv = snd_hda_mixer_amp_tlv |
1473 | }; | 1530 | }; |
1531 | EXPORT_SYMBOL_GPL(snd_hda_bind_vol); | ||
1474 | 1532 | ||
1475 | struct hda_ctl_ops snd_hda_bind_sw = { | 1533 | struct hda_ctl_ops snd_hda_bind_sw = { |
1476 | .info = snd_hda_mixer_amp_switch_info, | 1534 | .info = snd_hda_mixer_amp_switch_info, |
@@ -1478,6 +1536,7 @@ struct hda_ctl_ops snd_hda_bind_sw = { | |||
1478 | .put = snd_hda_mixer_amp_switch_put, | 1536 | .put = snd_hda_mixer_amp_switch_put, |
1479 | .tlv = snd_hda_mixer_amp_tlv | 1537 | .tlv = snd_hda_mixer_amp_tlv |
1480 | }; | 1538 | }; |
1539 | EXPORT_SYMBOL_GPL(snd_hda_bind_sw); | ||
1481 | 1540 | ||
1482 | /* | 1541 | /* |
1483 | * SPDIF out controls | 1542 | * SPDIF out controls |
@@ -1739,6 +1798,7 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) | |||
1739 | codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); | 1798 | codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); |
1740 | return 0; | 1799 | return 0; |
1741 | } | 1800 | } |
1801 | EXPORT_SYMBOL_GPL(snd_hda_create_spdif_out_ctls); | ||
1742 | 1802 | ||
1743 | /* | 1803 | /* |
1744 | * SPDIF sharing with analog output | 1804 | * SPDIF sharing with analog output |
@@ -1776,6 +1836,7 @@ int snd_hda_create_spdif_share_sw(struct hda_codec *codec, | |||
1776 | return snd_hda_ctl_add(codec, | 1836 | return snd_hda_ctl_add(codec, |
1777 | snd_ctl_new1(&spdif_share_sw, mout)); | 1837 | snd_ctl_new1(&spdif_share_sw, mout)); |
1778 | } | 1838 | } |
1839 | EXPORT_SYMBOL_GPL(snd_hda_create_spdif_share_sw); | ||
1779 | 1840 | ||
1780 | /* | 1841 | /* |
1781 | * SPDIF input | 1842 | * SPDIF input |
@@ -1885,6 +1946,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) | |||
1885 | AC_DIG1_ENABLE; | 1946 | AC_DIG1_ENABLE; |
1886 | return 0; | 1947 | return 0; |
1887 | } | 1948 | } |
1949 | EXPORT_SYMBOL_GPL(snd_hda_create_spdif_in_ctls); | ||
1888 | 1950 | ||
1889 | #ifdef SND_HDA_NEEDS_RESUME | 1951 | #ifdef SND_HDA_NEEDS_RESUME |
1890 | /* | 1952 | /* |
@@ -1930,6 +1992,7 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid, | |||
1930 | snd_hda_power_down(codec); | 1992 | snd_hda_power_down(codec); |
1931 | return err; | 1993 | return err; |
1932 | } | 1994 | } |
1995 | EXPORT_SYMBOL_GPL(snd_hda_codec_write_cache); | ||
1933 | 1996 | ||
1934 | /* resume the all commands from the cache */ | 1997 | /* resume the all commands from the cache */ |
1935 | void snd_hda_codec_resume_cache(struct hda_codec *codec) | 1998 | void snd_hda_codec_resume_cache(struct hda_codec *codec) |
@@ -1945,6 +2008,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec) | |||
1945 | get_cmd_cache_cmd(key), buffer->val); | 2008 | get_cmd_cache_cmd(key), buffer->val); |
1946 | } | 2009 | } |
1947 | } | 2010 | } |
2011 | EXPORT_SYMBOL_GPL(snd_hda_codec_resume_cache); | ||
1948 | 2012 | ||
1949 | /** | 2013 | /** |
1950 | * snd_hda_sequence_write_cache - sequence writes with caching | 2014 | * snd_hda_sequence_write_cache - sequence writes with caching |
@@ -1962,6 +2026,7 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec, | |||
1962 | snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb, | 2026 | snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb, |
1963 | seq->param); | 2027 | seq->param); |
1964 | } | 2028 | } |
2029 | EXPORT_SYMBOL_GPL(snd_hda_sequence_write_cache); | ||
1965 | #endif /* SND_HDA_NEEDS_RESUME */ | 2030 | #endif /* SND_HDA_NEEDS_RESUME */ |
1966 | 2031 | ||
1967 | /* | 2032 | /* |
@@ -2080,7 +2145,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
2080 | * | 2145 | * |
2081 | * Returns 0 if successful, otherwise a negative error code. | 2146 | * Returns 0 if successful, otherwise a negative error code. |
2082 | */ | 2147 | */ |
2083 | int __devinit snd_hda_build_controls(struct hda_bus *bus) | 2148 | int /*__devinit*/ snd_hda_build_controls(struct hda_bus *bus) |
2084 | { | 2149 | { |
2085 | struct hda_codec *codec; | 2150 | struct hda_codec *codec; |
2086 | 2151 | ||
@@ -2091,6 +2156,7 @@ int __devinit snd_hda_build_controls(struct hda_bus *bus) | |||
2091 | } | 2156 | } |
2092 | return 0; | 2157 | return 0; |
2093 | } | 2158 | } |
2159 | EXPORT_SYMBOL_GPL(snd_hda_build_controls); | ||
2094 | 2160 | ||
2095 | int snd_hda_codec_build_controls(struct hda_codec *codec) | 2161 | int snd_hda_codec_build_controls(struct hda_codec *codec) |
2096 | { | 2162 | { |
@@ -2202,6 +2268,7 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, | |||
2202 | 2268 | ||
2203 | return val; | 2269 | return val; |
2204 | } | 2270 | } |
2271 | EXPORT_SYMBOL_GPL(snd_hda_calc_stream_format); | ||
2205 | 2272 | ||
2206 | /** | 2273 | /** |
2207 | * snd_hda_query_supported_pcm - query the supported PCM rates and formats | 2274 | * snd_hda_query_supported_pcm - query the supported PCM rates and formats |
@@ -2381,6 +2448,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, | |||
2381 | 2448 | ||
2382 | return 1; | 2449 | return 1; |
2383 | } | 2450 | } |
2451 | EXPORT_SYMBOL_GPL(snd_hda_is_supported_format); | ||
2384 | 2452 | ||
2385 | /* | 2453 | /* |
2386 | * PCM stuff | 2454 | * PCM stuff |
@@ -2578,6 +2646,7 @@ int __devinit snd_hda_build_pcms(struct hda_bus *bus) | |||
2578 | } | 2646 | } |
2579 | return 0; | 2647 | return 0; |
2580 | } | 2648 | } |
2649 | EXPORT_SYMBOL_GPL(snd_hda_build_pcms); | ||
2581 | 2650 | ||
2582 | /** | 2651 | /** |
2583 | * snd_hda_check_board_config - compare the current codec with the config table | 2652 | * snd_hda_check_board_config - compare the current codec with the config table |
@@ -2633,6 +2702,7 @@ int snd_hda_check_board_config(struct hda_codec *codec, | |||
2633 | } | 2702 | } |
2634 | return -1; | 2703 | return -1; |
2635 | } | 2704 | } |
2705 | EXPORT_SYMBOL_GPL(snd_hda_check_board_config); | ||
2636 | 2706 | ||
2637 | /** | 2707 | /** |
2638 | * snd_hda_add_new_ctls - create controls from the array | 2708 | * snd_hda_add_new_ctls - create controls from the array |
@@ -2668,6 +2738,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) | |||
2668 | } | 2738 | } |
2669 | return 0; | 2739 | return 0; |
2670 | } | 2740 | } |
2741 | EXPORT_SYMBOL_GPL(snd_hda_add_new_ctls); | ||
2671 | 2742 | ||
2672 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2743 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
2673 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | 2744 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, |
@@ -2710,6 +2781,10 @@ void snd_hda_power_up(struct hda_codec *codec) | |||
2710 | cancel_delayed_work(&codec->power_work); | 2781 | cancel_delayed_work(&codec->power_work); |
2711 | codec->power_transition = 0; | 2782 | codec->power_transition = 0; |
2712 | } | 2783 | } |
2784 | EXPORT_SYMBOL_GPL(snd_hda_power_up); | ||
2785 | |||
2786 | #define power_save(codec) \ | ||
2787 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | ||
2713 | 2788 | ||
2714 | #define power_save(codec) \ | 2789 | #define power_save(codec) \ |
2715 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | 2790 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) |
@@ -2725,6 +2800,7 @@ void snd_hda_power_down(struct hda_codec *codec) | |||
2725 | msecs_to_jiffies(power_save(codec) * 1000)); | 2800 | msecs_to_jiffies(power_save(codec) * 1000)); |
2726 | } | 2801 | } |
2727 | } | 2802 | } |
2803 | EXPORT_SYMBOL_GPL(snd_hda_power_down); | ||
2728 | 2804 | ||
2729 | int snd_hda_check_amp_list_power(struct hda_codec *codec, | 2805 | int snd_hda_check_amp_list_power(struct hda_codec *codec, |
2730 | struct hda_loopback_check *check, | 2806 | struct hda_loopback_check *check, |
@@ -2761,6 +2837,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, | |||
2761 | } | 2837 | } |
2762 | return 0; | 2838 | return 0; |
2763 | } | 2839 | } |
2840 | EXPORT_SYMBOL_GPL(snd_hda_check_amp_list_power); | ||
2764 | #endif | 2841 | #endif |
2765 | 2842 | ||
2766 | /* | 2843 | /* |
@@ -2780,6 +2857,7 @@ int snd_hda_ch_mode_info(struct hda_codec *codec, | |||
2780 | chmode[uinfo->value.enumerated.item].channels); | 2857 | chmode[uinfo->value.enumerated.item].channels); |
2781 | return 0; | 2858 | return 0; |
2782 | } | 2859 | } |
2860 | EXPORT_SYMBOL_GPL(snd_hda_ch_mode_info); | ||
2783 | 2861 | ||
2784 | int snd_hda_ch_mode_get(struct hda_codec *codec, | 2862 | int snd_hda_ch_mode_get(struct hda_codec *codec, |
2785 | struct snd_ctl_elem_value *ucontrol, | 2863 | struct snd_ctl_elem_value *ucontrol, |
@@ -2797,6 +2875,7 @@ int snd_hda_ch_mode_get(struct hda_codec *codec, | |||
2797 | } | 2875 | } |
2798 | return 0; | 2876 | return 0; |
2799 | } | 2877 | } |
2878 | EXPORT_SYMBOL_GPL(snd_hda_ch_mode_get); | ||
2800 | 2879 | ||
2801 | int snd_hda_ch_mode_put(struct hda_codec *codec, | 2880 | int snd_hda_ch_mode_put(struct hda_codec *codec, |
2802 | struct snd_ctl_elem_value *ucontrol, | 2881 | struct snd_ctl_elem_value *ucontrol, |
@@ -2817,6 +2896,7 @@ int snd_hda_ch_mode_put(struct hda_codec *codec, | |||
2817 | snd_hda_sequence_write_cache(codec, chmode[mode].sequence); | 2896 | snd_hda_sequence_write_cache(codec, chmode[mode].sequence); |
2818 | return 1; | 2897 | return 1; |
2819 | } | 2898 | } |
2899 | EXPORT_SYMBOL_GPL(snd_hda_ch_mode_put); | ||
2820 | 2900 | ||
2821 | /* | 2901 | /* |
2822 | * input MUX helper | 2902 | * input MUX helper |
@@ -2837,6 +2917,7 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux, | |||
2837 | strcpy(uinfo->value.enumerated.name, imux->items[index].label); | 2917 | strcpy(uinfo->value.enumerated.name, imux->items[index].label); |
2838 | return 0; | 2918 | return 0; |
2839 | } | 2919 | } |
2920 | EXPORT_SYMBOL_GPL(snd_hda_input_mux_info); | ||
2840 | 2921 | ||
2841 | int snd_hda_input_mux_put(struct hda_codec *codec, | 2922 | int snd_hda_input_mux_put(struct hda_codec *codec, |
2842 | const struct hda_input_mux *imux, | 2923 | const struct hda_input_mux *imux, |
@@ -2858,6 +2939,7 @@ int snd_hda_input_mux_put(struct hda_codec *codec, | |||
2858 | *cur_val = idx; | 2939 | *cur_val = idx; |
2859 | return 1; | 2940 | return 1; |
2860 | } | 2941 | } |
2942 | EXPORT_SYMBOL_GPL(snd_hda_input_mux_put); | ||
2861 | 2943 | ||
2862 | 2944 | ||
2863 | /* | 2945 | /* |
@@ -2910,6 +2992,7 @@ int snd_hda_multi_out_dig_open(struct hda_codec *codec, | |||
2910 | mutex_unlock(&codec->spdif_mutex); | 2992 | mutex_unlock(&codec->spdif_mutex); |
2911 | return 0; | 2993 | return 0; |
2912 | } | 2994 | } |
2995 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_open); | ||
2913 | 2996 | ||
2914 | int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, | 2997 | int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, |
2915 | struct hda_multi_out *mout, | 2998 | struct hda_multi_out *mout, |
@@ -2922,6 +3005,7 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, | |||
2922 | mutex_unlock(&codec->spdif_mutex); | 3005 | mutex_unlock(&codec->spdif_mutex); |
2923 | return 0; | 3006 | return 0; |
2924 | } | 3007 | } |
3008 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_prepare); | ||
2925 | 3009 | ||
2926 | /* | 3010 | /* |
2927 | * release the digital out | 3011 | * release the digital out |
@@ -2934,6 +3018,7 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec, | |||
2934 | mutex_unlock(&codec->spdif_mutex); | 3018 | mutex_unlock(&codec->spdif_mutex); |
2935 | return 0; | 3019 | return 0; |
2936 | } | 3020 | } |
3021 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_dig_close); | ||
2937 | 3022 | ||
2938 | /* | 3023 | /* |
2939 | * set up more restrictions for analog out | 3024 | * set up more restrictions for analog out |
@@ -2973,6 +3058,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec, | |||
2973 | return snd_pcm_hw_constraint_step(substream->runtime, 0, | 3058 | return snd_pcm_hw_constraint_step(substream->runtime, 0, |
2974 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); | 3059 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); |
2975 | } | 3060 | } |
3061 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_open); | ||
2976 | 3062 | ||
2977 | /* | 3063 | /* |
2978 | * set up the i/o for analog out | 3064 | * set up the i/o for analog out |
@@ -3031,6 +3117,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, | |||
3031 | } | 3117 | } |
3032 | return 0; | 3118 | return 0; |
3033 | } | 3119 | } |
3120 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_prepare); | ||
3034 | 3121 | ||
3035 | /* | 3122 | /* |
3036 | * clean up the setting for analog out | 3123 | * clean up the setting for analog out |
@@ -3057,6 +3144,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, | |||
3057 | mutex_unlock(&codec->spdif_mutex); | 3144 | mutex_unlock(&codec->spdif_mutex); |
3058 | return 0; | 3145 | return 0; |
3059 | } | 3146 | } |
3147 | EXPORT_SYMBOL_GPL(snd_hda_multi_out_analog_cleanup); | ||
3060 | 3148 | ||
3061 | /* | 3149 | /* |
3062 | * Helper for automatic pin configuration | 3150 | * Helper for automatic pin configuration |
@@ -3342,11 +3430,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
3342 | 3430 | ||
3343 | return 0; | 3431 | return 0; |
3344 | } | 3432 | } |
3433 | EXPORT_SYMBOL_GPL(snd_hda_parse_pin_def_config); | ||
3345 | 3434 | ||
3346 | /* labels for input pins */ | 3435 | /* labels for input pins */ |
3347 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { | 3436 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { |
3348 | "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" | 3437 | "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" |
3349 | }; | 3438 | }; |
3439 | EXPORT_SYMBOL_GPL(auto_pin_cfg_labels); | ||
3350 | 3440 | ||
3351 | 3441 | ||
3352 | #ifdef CONFIG_PM | 3442 | #ifdef CONFIG_PM |
@@ -3374,6 +3464,7 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) | |||
3374 | } | 3464 | } |
3375 | return 0; | 3465 | return 0; |
3376 | } | 3466 | } |
3467 | EXPORT_SYMBOL_GPL(snd_hda_suspend); | ||
3377 | 3468 | ||
3378 | /** | 3469 | /** |
3379 | * snd_hda_resume - resume the codecs | 3470 | * snd_hda_resume - resume the codecs |
@@ -3394,7 +3485,8 @@ int snd_hda_resume(struct hda_bus *bus) | |||
3394 | } | 3485 | } |
3395 | return 0; | 3486 | return 0; |
3396 | } | 3487 | } |
3397 | #endif | 3488 | EXPORT_SYMBOL_GPL(snd_hda_resume); |
3489 | #endif /* CONFIG_PM */ | ||
3398 | 3490 | ||
3399 | /* | 3491 | /* |
3400 | * generic arrays | 3492 | * generic arrays |
@@ -3423,6 +3515,7 @@ void *snd_array_new(struct snd_array *array) | |||
3423 | } | 3515 | } |
3424 | return snd_array_elem(array, array->used++); | 3516 | return snd_array_elem(array, array->used++); |
3425 | } | 3517 | } |
3518 | EXPORT_SYMBOL_GPL(snd_array_new); | ||
3426 | 3519 | ||
3427 | /* free the given array elements */ | 3520 | /* free the given array elements */ |
3428 | void snd_array_free(struct snd_array *array) | 3521 | void snd_array_free(struct snd_array *array) |
@@ -3432,6 +3525,7 @@ void snd_array_free(struct snd_array *array) | |||
3432 | array->alloced = 0; | 3525 | array->alloced = 0; |
3433 | array->list = NULL; | 3526 | array->list = NULL; |
3434 | } | 3527 | } |
3528 | EXPORT_SYMBOL_GPL(snd_array_free); | ||
3435 | 3529 | ||
3436 | /* | 3530 | /* |
3437 | * used by hda_proc.c and hda_eld.c | 3531 | * used by hda_proc.c and hda_eld.c |
@@ -3450,6 +3544,7 @@ void snd_print_pcm_rates(int pcm, char *buf, int buflen) | |||
3450 | 3544 | ||
3451 | buf[j] = '\0'; /* necessary when j == 0 */ | 3545 | buf[j] = '\0'; /* necessary when j == 0 */ |
3452 | } | 3546 | } |
3547 | EXPORT_SYMBOL_GPL(snd_print_pcm_rates); | ||
3453 | 3548 | ||
3454 | void snd_print_pcm_bits(int pcm, char *buf, int buflen) | 3549 | void snd_print_pcm_bits(int pcm, char *buf, int buflen) |
3455 | { | 3550 | { |
@@ -3462,3 +3557,7 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen) | |||
3462 | 3557 | ||
3463 | buf[j] = '\0'; /* necessary when j == 0 */ | 3558 | buf[j] = '\0'; /* necessary when j == 0 */ |
3464 | } | 3559 | } |
3560 | EXPORT_SYMBOL_GPL(snd_print_pcm_bits); | ||
3561 | |||
3562 | MODULE_DESCRIPTION("HDA codec core"); | ||
3563 | MODULE_LICENSE("GPL"); | ||