ALSA: Jack: handle jack embedded kcontrol creating within ctljack

This patch adds a static method get_available_index() to
allocate the index of new jack kcontrols and also adds
jack_kctl_name_gen() which is used to ensure compatibility
with jack naming by removing " Jack" from some incorrectly
passed names.

Signed-off-by: Jie Yang <yang.jie@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tento commit je obsažen v:
Jie Yang
2015-04-27 21:20:57 +08:00
odevzdal Takashi Iwai
rodič 9058cbe1ee
revize b8dd086674
4 změnil soubory, kde provedl 37 přidání a 6 odebrání

Zobrazit soubor

@@ -402,7 +402,7 @@ static int __snd_hda_jack_add_kctl(struct hda_codec *codec, hda_nid_t nid,
return 0;
if (jack->kctl)
return 0; /* already created */
kctl = snd_kctl_jack_new(name, idx, codec);
kctl = snd_kctl_jack_new(name, codec, codec->card);
if (!kctl)
return -ENOMEM;
err = snd_hda_ctl_add(codec, nid, kctl);