[alsa-devel] [PATCH 6/7] HDA patch_via.c: Independent DAC for headphone
Takashi Iwai
tiwai at suse.de
Tue Sep 9 14:16:23 CEST 2008
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 <HaraldWelte at viatech.com>
>
> 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 <linux/delay.h>
> #include <linux/slab.h>
> #include <sound/core.h>
> +#include <sound/asoundef.h>
> #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
More information about the Alsa-devel
mailing list