Skip to contentSkip to conversation

ALSA: hda - Analog Devices AD1984A add HP Touchsmart model

PATCH In review Miguel de Barros 2 participants 4 messages Sep 27, 2009 – Sep 29, 2009 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - Analog Devices AD1984A add HP Touchsmart model

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

Quoted 1 line

From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001

From: Miguel de Barros <[email protected]>
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

Documentation/HD-Audio-Models.txt +1 -0
index abffd41..9e850ed 100644
@@ -208,6 +208,7 @@ AD1884A / AD1883 / AD1984A / AD1984B
   laptop	laptop with HP jack sensing
   mobile	mobile devices with HP jack sensing
   thinkpad	Lenovo Thinkpad X300
+  touchsmart	HP Touchsmart
 
 AD1884
 ======
pci/hda/patch_analog.c +156 -0

186 lines not on this page · raw message

Signature · 1 line
1.6.0.4

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

At Sun, 27 Sep 2009 22:34:58 +0200,

Quoted 13 lines · Miguel de Barros

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)>]

Quoted 1 line

From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001

Quoted 8 lines

From: Miguel de Barros <[email protected]>
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

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.

Quoted 11 lines
pci/hda/patch_analog.c +11 -0
+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)

pci/hda/patch_analog.c static int ad1984a_thinkpad_init(struct hda_codec *codec) · line 4144

Quoted 10 lines
pci/hda/patch_analog.c +10 -0
+{
+	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

#2 lore raw

Thanks for your feedback,

here is a new version of the patch taking into account your comments. I fully agree the mix source is not really useful.

I've put in the commit comment some info on what is included in the patch. Tell me if more information is needed...

Miguel

Quoted 65 lines · Takashi Iwai

At Sun, 27 Sep 2009 22:34:58 +0200,

Quoted 13 lines · Miguel de Barros

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)>]

Quoted 1 line

From 8a106650b4f18c956ae40bf863fb3423b66d605f Mon Sep 17 00:00:00 2001

Quoted 8 lines

From: Miguel de Barros <[email protected]>
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

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.

Quoted 11 lines
(quoted diff) +11 -0
+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)

Review

Quoted 10 lines
(quoted diff) +10 -0
+{
+	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.

Quoted 6 lines

Could you fix and repot?

thanks,

Takashi
From 4a8a44b8afa93ca068c694d5bbff4e616760ccb1 Mon Sep 17 00:00:00 2001

From: Miguel de Barros <[email protected]>
Date: Sun, 27 Sep 2009 22:11:21 +0200
Subject: [PATCH 1/1] ALSA: hda - Analog Devices AD1984A add HP Touchsmart model

Reference: ALSA bug #0004614
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4614

port-A (0x11)      - front hp-out
port-D (0x12)      - rear line out
port-E (0x1c)      - front mic-in
port-F (0x16)      - Internal speakers

digital-mic (0x17) - Internal mic

init verbs, mixers, jack sensing and PCI_QUIRK to support this hardware

Documentation/HD-Audio-Models.txt +1 -0
index abffd41..9e850ed 100644
@@ -208,6 +208,7 @@ AD1884A / AD1883 / AD1984A / AD1984B
   laptop	laptop with HP jack sensing
   mobile	mobile devices with HP jack sensing
   thinkpad	Lenovo Thinkpad X300
+  touchsmart	HP Touchsmart
 
 AD1884
 ======
pci/hda/patch_analog.c +139 -0

169 lines not on this page · raw message

Signature · 1 line
1.6.0.4

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

At Mon, 28 Sep 2009 21:13:26 +0200,

Quoted 10 lines · Miguel de Barros

Thanks for your feedback,

here is a new version of the patch taking into account your comments. I fully agree the mix source is not really useful.

I've put in the commit comment some info on what is included in the patch. Tell me if more information is needed...

Miguel

Looks good to me. I applied the patch now.
Thanks!

Takashi