[alsa-devel] [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model

Takashi Iwai tiwai at suse.de
Mon Sep 28 10:47:20 CEST 2009


At Sun, 27 Sep 2009 22:34:58 +0200,
Miguel de Barros wrote:
> 
> Hello,
> 
> I would like to submit this patch, 
> 
> it will fix the bug I've submited :
> https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4614
> 
> 
> Thanks,
> 	Miguel de Barros
> [2 0001-ALSA-hda-Analog-Devices-AD1984A-add-HP-Touchsmart.patch <text/x-patch; UTF-8 (7bit)>]
> >From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001
> From: Miguel de Barros <miguel.de.barros at bluewin.ch>
> Date: Sun, 27 Sep 2009 22:11:21 +0200
> Subject: [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model
>          modified:   Documentation/HD-Audio-Models.txt
>          modified:   pci/hda/patch_analog.c
> 
> 
> Signed-off-by: Miguel de Barros <miguel.de.barros at bluewin.ch>

Thanks for the patch.

Could you add a bit more description what you change and/or fix with
this patch?  The reference to bug tracking can be also in the
changelog text.
OTOH, the list of modified files is superfluous since we can track
them via git more easily.


> +static struct hda_input_mux ad1984a_touchsmart_capture_source = {
> +	.num_items = 3,
> +	.items = {
> +		{ "Mix", 0x3 }, /* Mixer */
> +		{ "Mic", 0x4 }, /* port-E */
> +		{ "Internal Mic", 0x5 }, /* Digital Mic */
> +	},
> +};
> +
> +/* switch to external mic if plugged */
> +static void ad1984a_touchsmart_automic(struct hda_codec *codec)
> +{
> +	if (snd_hda_codec_read(codec, 0x1c, 0,
> +				     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000) {
> +		snd_hda_codec_write(codec, 0x0c, 0,
> +				     AC_VERB_SET_CONNECT_SEL, 0x4);
> +	} else {
> +		snd_hda_codec_write(codec, 0x0c, 0,
> +				     AC_VERB_SET_CONNECT_SEL, 0x5);
> +	}
> +}

The auto-mic feature is actually conflicting with the capture_source
setup.  That is, even if you choose "Internal Mic" manually as the
capture source, it's changed (even without notification) to the mic
jack when plugged in.

So, either use only the auto-mic and get rid of the manual "capture
source" (I prefer), or disable auto-mic.  We can remove "Mix" item
in the first case just for simplicity.


Could you fix and repot?

thanks,

Takashi


More information about the Alsa-devel mailing list