aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-19 08:38:33 -0500
committerTakashi Iwai <tiwai@suse.de>2013-01-12 02:30:56 -0500
commit12c93df60ccf926f8798723f97f9f45175fce85b (patch)
tree2a03a0b5ed24b2466e075dffd9e4cf88fa5306db /sound
parent731dc3019c7b9fa7a787f9b0a74e94638eee3fe1 (diff)
ALSA: hda - Export snd_hda_gen_add_kctl()
It may be used in other codec drivers, so let it free. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_generic.c19
-rw-r--r--sound/pci/hda/hda_generic.h4
2 files changed, 14 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 31c5677e6210..49e968c8140b 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -43,9 +43,9 @@ int snd_hda_gen_spec_init(struct hda_gen_spec *spec)
43} 43}
44EXPORT_SYMBOL_HDA(snd_hda_gen_spec_init); 44EXPORT_SYMBOL_HDA(snd_hda_gen_spec_init);
45 45
46static struct snd_kcontrol_new * 46struct snd_kcontrol_new *
47add_kctl(struct hda_gen_spec *spec, const char *name, 47snd_hda_gen_add_kctl(struct hda_gen_spec *spec, const char *name,
48 const struct snd_kcontrol_new *temp) 48 const struct snd_kcontrol_new *temp)
49{ 49{
50 struct snd_kcontrol_new *knew = snd_array_new(&spec->kctls); 50 struct snd_kcontrol_new *knew = snd_array_new(&spec->kctls);
51 if (!knew) 51 if (!knew)
@@ -59,6 +59,7 @@ add_kctl(struct hda_gen_spec *spec, const char *name,
59 return NULL; 59 return NULL;
60 return knew; 60 return knew;
61} 61}
62EXPORT_SYMBOL_HDA(snd_hda_gen_add_kctl);
62 63
63static void free_kctls(struct hda_gen_spec *spec) 64static void free_kctls(struct hda_gen_spec *spec)
64{ 65{
@@ -548,7 +549,7 @@ static int add_control(struct hda_gen_spec *spec, int type, const char *name,
548{ 549{
549 struct snd_kcontrol_new *knew; 550 struct snd_kcontrol_new *knew;
550 551
551 knew = add_kctl(spec, name, &control_templates[type]); 552 knew = snd_hda_gen_add_kctl(spec, name, &control_templates[type]);
552 if (!knew) 553 if (!knew)
553 return -ENOMEM; 554 return -ENOMEM;
554 knew->index = cidx; 555 knew->index = cidx;
@@ -1527,7 +1528,7 @@ static int create_multi_channel_mode(struct hda_codec *codec)
1527 struct hda_gen_spec *spec = codec->spec; 1528 struct hda_gen_spec *spec = codec->spec;
1528 1529
1529 if (spec->multi_ios > 0) { 1530 if (spec->multi_ios > 0) {
1530 if (!add_kctl(spec, NULL, &channel_mode_enum)) 1531 if (!snd_hda_gen_add_kctl(spec, NULL, &channel_mode_enum))
1531 return -ENOMEM; 1532 return -ENOMEM;
1532 } 1533 }
1533 return 0; 1534 return 0;
@@ -2086,7 +2087,7 @@ static int create_bind_cap_vol_ctl(struct hda_codec *codec, int idx,
2086 struct snd_kcontrol_new *knew; 2087 struct snd_kcontrol_new *knew;
2087 2088
2088 if (vol_ctl) { 2089 if (vol_ctl) {
2089 knew = add_kctl(spec, NULL, &cap_vol_temp); 2090 knew = snd_hda_gen_add_kctl(spec, NULL, &cap_vol_temp);
2090 if (!knew) 2091 if (!knew)
2091 return -ENOMEM; 2092 return -ENOMEM;
2092 knew->index = idx; 2093 knew->index = idx;
@@ -2094,7 +2095,7 @@ static int create_bind_cap_vol_ctl(struct hda_codec *codec, int idx,
2094 knew->subdevice = HDA_SUBDEV_AMP_FLAG; 2095 knew->subdevice = HDA_SUBDEV_AMP_FLAG;
2095 } 2096 }
2096 if (sw_ctl) { 2097 if (sw_ctl) {
2097 knew = add_kctl(spec, NULL, &cap_sw_temp); 2098 knew = snd_hda_gen_add_kctl(spec, NULL, &cap_sw_temp);
2098 if (!knew) 2099 if (!knew)
2099 return -ENOMEM; 2100 return -ENOMEM;
2100 knew->index = idx; 2101 knew->index = idx;
@@ -2171,7 +2172,7 @@ static int create_capture_mixers(struct hda_codec *codec)
2171 2172
2172 if (!spec->auto_mic && imux->num_items > 1) { 2173 if (!spec->auto_mic && imux->num_items > 1) {
2173 struct snd_kcontrol_new *knew; 2174 struct snd_kcontrol_new *knew;
2174 knew = add_kctl(spec, NULL, &cap_src_temp); 2175 knew = snd_hda_gen_add_kctl(spec, NULL, &cap_src_temp);
2175 if (!knew) 2176 if (!knew)
2176 return -ENOMEM; 2177 return -ENOMEM;
2177 knew->count = nums; 2178 knew->count = nums;
@@ -2592,7 +2593,7 @@ static int add_automute_mode_enum(struct hda_codec *codec)
2592{ 2593{
2593 struct hda_gen_spec *spec = codec->spec; 2594 struct hda_gen_spec *spec = codec->spec;
2594 2595
2595 if (!add_kctl(spec, NULL, &automute_mode_enum)) 2596 if (!snd_hda_gen_add_kctl(spec, NULL, &automute_mode_enum))
2596 return -ENOMEM; 2597 return -ENOMEM;
2597 return 0; 2598 return 0;
2598} 2599}
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h
index 9c00bd5863e5..d71e86de9060 100644
--- a/sound/pci/hda/hda_generic.h
+++ b/sound/pci/hda/hda_generic.h
@@ -192,6 +192,10 @@ snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid,
192void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, 192void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path,
193 bool enable, bool add_aamix); 193 bool enable, bool add_aamix);
194 194
195struct snd_kcontrol_new *
196snd_hda_gen_add_kctl(struct hda_gen_spec *spec, const char *name,
197 const struct snd_kcontrol_new *temp);
198
195int snd_hda_gen_parse_auto_config(struct hda_codec *codec, 199int snd_hda_gen_parse_auto_config(struct hda_codec *codec,
196 const hda_nid_t *ignore_nids); 200 const hda_nid_t *ignore_nids);
197int snd_hda_gen_build_controls(struct hda_codec *codec); 201int snd_hda_gen_build_controls(struct hda_codec *codec);