From patchwork Thu Feb 21 16:44:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seth Forshee X-Patchwork-Id: 1046279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4450gg3JVLz9s8m; Fri, 22 Feb 2019 03:44:47 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1gwrSk-00044S-Qo; Thu, 21 Feb 2019 16:44:42 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1gwrSg-000426-7s for kernel-team@lists.ubuntu.com; Thu, 21 Feb 2019 16:44:38 +0000 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gwrSf-0007yE-PG for kernel-team@lists.ubuntu.com; Thu, 21 Feb 2019 16:44:37 +0000 Received: by mail-wr1-f70.google.com with SMTP id l5so12620391wrv.19 for ; Thu, 21 Feb 2019 08:44:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JEzVus/ljGneproAs/zQNw2D3w+M1Wiezffwxl/Evhw=; b=BW4MbB9+GxygWhYMt+l8daYdSQRxpCG/lmQXEa9zRvH3AdmpLPO0VCnmjh2znoBV+z SHQc4JUzXCaUEpZlzl5t3nV+suXbXBBdzjM4aRVBEFLQ8nE9jDeHQBpiIFn/SmEni9rx +2PMPnuQBbe9Tig7z4rW2w1kMXfUg8THHGYEEZ8WsvZpPgBMLWe3WWmhKT+QWSr4qRv0 IoxIj63s6P6DBDBzl5vtl7OEfCXH9QT0bnb4sccIpXhoVROndr5+Eq2579kpptYlxTad V/Fipg759Vgjlkxyu0Ry6Sd4eiWZ18+K6mZzHmnYwYxY51ddQuasOlT8hd2bY6hoSJ3Q w0mA== X-Gm-Message-State: AHQUAuYXjS2goAJqFqcbEFg+u6Y26/7LEGZVNBSwMdhsiIughfxOz/DX Wk3goNGxD2Uz+Er/Q3EKtc7dhAbPoS2pmMvwQi03IeXpz3hPdyUs4SJ1dVPwnuQ1AfrEOqDCYBz AN0DwxYMw53sbjjdnYNg1fykpWuXsFOxOBjo8fIHARw== X-Received: by 2002:adf:c3c5:: with SMTP id d5mr15445011wrg.308.1550767477089; Thu, 21 Feb 2019 08:44:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZz0YnQA+aX1ehPbBzCONra86jSlPFHxr7+XEqZHMBCJAHrSEnzL0khGJecgWJnic2zrS9/qQ== X-Received: by 2002:adf:c3c5:: with SMTP id d5mr15444995wrg.308.1550767476713; Thu, 21 Feb 2019 08:44:36 -0800 (PST) Received: from localhost ([194.204.107.10]) by smtp.gmail.com with ESMTPSA id n129sm5016121wmf.21.2019.02.21.08.44.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Feb 2019 08:44:36 -0800 (PST) From: Seth Forshee To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2][SRU][C] ALSA: hda/realtek - Headset microphone and internal speaker support for System76 oryp5 Date: Thu, 21 Feb 2019 17:44:26 +0100 Message-Id: <20190221164426.17652-5-seth.forshee@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190221164426.17652-1-seth.forshee@canonical.com> References: <20190221164426.17652-1-seth.forshee@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Jeremy Soller BugLink: https://bugs.launchpad.net/bugs/1815831 On the System76 Oryx Pro (oryp5), there is a headset microphone input attached to 0x19 that does not have a jack detect. In order to get it working, the pin configuration needs to be set correctly, and the ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC fixup needs to be applied. This is similar to the MIC_NO_PRESENCE fixups for some Dell laptops, except we have a separate microphone jack that is already configured correctly. Since the ALC1220 does not have a fixup similar to ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC, I have exposed the fixup from the ALC269 in a way that it can be accessed from the alc1220_fixup_system76_oryp5 function. In addition, the alc1220_fixup_clevo_p950 needs to be applied to gain speaker output. Signed-off-by: Jeremy Soller Cc: Signed-off-by: Takashi Iwai (cherry picked from commit 7f665b1c3283aae5b61843136d0a8ee808ba3199 git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git) Signed-off-by: Seth Forshee --- sound/pci/hda/patch_realtek.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4f9c7bd4e5dc..9cf798ec46d5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -1814,6 +1814,8 @@ enum { ALC887_FIXUP_BASS_CHMAP, ALC1220_FIXUP_GB_DUAL_CODECS, ALC1220_FIXUP_CLEVO_P950, + ALC1220_FIXUP_SYSTEM76_ORYP5, + ALC1220_FIXUP_SYSTEM76_ORYP5_PINS, }; static void alc889_fixup_coef(struct hda_codec *codec, @@ -2048,6 +2050,17 @@ static void alc1220_fixup_clevo_p950(struct hda_codec *codec, snd_hda_override_conn_list(codec, 0x1b, 1, conn1); } +static void alc_fixup_headset_mode_no_hp_mic(struct hda_codec *codec, + const struct hda_fixup *fix, int action); + +static void alc1220_fixup_system76_oryp5(struct hda_codec *codec, + const struct hda_fixup *fix, + int action) +{ + alc1220_fixup_clevo_p950(codec, fix, action); + alc_fixup_headset_mode_no_hp_mic(codec, fix, action); +} + static const struct hda_fixup alc882_fixups[] = { [ALC882_FIXUP_ABIT_AW9D_MAX] = { .type = HDA_FIXUP_PINS, @@ -2292,6 +2305,19 @@ static const struct hda_fixup alc882_fixups[] = { .type = HDA_FIXUP_FUNC, .v.func = alc1220_fixup_clevo_p950, }, + [ALC1220_FIXUP_SYSTEM76_ORYP5] = { + .type = HDA_FIXUP_FUNC, + .v.func = alc1220_fixup_system76_oryp5, + }, + [ALC1220_FIXUP_SYSTEM76_ORYP5_PINS] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl[]) { + { 0x19, 0x01a1913c }, /* use as headset mic, without its own jack detect */ + {} + }, + .chained = true, + .chain_id = ALC1220_FIXUP_SYSTEM76_ORYP5, + }, }; static const struct snd_pci_quirk alc882_fixup_tbl[] = { @@ -2368,6 +2394,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = { SND_PCI_QUIRK(0x1558, 0x9501, "Clevo P950HR", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1558, 0x95e1, "Clevo P95xER", ALC1220_FIXUP_CLEVO_P950), SND_PCI_QUIRK(0x1558, 0x95e2, "Clevo P950ER", ALC1220_FIXUP_CLEVO_P950), + SND_PCI_QUIRK(0x1558, 0x96e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS), + SND_PCI_QUIRK(0x1558, 0x97e1, "System76 Oryx Pro (oryp5)", ALC1220_FIXUP_SYSTEM76_ORYP5_PINS), SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", ALC882_FIXUP_LENOVO_Y530),