From: Takashi Iwai Subject: Re: [PATCH 01/11] ALSA: hda - Add Stereo Downmix control for AD1986A Date: Thu, 30 Jan 2014 12:59:58 +0100 Message-ID: References: <1390903600-22772-1-git-send-email-tiwai@suse.de> <1390903600-22772-2-git-send-email-tiwai@suse.de> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id B52D4265378 for ; Thu, 30 Jan 2014 12:59:58 +0100 (CET) Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 962F6AC5D for ; Thu, 30 Jan 2014 11:59:58 +0000 (UTC) In-Reply-To: <1390903600-22772-2-git-send-email-tiwai@suse.de> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 28 Jan 2014 11:06:30 +0100, Takashi Iwai wrote: > > The stereo downmix control was dropped during the transition to the > generic parser. Let's re-add it. Looking at the path again, this alone doesn't give anything useful, so I removed this from the patch series. It can be used only for multiple DACs, and we don't use multiple DACs for a single output pin (no paths enabled). And, yet, the input amps for this widget must be activated accordingly, too. Takashi > > Signed-off-by: Takashi Iwai > --- > sound/pci/hda/patch_analog.c | 25 ++++++++++++++++++++++--- > 1 file changed, 22 insertions(+), 3 deletions(-) > > diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c > index 7a426ed491f2..11ec27a60276 100644 > --- a/sound/pci/hda/patch_analog.c > +++ b/sound/pci/hda/patch_analog.c > @@ -349,6 +349,12 @@ static int patch_ad1986a(struct hda_codec *codec) > 0x1e, 0x03, > 0 > }; > + static const struct hda_verb downmix_verbs[] = { > + { 0x09, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080 }, /* downmix off */ > + {} > + }; > + static const struct snd_kcontrol_new downmix_mixer = > + HDA_CODEC_MUTE("Stereo Downmix Switch", 0x09, 0x0, HDA_OUTPUT); > > err = alloc_ad_spec(codec); > if (err < 0) > @@ -380,14 +386,27 @@ static int patch_ad1986a(struct hda_codec *codec) > snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE); > > err = ad198x_parse_auto_config(codec, false); > - if (err < 0) { > - snd_hda_gen_free(codec); > - return err; > + if (err < 0) > + goto error; > + > + /* stereo downmix control */ > + err = snd_hda_add_verbs(codec, downmix_verbs); > + if (err < 0) > + goto error; > + if (spec->gen.multiout.num_dacs > 1) { > + if (!snd_hda_gen_add_kctl(&spec->gen, NULL, &downmix_mixer)) { > + err = -ENOMEM; > + goto error; > + } > } > > snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE); > > return 0; > + > + error: > + snd_hda_gen_free(codec); > + return err; > } > > > -- > 1.8.5.2 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >