Skip to contentSkip to conversation

ALSA: HDA: Refactor Realtek's automute

PATCH Applied David Henningsson 2 participants 6 messages Sep 20, 2011 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: HDA: Refactor Realtek's automute

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
Quoted 1 line

From e567201a5a7b370af8a4cd155d1faad6123b38d3 Mon Sep 17 00:00:00 2001

From: David Henningsson <[email protected]>
Date: Tue, 20 Sep 2011 12:04:56 +0200
Subject: [PATCH] ALSA: HDA: Refactor Realtek's automute

Increase readability and understandability in the automute code.

---
 sound/pci/hda/alc262_quirks.c |   28 +++------
 sound/pci/hda/alc880_quirks.c |   17 ++---
 sound/pci/hda/alc882_quirks.c |   85 +++++++++-----------------
 sound/pci/hda/alc_quirks.c    |    9 +++
 sound/pci/hda/patch_realtek.c |  136 ++++++++++++++++++++++-------------------
 5 files changed, 127 insertions(+), 148 deletions(-)
sound/pci/hda/alc262_quirks.c +9 -19
index c37e0c2..64d3ceb 100644
@@ -61,10 +61,6 @@ static const struct snd_kcontrol_new alc262_base_mixer[] = {
 };
 
 /* bind hp and internal speaker mute (with plug check) as master switch */
-static void alc262_hippo_master_update(struct hda_codec *codec)
-{
-	update_speakers(codec);
-}
 
 static int alc262_hippo_master_sw_get(struct snd_kcontrol *kcontrol,
 				      struct snd_ctl_elem_value *ucontrol)
@@ -85,7 +81,7 @@ static int alc262_hippo_master_sw_put(struct snd_kcontrol *kcontrol,
 	if (val == spec->master_mute)
 		return 0;
 	spec->master_mute = val;
-	alc262_hippo_master_update(codec);
+	update_outputs(codec);
 	return 1;
 }
 
@@ -147,8 +143,7 @@ static void alc262_hippo_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x15;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 static void alc262_hippo1_setup(struct hda_codec *codec)
@@ -157,8 +152,7 @@ static void alc262_hippo1_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 
@@ -221,8 +215,7 @@ static void alc262_tyan_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 
@@ -364,8 +357,7 @@ static void alc262_toshiba_s06_setup(struct hda_codec *codec)
 	spec->ext_mic_pin = 0x18;
 	spec->int_mic_pin = 0x12;
 	spec->auto_mic = 1;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_PIN;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_PIN, 1, 0, 0, 1);
 }
 
 /*
@@ -446,8 +438,7 @@ static void alc262_fujitsu_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.hp_pins[1] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 /* bind volumes of both NID 0x0c and 0x0d */
@@ -493,8 +484,7 @@ static void alc262_lenovo_3000_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[1] = 0x16;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 static const struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = {
@@ -599,8 +589,8 @@ static void alc262_ultra_automute(struct hda_codec *codec)
 	mute = 0;
 	/* auto-mute only when HP is used as HP */
 	if (!spec->cur_mux[0]) {
-		spec->jack_present = snd_hda_jack_detect(codec, 0x15);
-		if (spec->jack_present)
+		spec->hp_jack_present = snd_hda_jack_detect(codec, 0x15);
+		if (spec->hp_jack_present)
 			mute = HDA_AMP_MUTE;
 	}
 	/* mute/unmute internal speaker */
sound/pci/hda/alc880_quirks.c +6 -11
index c844d2b..d051d856 100644
@@ -749,8 +749,7 @@ static void alc880_uniwill_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x15;
 	spec->autocfg.speaker_pins[0] = 0x16;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 static void alc880_uniwill_init_hook(struct hda_codec *codec)
@@ -781,8 +780,7 @@ static void alc880_uniwill_p53_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
@@ -1051,8 +1049,7 @@ static void alc880_lg_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x17;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 /*
@@ -1137,8 +1134,7 @@ static void alc880_lg_lw_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 static const struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
@@ -1188,7 +1184,7 @@ static void alc880_medion_rim_automute(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 	alc_hp_automute(codec);
 	/* toggle EAPD */
-	if (spec->jack_present)
+	if (spec->hp_jack_present)
 		snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
 	else
 		snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
@@ -1210,8 +1206,7 @@ static void alc880_medion_rim_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x1b;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
 }
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
sound/pci/hda/alc882_quirks.c +29 -56

