diff options
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 a867e1e8658..d49d0b69868 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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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 MODULE | ||
534 | #define HDA_MODREQ_MAX_COUNT 2 /* two request_modules()'s */ | ||
535 | #else | ||
536 | #define HDA_MODREQ_MAX_COUNT 0 /* all presets are statically linked */ | ||
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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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_HDA(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 */ |
@@ -1244,6 +1289,8 @@ void snd_hda_codec_reset(struct hda_codec *codec) | |||
1244 | codec->num_pcms = 0; | 1289 | codec->num_pcms = 0; |
1245 | codec->pcm_info = NULL; | 1290 | codec->pcm_info = NULL; |
1246 | codec->preset = NULL; | 1291 | codec->preset = NULL; |
1292 | module_put(codec->owner); | ||
1293 | codec->owner = NULL; | ||
1247 | } | 1294 | } |
1248 | #endif /* CONFIG_SND_HDA_RECONFIG */ | 1295 | #endif /* CONFIG_SND_HDA_RECONFIG */ |
1249 | 1296 | ||
@@ -1282,6 +1329,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name, | |||
1282 | } | 1329 | } |
1283 | return 0; | 1330 | return 0; |
1284 | } | 1331 | } |
1332 | EXPORT_SYMBOL_HDA(snd_hda_add_vmaster); | ||
1285 | 1333 | ||
1286 | /* switch */ | 1334 | /* switch */ |
1287 | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, | 1335 | int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, |
@@ -1295,6 +1343,7 @@ int snd_hda_mixer_amp_switch_info(struct snd_kcontrol *kcontrol, | |||
1295 | uinfo->value.integer.max = 1; | 1343 | uinfo->value.integer.max = 1; |
1296 | return 0; | 1344 | return 0; |
1297 | } | 1345 | } |
1346 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_info); | ||
1298 | 1347 | ||
1299 | int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, | 1348 | int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, |
1300 | struct snd_ctl_elem_value *ucontrol) | 1349 | struct snd_ctl_elem_value *ucontrol) |
@@ -1314,6 +1363,7 @@ int snd_hda_mixer_amp_switch_get(struct snd_kcontrol *kcontrol, | |||
1314 | HDA_AMP_MUTE) ? 0 : 1; | 1363 | HDA_AMP_MUTE) ? 0 : 1; |
1315 | return 0; | 1364 | return 0; |
1316 | } | 1365 | } |
1366 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_get); | ||
1317 | 1367 | ||
1318 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | 1368 | int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, |
1319 | struct snd_ctl_elem_value *ucontrol) | 1369 | struct snd_ctl_elem_value *ucontrol) |
@@ -1344,6 +1394,7 @@ int snd_hda_mixer_amp_switch_put(struct snd_kcontrol *kcontrol, | |||
1344 | snd_hda_power_down(codec); | 1394 | snd_hda_power_down(codec); |
1345 | return change; | 1395 | return change; |
1346 | } | 1396 | } |
1397 | EXPORT_SYMBOL_HDA(snd_hda_mixer_amp_switch_put); | ||
1347 | 1398 | ||
1348 | /* | 1399 | /* |
1349 | * bound volume controls | 1400 | * bound volume controls |
@@ -1369,6 +1420,7 @@ int snd_hda_mixer_bind_switch_get(struct snd_kcontrol *kcontrol, | |||
1369 | mutex_unlock(&codec->spdif_mutex); | 1420 | mutex_unlock(&codec->spdif_mutex); |
1370 | return err; | 1421 | return err; |
1371 | } | 1422 | } |
1423 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_get); | ||
1372 | 1424 | ||
1373 | int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | 1425 | int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, |
1374 | struct snd_ctl_elem_value *ucontrol) | 1426 | struct snd_ctl_elem_value *ucontrol) |
@@ -1392,6 +1444,7 @@ int snd_hda_mixer_bind_switch_put(struct snd_kcontrol *kcontrol, | |||
1392 | mutex_unlock(&codec->spdif_mutex); | 1444 | mutex_unlock(&codec->spdif_mutex); |
1393 | return err < 0 ? err : change; | 1445 | return err < 0 ? err : change; |
1394 | } | 1446 | } |
1447 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_switch_put); | ||
1395 | 1448 | ||
1396 | /* | 1449 | /* |
1397 | * generic bound volume/swtich controls | 1450 | * generic bound volume/swtich controls |
@@ -1411,6 +1464,7 @@ int snd_hda_mixer_bind_ctls_info(struct snd_kcontrol *kcontrol, | |||
1411 | mutex_unlock(&codec->spdif_mutex); | 1464 | mutex_unlock(&codec->spdif_mutex); |
1412 | return err; | 1465 | return err; |
1413 | } | 1466 | } |
1467 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_info); | ||
1414 | 1468 | ||
1415 | int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, | 1469 | int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, |
1416 | struct snd_ctl_elem_value *ucontrol) | 1470 | struct snd_ctl_elem_value *ucontrol) |
@@ -1427,6 +1481,7 @@ int snd_hda_mixer_bind_ctls_get(struct snd_kcontrol *kcontrol, | |||
1427 | mutex_unlock(&codec->spdif_mutex); | 1481 | mutex_unlock(&codec->spdif_mutex); |
1428 | return err; | 1482 | return err; |
1429 | } | 1483 | } |
1484 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_get); | ||
1430 | 1485 | ||
1431 | int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | 1486 | int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, |
1432 | struct snd_ctl_elem_value *ucontrol) | 1487 | struct snd_ctl_elem_value *ucontrol) |
@@ -1449,6 +1504,7 @@ int snd_hda_mixer_bind_ctls_put(struct snd_kcontrol *kcontrol, | |||
1449 | mutex_unlock(&codec->spdif_mutex); | 1504 | mutex_unlock(&codec->spdif_mutex); |
1450 | return err < 0 ? err : change; | 1505 | return err < 0 ? err : change; |
1451 | } | 1506 | } |
1507 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_ctls_put); | ||
1452 | 1508 | ||
1453 | int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, | 1509 | int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, |
1454 | unsigned int size, unsigned int __user *tlv) | 1510 | unsigned int size, unsigned int __user *tlv) |
@@ -1465,6 +1521,7 @@ int snd_hda_mixer_bind_tlv(struct snd_kcontrol *kcontrol, int op_flag, | |||
1465 | mutex_unlock(&codec->spdif_mutex); | 1521 | mutex_unlock(&codec->spdif_mutex); |
1466 | return err; | 1522 | return err; |
1467 | } | 1523 | } |
1524 | EXPORT_SYMBOL_HDA(snd_hda_mixer_bind_tlv); | ||
1468 | 1525 | ||
1469 | struct hda_ctl_ops snd_hda_bind_vol = { | 1526 | struct hda_ctl_ops snd_hda_bind_vol = { |
1470 | .info = snd_hda_mixer_amp_volume_info, | 1527 | .info = snd_hda_mixer_amp_volume_info, |
@@ -1472,6 +1529,7 @@ struct hda_ctl_ops snd_hda_bind_vol = { | |||
1472 | .put = snd_hda_mixer_amp_volume_put, | 1529 | .put = snd_hda_mixer_amp_volume_put, |
1473 | .tlv = snd_hda_mixer_amp_tlv | 1530 | .tlv = snd_hda_mixer_amp_tlv |
1474 | }; | 1531 | }; |
1532 | EXPORT_SYMBOL_HDA(snd_hda_bind_vol); | ||
1475 | 1533 | ||
1476 | struct hda_ctl_ops snd_hda_bind_sw = { | 1534 | struct hda_ctl_ops snd_hda_bind_sw = { |
1477 | .info = snd_hda_mixer_amp_switch_info, | 1535 | .info = snd_hda_mixer_amp_switch_info, |
@@ -1479,6 +1537,7 @@ struct hda_ctl_ops snd_hda_bind_sw = { | |||
1479 | .put = snd_hda_mixer_amp_switch_put, | 1537 | .put = snd_hda_mixer_amp_switch_put, |
1480 | .tlv = snd_hda_mixer_amp_tlv | 1538 | .tlv = snd_hda_mixer_amp_tlv |
1481 | }; | 1539 | }; |
1540 | EXPORT_SYMBOL_HDA(snd_hda_bind_sw); | ||
1482 | 1541 | ||
1483 | /* | 1542 | /* |
1484 | * SPDIF out controls | 1543 | * SPDIF out controls |
@@ -1740,6 +1799,7 @@ int snd_hda_create_spdif_out_ctls(struct hda_codec *codec, hda_nid_t nid) | |||
1740 | codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); | 1799 | codec->spdif_status = convert_to_spdif_status(codec->spdif_ctls); |
1741 | return 0; | 1800 | return 0; |
1742 | } | 1801 | } |
1802 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_out_ctls); | ||
1743 | 1803 | ||
1744 | /* | 1804 | /* |
1745 | * SPDIF sharing with analog output | 1805 | * SPDIF sharing with analog output |
@@ -1777,6 +1837,7 @@ int snd_hda_create_spdif_share_sw(struct hda_codec *codec, | |||
1777 | return snd_hda_ctl_add(codec, | 1837 | return snd_hda_ctl_add(codec, |
1778 | snd_ctl_new1(&spdif_share_sw, mout)); | 1838 | snd_ctl_new1(&spdif_share_sw, mout)); |
1779 | } | 1839 | } |
1840 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_share_sw); | ||
1780 | 1841 | ||
1781 | /* | 1842 | /* |
1782 | * SPDIF input | 1843 | * SPDIF input |
@@ -1886,6 +1947,7 @@ int snd_hda_create_spdif_in_ctls(struct hda_codec *codec, hda_nid_t nid) | |||
1886 | AC_DIG1_ENABLE; | 1947 | AC_DIG1_ENABLE; |
1887 | return 0; | 1948 | return 0; |
1888 | } | 1949 | } |
1950 | EXPORT_SYMBOL_HDA(snd_hda_create_spdif_in_ctls); | ||
1889 | 1951 | ||
1890 | #ifdef SND_HDA_NEEDS_RESUME | 1952 | #ifdef SND_HDA_NEEDS_RESUME |
1891 | /* | 1953 | /* |
@@ -1931,6 +1993,7 @@ int snd_hda_codec_write_cache(struct hda_codec *codec, hda_nid_t nid, | |||
1931 | snd_hda_power_down(codec); | 1993 | snd_hda_power_down(codec); |
1932 | return err; | 1994 | return err; |
1933 | } | 1995 | } |
1996 | EXPORT_SYMBOL_HDA(snd_hda_codec_write_cache); | ||
1934 | 1997 | ||
1935 | /* resume the all commands from the cache */ | 1998 | /* resume the all commands from the cache */ |
1936 | void snd_hda_codec_resume_cache(struct hda_codec *codec) | 1999 | void snd_hda_codec_resume_cache(struct hda_codec *codec) |
@@ -1946,6 +2009,7 @@ void snd_hda_codec_resume_cache(struct hda_codec *codec) | |||
1946 | get_cmd_cache_cmd(key), buffer->val); | 2009 | get_cmd_cache_cmd(key), buffer->val); |
1947 | } | 2010 | } |
1948 | } | 2011 | } |
2012 | EXPORT_SYMBOL_HDA(snd_hda_codec_resume_cache); | ||
1949 | 2013 | ||
1950 | /** | 2014 | /** |
1951 | * snd_hda_sequence_write_cache - sequence writes with caching | 2015 | * snd_hda_sequence_write_cache - sequence writes with caching |
@@ -1963,6 +2027,7 @@ void snd_hda_sequence_write_cache(struct hda_codec *codec, | |||
1963 | snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb, | 2027 | snd_hda_codec_write_cache(codec, seq->nid, 0, seq->verb, |
1964 | seq->param); | 2028 | seq->param); |
1965 | } | 2029 | } |
2030 | EXPORT_SYMBOL_HDA(snd_hda_sequence_write_cache); | ||
1966 | #endif /* SND_HDA_NEEDS_RESUME */ | 2031 | #endif /* SND_HDA_NEEDS_RESUME */ |
1967 | 2032 | ||
1968 | /* | 2033 | /* |
@@ -2081,7 +2146,7 @@ static void hda_call_codec_resume(struct hda_codec *codec) | |||
2081 | * | 2146 | * |
2082 | * Returns 0 if successful, otherwise a negative error code. | 2147 | * Returns 0 if successful, otherwise a negative error code. |
2083 | */ | 2148 | */ |
2084 | int __devinit snd_hda_build_controls(struct hda_bus *bus) | 2149 | int /*__devinit*/ snd_hda_build_controls(struct hda_bus *bus) |
2085 | { | 2150 | { |
2086 | struct hda_codec *codec; | 2151 | struct hda_codec *codec; |
2087 | 2152 | ||
@@ -2092,6 +2157,7 @@ int __devinit snd_hda_build_controls(struct hda_bus *bus) | |||
2092 | } | 2157 | } |
2093 | return 0; | 2158 | return 0; |
2094 | } | 2159 | } |
2160 | EXPORT_SYMBOL_HDA(snd_hda_build_controls); | ||
2095 | 2161 | ||
2096 | int snd_hda_codec_build_controls(struct hda_codec *codec) | 2162 | int snd_hda_codec_build_controls(struct hda_codec *codec) |
2097 | { | 2163 | { |
@@ -2203,6 +2269,7 @@ unsigned int snd_hda_calc_stream_format(unsigned int rate, | |||
2203 | 2269 | ||
2204 | return val; | 2270 | return val; |
2205 | } | 2271 | } |
2272 | EXPORT_SYMBOL_HDA(snd_hda_calc_stream_format); | ||
2206 | 2273 | ||
2207 | /** | 2274 | /** |
2208 | * snd_hda_query_supported_pcm - query the supported PCM rates and formats | 2275 | * snd_hda_query_supported_pcm - query the supported PCM rates and formats |
@@ -2382,6 +2449,7 @@ int snd_hda_is_supported_format(struct hda_codec *codec, hda_nid_t nid, | |||
2382 | 2449 | ||
2383 | return 1; | 2450 | return 1; |
2384 | } | 2451 | } |
2452 | EXPORT_SYMBOL_HDA(snd_hda_is_supported_format); | ||
2385 | 2453 | ||
2386 | /* | 2454 | /* |
2387 | * PCM stuff | 2455 | * PCM stuff |
@@ -2579,6 +2647,7 @@ int __devinit snd_hda_build_pcms(struct hda_bus *bus) | |||
2579 | } | 2647 | } |
2580 | return 0; | 2648 | return 0; |
2581 | } | 2649 | } |
2650 | EXPORT_SYMBOL_HDA(snd_hda_build_pcms); | ||
2582 | 2651 | ||
2583 | /** | 2652 | /** |
2584 | * snd_hda_check_board_config - compare the current codec with the config table | 2653 | * snd_hda_check_board_config - compare the current codec with the config table |
@@ -2634,6 +2703,7 @@ int snd_hda_check_board_config(struct hda_codec *codec, | |||
2634 | } | 2703 | } |
2635 | return -1; | 2704 | return -1; |
2636 | } | 2705 | } |
2706 | EXPORT_SYMBOL_HDA(snd_hda_check_board_config); | ||
2637 | 2707 | ||
2638 | /** | 2708 | /** |
2639 | * snd_hda_add_new_ctls - create controls from the array | 2709 | * snd_hda_add_new_ctls - create controls from the array |
@@ -2669,6 +2739,7 @@ int snd_hda_add_new_ctls(struct hda_codec *codec, struct snd_kcontrol_new *knew) | |||
2669 | } | 2739 | } |
2670 | return 0; | 2740 | return 0; |
2671 | } | 2741 | } |
2742 | EXPORT_SYMBOL_HDA(snd_hda_add_new_ctls); | ||
2672 | 2743 | ||
2673 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 2744 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
2674 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, | 2745 | static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, |
@@ -2711,6 +2782,10 @@ void snd_hda_power_up(struct hda_codec *codec) | |||
2711 | cancel_delayed_work(&codec->power_work); | 2782 | cancel_delayed_work(&codec->power_work); |
2712 | codec->power_transition = 0; | 2783 | codec->power_transition = 0; |
2713 | } | 2784 | } |
2785 | EXPORT_SYMBOL_HDA(snd_hda_power_up); | ||
2786 | |||
2787 | #define power_save(codec) \ | ||
2788 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | ||
2714 | 2789 | ||
2715 | #define power_save(codec) \ | 2790 | #define power_save(codec) \ |
2716 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) | 2791 | ((codec)->bus->power_save ? *(codec)->bus->power_save : 0) |
@@ -2726,6 +2801,7 @@ void snd_hda_power_down(struct hda_codec *codec) | |||
2726 | msecs_to_jiffies(power_save(codec) * 1000)); | 2801 | msecs_to_jiffies(power_save(codec) * 1000)); |
2727 | } | 2802 | } |
2728 | } | 2803 | } |
2804 | EXPORT_SYMBOL_HDA(snd_hda_power_down); | ||
2729 | 2805 | ||
2730 | int snd_hda_check_amp_list_power(struct hda_codec *codec, | 2806 | int snd_hda_check_amp_list_power(struct hda_codec *codec, |
2731 | struct hda_loopback_check *check, | 2807 | struct hda_loopback_check *check, |
@@ -2762,6 +2838,7 @@ int snd_hda_check_amp_list_power(struct hda_codec *codec, | |||
2762 | } | 2838 | } |
2763 | return 0; | 2839 | return 0; |
2764 | } | 2840 | } |
2841 | EXPORT_SYMBOL_HDA(snd_hda_check_amp_list_power); | ||
2765 | #endif | 2842 | #endif |
2766 | 2843 | ||
2767 | /* | 2844 | /* |
@@ -2781,6 +2858,7 @@ int snd_hda_ch_mode_info(struct hda_codec *codec, | |||
2781 | chmode[uinfo->value.enumerated.item].channels); | 2858 | chmode[uinfo->value.enumerated.item].channels); |
2782 | return 0; | 2859 | return 0; |
2783 | } | 2860 | } |
2861 | EXPORT_SYMBOL_HDA(snd_hda_ch_mode_info); | ||
2784 | 2862 | ||
2785 | int snd_hda_ch_mode_get(struct hda_codec *codec, | 2863 | int snd_hda_ch_mode_get(struct hda_codec *codec, |
2786 | struct snd_ctl_elem_value *ucontrol, | 2864 | struct snd_ctl_elem_value *ucontrol, |
@@ -2798,6 +2876,7 @@ int snd_hda_ch_mode_get(struct hda_codec *codec, | |||
2798 | } | 2876 | } |
2799 | return 0; | 2877 | return 0; |
2800 | } | 2878 | } |
2879 | EXPORT_SYMBOL_HDA(snd_hda_ch_mode_get); | ||
2801 | 2880 | ||
2802 | int snd_hda_ch_mode_put(struct hda_codec *codec, | 2881 | int snd_hda_ch_mode_put(struct hda_codec *codec, |
2803 | struct snd_ctl_elem_value *ucontrol, | 2882 | struct snd_ctl_elem_value *ucontrol, |
@@ -2818,6 +2897,7 @@ int snd_hda_ch_mode_put(struct hda_codec *codec, | |||
2818 | snd_hda_sequence_write_cache(codec, chmode[mode].sequence); | 2897 | snd_hda_sequence_write_cache(codec, chmode[mode].sequence); |
2819 | return 1; | 2898 | return 1; |
2820 | } | 2899 | } |
2900 | EXPORT_SYMBOL_HDA(snd_hda_ch_mode_put); | ||
2821 | 2901 | ||
2822 | /* | 2902 | /* |
2823 | * input MUX helper | 2903 | * input MUX helper |
@@ -2838,6 +2918,7 @@ int snd_hda_input_mux_info(const struct hda_input_mux *imux, | |||
2838 | strcpy(uinfo->value.enumerated.name, imux->items[index].label); | 2918 | strcpy(uinfo->value.enumerated.name, imux->items[index].label); |
2839 | return 0; | 2919 | return 0; |
2840 | } | 2920 | } |
2921 | EXPORT_SYMBOL_HDA(snd_hda_input_mux_info); | ||
2841 | 2922 | ||
2842 | int snd_hda_input_mux_put(struct hda_codec *codec, | 2923 | int snd_hda_input_mux_put(struct hda_codec *codec, |
2843 | const struct hda_input_mux *imux, | 2924 | const struct hda_input_mux *imux, |
@@ -2859,6 +2940,7 @@ int snd_hda_input_mux_put(struct hda_codec *codec, | |||
2859 | *cur_val = idx; | 2940 | *cur_val = idx; |
2860 | return 1; | 2941 | return 1; |
2861 | } | 2942 | } |
2943 | EXPORT_SYMBOL_HDA(snd_hda_input_mux_put); | ||
2862 | 2944 | ||
2863 | 2945 | ||
2864 | /* | 2946 | /* |
@@ -2911,6 +2993,7 @@ int snd_hda_multi_out_dig_open(struct hda_codec *codec, | |||
2911 | mutex_unlock(&codec->spdif_mutex); | 2993 | mutex_unlock(&codec->spdif_mutex); |
2912 | return 0; | 2994 | return 0; |
2913 | } | 2995 | } |
2996 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_open); | ||
2914 | 2997 | ||
2915 | int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, | 2998 | int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, |
2916 | struct hda_multi_out *mout, | 2999 | struct hda_multi_out *mout, |
@@ -2923,6 +3006,7 @@ int snd_hda_multi_out_dig_prepare(struct hda_codec *codec, | |||
2923 | mutex_unlock(&codec->spdif_mutex); | 3006 | mutex_unlock(&codec->spdif_mutex); |
2924 | return 0; | 3007 | return 0; |
2925 | } | 3008 | } |
3009 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_prepare); | ||
2926 | 3010 | ||
2927 | /* | 3011 | /* |
2928 | * release the digital out | 3012 | * release the digital out |
@@ -2935,6 +3019,7 @@ int snd_hda_multi_out_dig_close(struct hda_codec *codec, | |||
2935 | mutex_unlock(&codec->spdif_mutex); | 3019 | mutex_unlock(&codec->spdif_mutex); |
2936 | return 0; | 3020 | return 0; |
2937 | } | 3021 | } |
3022 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_dig_close); | ||
2938 | 3023 | ||
2939 | /* | 3024 | /* |
2940 | * set up more restrictions for analog out | 3025 | * set up more restrictions for analog out |
@@ -2974,6 +3059,7 @@ int snd_hda_multi_out_analog_open(struct hda_codec *codec, | |||
2974 | return snd_pcm_hw_constraint_step(substream->runtime, 0, | 3059 | return snd_pcm_hw_constraint_step(substream->runtime, 0, |
2975 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); | 3060 | SNDRV_PCM_HW_PARAM_CHANNELS, 2); |
2976 | } | 3061 | } |
3062 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_open); | ||
2977 | 3063 | ||
2978 | /* | 3064 | /* |
2979 | * set up the i/o for analog out | 3065 | * set up the i/o for analog out |
@@ -3032,6 +3118,7 @@ int snd_hda_multi_out_analog_prepare(struct hda_codec *codec, | |||
3032 | } | 3118 | } |
3033 | return 0; | 3119 | return 0; |
3034 | } | 3120 | } |
3121 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_prepare); | ||
3035 | 3122 | ||
3036 | /* | 3123 | /* |
3037 | * clean up the setting for analog out | 3124 | * clean up the setting for analog out |
@@ -3058,6 +3145,7 @@ int snd_hda_multi_out_analog_cleanup(struct hda_codec *codec, | |||
3058 | mutex_unlock(&codec->spdif_mutex); | 3145 | mutex_unlock(&codec->spdif_mutex); |
3059 | return 0; | 3146 | return 0; |
3060 | } | 3147 | } |
3148 | EXPORT_SYMBOL_HDA(snd_hda_multi_out_analog_cleanup); | ||
3061 | 3149 | ||
3062 | /* | 3150 | /* |
3063 | * Helper for automatic pin configuration | 3151 | * Helper for automatic pin configuration |
@@ -3343,11 +3431,13 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec, | |||
3343 | 3431 | ||
3344 | return 0; | 3432 | return 0; |
3345 | } | 3433 | } |
3434 | EXPORT_SYMBOL_HDA(snd_hda_parse_pin_def_config); | ||
3346 | 3435 | ||
3347 | /* labels for input pins */ | 3436 | /* labels for input pins */ |
3348 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { | 3437 | const char *auto_pin_cfg_labels[AUTO_PIN_LAST] = { |
3349 | "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" | 3438 | "Mic", "Front Mic", "Line", "Front Line", "CD", "Aux" |
3350 | }; | 3439 | }; |
3440 | EXPORT_SYMBOL_HDA(auto_pin_cfg_labels); | ||
3351 | 3441 | ||
3352 | 3442 | ||
3353 | #ifdef CONFIG_PM | 3443 | #ifdef CONFIG_PM |
@@ -3375,6 +3465,7 @@ int snd_hda_suspend(struct hda_bus *bus, pm_message_t state) | |||
3375 | } | 3465 | } |
3376 | return 0; | 3466 | return 0; |
3377 | } | 3467 | } |
3468 | EXPORT_SYMBOL_HDA(snd_hda_suspend); | ||
3378 | 3469 | ||
3379 | /** | 3470 | /** |
3380 | * snd_hda_resume - resume the codecs | 3471 | * snd_hda_resume - resume the codecs |
@@ -3395,7 +3486,8 @@ int snd_hda_resume(struct hda_bus *bus) | |||
3395 | } | 3486 | } |
3396 | return 0; | 3487 | return 0; |
3397 | } | 3488 | } |
3398 | #endif | 3489 | EXPORT_SYMBOL_HDA(snd_hda_resume); |
3490 | #endif /* CONFIG_PM */ | ||
3399 | 3491 | ||
3400 | /* | 3492 | /* |
3401 | * generic arrays | 3493 | * generic arrays |
@@ -3424,6 +3516,7 @@ void *snd_array_new(struct snd_array *array) | |||
3424 | } | 3516 | } |
3425 | return snd_array_elem(array, array->used++); | 3517 | return snd_array_elem(array, array->used++); |
3426 | } | 3518 | } |
3519 | EXPORT_SYMBOL_HDA(snd_array_new); | ||
3427 | 3520 | ||
3428 | /* free the given array elements */ | 3521 | /* free the given array elements */ |
3429 | void snd_array_free(struct snd_array *array) | 3522 | void snd_array_free(struct snd_array *array) |
@@ -3433,6 +3526,7 @@ void snd_array_free(struct snd_array *array) | |||
3433 | array->alloced = 0; | 3526 | array->alloced = 0; |
3434 | array->list = NULL; | 3527 | array->list = NULL; |
3435 | } | 3528 | } |
3529 | EXPORT_SYMBOL_HDA(snd_array_free); | ||
3436 | 3530 | ||
3437 | /* | 3531 | /* |
3438 | * used by hda_proc.c and hda_eld.c | 3532 | * used by hda_proc.c and hda_eld.c |
@@ -3451,6 +3545,7 @@ void snd_print_pcm_rates(int pcm, char *buf, int buflen) | |||
3451 | 3545 | ||
3452 | buf[j] = '\0'; /* necessary when j == 0 */ | 3546 | buf[j] = '\0'; /* necessary when j == 0 */ |
3453 | } | 3547 | } |
3548 | EXPORT_SYMBOL_HDA(snd_print_pcm_rates); | ||
3454 | 3549 | ||
3455 | void snd_print_pcm_bits(int pcm, char *buf, int buflen) | 3550 | void snd_print_pcm_bits(int pcm, char *buf, int buflen) |
3456 | { | 3551 | { |
@@ -3463,3 +3558,7 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen) | |||
3463 | 3558 | ||
3464 | buf[j] = '\0'; /* necessary when j == 0 */ | 3559 | buf[j] = '\0'; /* necessary when j == 0 */ |
3465 | } | 3560 | } |
3561 | EXPORT_SYMBOL_HDA(snd_print_pcm_bits); | ||
3562 | |||
3563 | MODULE_DESCRIPTION("HDA codec core"); | ||
3564 | MODULE_LICENSE("GPL"); | ||