From patchwork Wed Sep 26 13:25:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 187080 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id B13132C008A for ; Wed, 26 Sep 2012 23:25:20 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TGrZO-0002a9-QW; Wed, 26 Sep 2012 13:22:30 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TGrZN-0002Zy-7n for kernel-team@lists.ubuntu.com; Wed, 26 Sep 2012 13:22:29 +0000 Received: from [177.96.83.55] (helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TGrbs-0005gR-7n for kernel-team@lists.ubuntu.com; Wed, 26 Sep 2012 13:25:04 +0000 From: Herton Ronaldo Krzesinski To: kernel-team@lists.ubuntu.com Subject: [PATCH][Quantal] ALSA: hda/via - don't report presence on HPs with no presence support Date: Wed, 26 Sep 2012 10:25:01 -0300 Message-Id: <1348665901-4570-1-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com If headphone jack can't detect plug presence, and we have the jack in the jack table, snd_hda_jack_detect will return the plug as always present (as it'll be considered as a phantom jack). The problem is that when this happens, line out pins will always be disabled, resulting in no sound if there are no headphones connected. This was reported as a no sound problem after suspend on http://bugs.launchpad.net/bugs/1052499, since the bug doesn't manifests on first initialization before the phantom jack is added, but on resume we reexecute the initialization code, and via_hp_automute starts reporting HP always present with the jack now on the table. BugLink: https://bugs.launchpad.net/bugs/1052499 Signed-off-by: Herton Ronaldo Krzesinski Cc: [v3.6+] Signed-off-by: Takashi Iwai (cherry-picked from commit cf55e904516947597d75fd3844acc24891a95772 at git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git) --- sound/pci/hda/patch_via.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) The patch was marked for 3.6 stable, but we are affected on Quantal since we picked commit 80c8bfbe76869bfd6bdf3d260d316e7a32f318c3 diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 74fb6fd..5a45a91 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -1672,7 +1672,8 @@ static void via_hp_automute(struct hda_codec *codec) struct via_spec *spec = codec->spec; if (!spec->hp_independent_mode && spec->autocfg.hp_pins[0] && - (spec->codec_type != VT1708 || spec->vt1708_jack_detect)) + (spec->codec_type != VT1708 || spec->vt1708_jack_detect) && + is_jack_detectable(codec, spec->autocfg.hp_pins[0])) present = snd_hda_jack_detect(codec, spec->autocfg.hp_pins[0]); if (spec->smart51_enabled)