From patchwork Tue Jul 14 16:40:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 6794121 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E4D7FC05AC for ; Wed, 15 Jul 2015 07:41:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C96F20582 for ; Wed, 15 Jul 2015 07:41:53 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DBEDE20525 for ; Wed, 15 Jul 2015 07:41:51 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1668526591F; Wed, 15 Jul 2015 09:41:51 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id AC42C260678; Wed, 15 Jul 2015 09:35:34 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3B5482652B4; Tue, 14 Jul 2015 18:41:01 +0200 (CEST) Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by alsa0.perex.cz (Postfix) with ESMTP id 27F3B26510A for ; Tue, 14 Jul 2015 18:40:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id D8F1B3F20502; Tue, 14 Jul 2015 09:40:50 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 6k1nXnwz1Di7; Tue, 14 Jul 2015 09:40:50 -0700 (PDT) Received: by elaine.keithp.com (Postfix, from userid 1033) id 27B623F2085F; Tue, 14 Jul 2015 09:40:50 -0700 (PDT) Received: from hiro.keithp.com (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 062BE3F20502; Tue, 14 Jul 2015 09:40:50 -0700 (PDT) Received: by hiro.keithp.com (Postfix, from userid 1001) id C33C67414CD; Tue, 14 Jul 2015 09:40:49 -0700 (PDT) From: Keith Packard To: Jaroslav Kysela Date: Tue, 14 Jul 2015 09:40:35 -0700 Message-Id: <1436892035-19589-1-git-send-email-keithp@keithp.com> X-Mailer: git-send-email 2.1.4 X-Mailman-Approved-At: Wed, 15 Jul 2015 09:35:32 +0200 Cc: alsa-devel@alsa-project.org, Kailang Yang , Takashi Iwai , linux-kernel@vger.kernel.org, Hui Wang , Keith Packard , David Henningsson Subject: [alsa-devel] [PATCH] ALSA: hda/realtek: Enable headphone amp on HP Folio 9480m X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This laptop needs GPIO4 pulled high to enable the headphone amplifier. I modelled the patch on the existing GPIO4 code which pulls the line low for the same purpose. Signed-off-by: Keith Packard --- sound/pci/hda/patch_realtek.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6d01045..9060f1f 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -3436,6 +3436,23 @@ static void alc280_fixup_hp_gpio4(struct hda_codec *codec, } } +static void alc280_fixup_hp_gpio4_hp_amp(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + /* Pull GPIO4 high to enable headphone amp */ + static const struct hda_verb gpio_init[] = { + { 0x01, AC_VERB_SET_GPIO_MASK, 0x10 }, + { 0x01, AC_VERB_SET_GPIO_DIRECTION, 0x10 }, + { 0x01, AC_VERB_SET_GPIO_DATA, 0x10 }, + {} + }; + + if (action == HDA_FIXUP_ACT_PRE_PROBE) { + snd_hda_add_verbs(codec, gpio_init); + } +} + static void gpio2_mic_hotkey_event(struct hda_codec *codec, struct hda_jack_callback *event) { @@ -4512,6 +4529,7 @@ enum { ALC286_FIXUP_HP_GPIO_LED, ALC280_FIXUP_HP_GPIO2_MIC_HOTKEY, ALC280_FIXUP_HP_DOCK_PINS, + ALC280_FIXUP_HP_GPIO4_HP_AMP, ALC288_FIXUP_DELL_HEADSET_MODE, ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, ALC288_FIXUP_DELL_XPS_13_GPIO6, @@ -5012,6 +5030,10 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC280_FIXUP_HP_GPIO4 }, + [ALC280_FIXUP_HP_GPIO4_HP_AMP] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc280_fixup_hp_gpio4_hp_amp, + }, [ALC288_FIXUP_DELL_HEADSET_MODE] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_headset_mode_dell_alc288, @@ -5103,6 +5125,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), + SND_PCI_QUIRK(0x103c, 0x22db, "HP", ALC280_FIXUP_HP_GPIO4_HP_AMP), SND_PCI_QUIRK(0x103c, 0x22dc, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), SND_PCI_QUIRK(0x103c, 0x22fb, "HP", ALC269_FIXUP_HP_GPIO_MIC1_LED), /* ALC290 */