From: Takashi Iwai Subject: Re: [PATCH 6/7] HDA patch_via.c: Independent DAC for headphone Date: Tue, 09 Sep 2008 14:16:23 +0200 Message-ID: References: <20080909073717.GC9638@prithivi.gnumonks.org> <20080909075827.GI9638@prithivi.gnumonks.org> 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 mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 5936924579 for ; Tue, 9 Sep 2008 14:16:23 +0200 (CEST) In-Reply-To: <20080909075827.GI9638@prithivi.gnumonks.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Harald Welte Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 9 Sep 2008 15:58:27 +0800, Harald Welte wrote: > > [ALSA] HDA VIA: Add "Independent Headphone" mode > > This mode allows an output stream to have two substreams, one for the > speakers and one for the headphone. Each of the substreams has independent > PCM data and uses a different DAC. > > Signed-off-by: Harald Welte > > Index: linux-2.6/sound/pci/hda/patch_via.c > =================================================================== > --- linux-2.6.orig/sound/pci/hda/patch_via.c > +++ linux-2.6/sound/pci/hda/patch_via.c > @@ -33,6 +33,7 @@ > /* 2008-02-03 Lydia Wang Fix Rear channels and Back channels inverse issue */ > /* 2008-03-06 Lydia Wang Add VT1702 codec and VT1708S codec support */ > /* 2008-04-09 Lydia Wang Add mute front speaker when HP plugin */ > +/* 2008-04-09 Lydia Wang Add Independent HP feature */ > /* */ > /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ > > @@ -41,6 +42,7 @@ > #include > #include > #include > +#include > #include "hda_codec.h" > #include "hda_local.h" > #include "hda_patch.h" > @@ -140,9 +142,13 @@ > struct auto_pin_cfg autocfg; > unsigned int num_kctl_alloc, num_kctl_used; > struct snd_kcontrol_new *kctl_alloc; > - struct hda_input_mux private_imux; > + struct hda_input_mux private_imux[2]; > hda_nid_t private_dac_nids[AUTO_CFG_MAX_OUTS]; > > + /* HP mode source */ > + const struct hda_input_mux *hp_mux; > + unsigned int hp_independent_mode; > + > #ifdef CONFIG_SND_HDA_POWER_SAVE > struct hda_loopback_check loopback; > #endif > @@ -326,6 +332,92 @@ > &spec->cur_mux[adc_idx]); > } > > +static int via_independent_hp_info(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_info *uinfo) > +{ > + struct hda_codec *codec = snd_kcontrol_chip(kcontrol); > + struct via_spec *spec = codec->spec; > + return snd_hda_input_mux_info(spec->hp_mux, uinfo); > +} Usually this kind of "switch" is implemented as a boolean switch since some mixer apps aren't capable to handle enum controls. If you'd like to change to that, please send an additional patch as I already committed these. thanks, Takashi