242 lines not on this page · raw message

sound/pci/hda/alc_quirks.c +9 -0
index 2be1129..e353333 100644
@@ -453,6 +453,15 @@ static void setup_preset(struct hda_codec *codec,
 	alc_fixup_autocfg_pin_nums(codec);
 }
 
+static inline void alc_simple_setup_automute(struct alc_spec *spec, int mode,
+	int from_hp, int from_lo, int to_lo, int to_speaker)
+{
+	spec->automute_mode = mode;
+	spec->detect_hp = from_hp;
+	spec->detect_lo = from_lo;
+	spec->automute_lo = spec->automute_lo_possible = to_lo;
+	spec->automute_speaker = spec->automute_speaker_possible = to_speaker;
+}
 
 /* auto-toggle front mic */
 static void alc88x_simple_mic_automute(struct hda_codec *codec)
sound/pci/hda/patch_realtek.c +74 -62

262 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#1 lore raw

At Tue, 20 Sep 2011 12:26:30 +0200,

Quoted 4 lines · David Henningsson

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Thanks.

alc_simple_setup_automute() calls can be more simplified. The function can check spec->autocfg.line_out_pins[0], hp_pins[0] and speaker_pins[0] to identify detect_hp & co flags. Otherwise, the arguments "1, 0, 0, 1" are hard to understand.

Other than that, the patch looks good to me.

Takashi

#2 lore raw
Quoted 7 lines · Takashi Iwai

At Tue, 20 Sep 2011 12:26:30 +0200,

Quoted 4 lines · David Henningsson

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Quoted 8 lines

Thanks.

alc_simple_setup_automute() calls can be more simplified. The function can check spec->autocfg.line_out_pins[0], hp_pins[0] and speaker_pins[0] to identify detect_hp& co flags. Otherwise, the arguments "1, 0, 0, 1" are hard to understand.

Other than that, the patch looks good to me.

That means a functional change in one place (alc882_quirks.c), where there are line_out_pins but automute for line out is not set:

@@ -2568,8 +2554,7 @@ static void alc888_lenovo_ms7195_setup(struct hda_codec *codec)

         spec->autocfg.hp_pins[0] = 0x1b;
         spec->autocfg.line_out_pins[0] = 0x14;
         spec->autocfg.speaker_pins[0] = 0x15;
-       spec->automute = 1;
-       spec->automute_mode = ALC_AUTOMUTE_AMP;
+       alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);

}

If you don't mind that change I can do what you suggest.

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
#3 lore raw

At Tue, 20 Sep 2011 17:29:22 +0200,

Quoted 31 lines · David Henningsson
Quoted 7 lines · Takashi Iwai

At Tue, 20 Sep 2011 12:26:30 +0200,

Quoted 4 lines · David Henningsson

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Quoted 8 lines

Thanks.

alc_simple_setup_automute() calls can be more simplified. The function can check spec->autocfg.line_out_pins[0], hp_pins[0] and speaker_pins[0] to identify detect_hp& co flags. Otherwise, the arguments "1, 0, 0, 1" are hard to understand.

Other than that, the patch looks good to me.

That means a functional change in one place (alc882_quirks.c), where there are line_out_pins but automute for line out is not set:

sound/pci/hda/alc882_quirks.c +1 -2
@@ -2568,8 +2554,7 @@ static void alc888_lenovo_ms7195_setup(struct 
 hda_codec *codec)
         spec->autocfg.hp_pins[0] = 0x1b;
         spec->autocfg.line_out_pins[0] = 0x14;
         spec->autocfg.speaker_pins[0] = 0x15;
-       spec->automute = 1;
-       spec->automute_mode = ALC_AUTOMUTE_AMP;
+       alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
  }
 
Quoted 1 line

If you don't mind that change I can do what you suggest.

The above must be a bug. It should follow the standard configuration, too. So you'll fix a bug automagically :)

Takashi

#4 lore raw
Quoted 33 lines · Takashi Iwai

At Tue, 20 Sep 2011 17:29:22 +0200,

Quoted 31 lines · David Henningsson
Quoted 7 lines · Takashi Iwai

At Tue, 20 Sep 2011 12:26:30 +0200,

Quoted 4 lines · David Henningsson

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Quoted 8 lines

Thanks.

alc_simple_setup_automute() calls can be more simplified. The function can check spec->autocfg.line_out_pins[0], hp_pins[0] and
speaker_pins[0] to identify detect_hp& co flags. Otherwise, the
arguments "1, 0, 0, 1" are hard to understand.

Other than that, the patch looks good to me.

That means a functional change in one place (alc882_quirks.c), where there are line_out_pins but automute for line out is not set:

(quoted diff) +1 -2
@@ -2568,8 +2554,7 @@ static void alc888_lenovo_ms7195_setup(struct
 hda_codec *codec)
          spec->autocfg.hp_pins[0] = 0x1b;
          spec->autocfg.line_out_pins[0] = 0x14;
          spec->autocfg.speaker_pins[0] = 0x15;
-       spec->automute = 1;
-       spec->automute_mode = ALC_AUTOMUTE_AMP;
+       alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
   }
 
Quoted 4 lines
Quoted 1 line

If you don't mind that change I can do what you suggest.

The above must be a bug. It should follow the standard configuration, too. So you'll fix a bug automagically :)

Ok, attaching modified patch.

Signature · 2 lines
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic
Quoted 1 line

From 9eeee0831982ed787ef43eb6f744306efc8c9973 Mon Sep 17 00:00:00 2001

From: David Henningsson <[email protected]>
Date: Tue, 20 Sep 2011 12:04:56 +0200
Subject: [PATCH] ALSA: HDA: Refactor Realtek's automute

Increase readability and understandability in the automute code.

---
 sound/pci/hda/alc262_quirks.c |   28 +++------
 sound/pci/hda/alc880_quirks.c |   17 ++---
 sound/pci/hda/alc882_quirks.c |   85 +++++++++-----------------
 sound/pci/hda/alc_quirks.c    |   13 ++++
 sound/pci/hda/patch_realtek.c |  136 ++++++++++++++++++++++-------------------
 5 files changed, 131 insertions(+), 148 deletions(-)
sound/pci/hda/alc262_quirks.c +9 -19
index c37e0c2..7894b2b 100644
@@ -61,10 +61,6 @@ static const struct snd_kcontrol_new alc262_base_mixer[] = {
 };
 
 /* bind hp and internal speaker mute (with plug check) as master switch */
-static void alc262_hippo_master_update(struct hda_codec *codec)
-{
-	update_speakers(codec);
-}
 
 static int alc262_hippo_master_sw_get(struct snd_kcontrol *kcontrol,
 				      struct snd_ctl_elem_value *ucontrol)
@@ -85,7 +81,7 @@ static int alc262_hippo_master_sw_put(struct snd_kcontrol *kcontrol,
 	if (val == spec->master_mute)
 		return 0;
 	spec->master_mute = val;
-	alc262_hippo_master_update(codec);
+	update_outputs(codec);
 	return 1;
 }
 
@@ -147,8 +143,7 @@ static void alc262_hippo_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x15;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 static void alc262_hippo1_setup(struct hda_codec *codec)
@@ -157,8 +152,7 @@ static void alc262_hippo1_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 
@@ -221,8 +215,7 @@ static void alc262_tyan_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 
@@ -364,8 +357,7 @@ static void alc262_toshiba_s06_setup(struct hda_codec *codec)
 	spec->ext_mic_pin = 0x18;
 	spec->int_mic_pin = 0x12;
 	spec->auto_mic = 1;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_PIN;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_PIN);
 }
 
 /*
@@ -446,8 +438,7 @@ static void alc262_fujitsu_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.hp_pins[1] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 /* bind volumes of both NID 0x0c and 0x0d */
@@ -493,8 +484,7 @@ static void alc262_lenovo_3000_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[1] = 0x16;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 static const struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = {
@@ -599,8 +589,8 @@ static void alc262_ultra_automute(struct hda_codec *codec)
 	mute = 0;
 	/* auto-mute only when HP is used as HP */
 	if (!spec->cur_mux[0]) {
-		spec->jack_present = snd_hda_jack_detect(codec, 0x15);
-		if (spec->jack_present)
+		spec->hp_jack_present = snd_hda_jack_detect(codec, 0x15);
+		if (spec->hp_jack_present)
 			mute = HDA_AMP_MUTE;
 	}
 	/* mute/unmute internal speaker */
sound/pci/hda/alc880_quirks.c +6 -11
index c844d2b..bea22ed 100644
@@ -749,8 +749,7 @@ static void alc880_uniwill_setup(struct hda_codec *codec)
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x15;
 	spec->autocfg.speaker_pins[0] = 0x16;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 static void alc880_uniwill_init_hook(struct hda_codec *codec)
@@ -781,8 +780,7 @@ static void alc880_uniwill_p53_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x15;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 static void alc880_uniwill_p53_dcvol_automute(struct hda_codec *codec)
@@ -1051,8 +1049,7 @@ static void alc880_lg_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x17;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 /*
@@ -1137,8 +1134,7 @@ static void alc880_lg_lw_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x1b;
 	spec->autocfg.speaker_pins[0] = 0x14;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 static const struct snd_kcontrol_new alc880_medion_rim_mixer[] = {
@@ -1188,7 +1184,7 @@ static void alc880_medion_rim_automute(struct hda_codec *codec)
 	struct alc_spec *spec = codec->spec;
 	alc_hp_automute(codec);
 	/* toggle EAPD */
-	if (spec->jack_present)
+	if (spec->hp_jack_present)
 		snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 0);
 	else
 		snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 2);
@@ -1210,8 +1206,7 @@ static void alc880_medion_rim_setup(struct hda_codec *codec)
 
 	spec->autocfg.hp_pins[0] = 0x14;
 	spec->autocfg.speaker_pins[0] = 0x1b;
-	spec->automute = 1;
-	spec->automute_mode = ALC_AUTOMUTE_AMP;
+	alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP);
 }
 
 #ifdef CONFIG_SND_HDA_POWER_SAVE
sound/pci/hda/alc882_quirks.c +29 -56

242 lines not on this page · raw message

sound/pci/hda/alc_quirks.c +13 -0
index 2be1129..a18952e 100644
@@ -453,6 +453,19 @@ static void setup_preset(struct hda_codec *codec,
 	alc_fixup_autocfg_pin_nums(codec);
 }
 
+static void alc_simple_setup_automute(struct alc_spec *spec, int mode)
+{
+	int lo_pin = spec->autocfg.line_out_pins[0];
+
+	if (lo_pin == spec->autocfg.speaker_pins[0] ||
+		lo_pin == spec->autocfg.hp_pins[0])
+		lo_pin = 0;
+	spec->automute_mode = mode;
+	spec->detect_hp = !!spec->autocfg.hp_pins[0];
+	spec->detect_lo = !!lo_pin;
+	spec->automute_lo = spec->automute_lo_possible = !!lo_pin;
+	spec->automute_speaker = spec->automute_speaker_possible = !!spec->autocfg.speaker_pins[0];
+}
 
 /* auto-toggle front mic */
 static void alc88x_simple_mic_automute(struct hda_codec *codec)
sound/pci/hda/patch_realtek.c +74 -62

262 lines not on this page · raw message

Signature · 1 line
1.7.5.4
Applied
#5 lore raw

At Tue, 20 Sep 2011 18:04:16 +0200,

Quoted 35 lines · David Henningsson
Quoted 33 lines · Takashi Iwai

At Tue, 20 Sep 2011 17:29:22 +0200,

Quoted 31 lines · David Henningsson
Quoted 7 lines · Takashi Iwai

At Tue, 20 Sep 2011 12:26:30 +0200,

Quoted 4 lines · David Henningsson

Ok, my automute refactoring has been rebased to your latest tree. I've tested it on my own machine, but I don't know if wider testing is needed to ensure there are no regressions.

Quoted 8 lines

Thanks.

alc_simple_setup_automute() calls can be more simplified. The function can check spec->autocfg.line_out_pins[0], hp_pins[0] and
speaker_pins[0] to identify detect_hp& co flags. Otherwise, the
arguments "1, 0, 0, 1" are hard to understand.

Other than that, the patch looks good to me.

That means a functional change in one place (alc882_quirks.c), where there are line_out_pins but automute for line out is not set:

sound/pci/hda/alc882_quirks.c +1 -2
@@ -2568,8 +2554,7 @@ static void alc888_lenovo_ms7195_setup(struct
 hda_codec *codec)
          spec->autocfg.hp_pins[0] = 0x1b;
          spec->autocfg.line_out_pins[0] = 0x14;
          spec->autocfg.speaker_pins[0] = 0x15;
-       spec->automute = 1;
-       spec->automute_mode = ALC_AUTOMUTE_AMP;
+       alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP, 1, 0, 0, 1);
   }
 
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

If you don't mind that change I can do what you suggest.

The above must be a bug. It should follow the standard configuration, too. So you'll fix a bug automagically :)

Ok, attaching modified patch.

Thanks, applied now.

Takashi