From patchwork Mon Oct 8 19:39:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor McAdams X-Patchwork-Id: 10631371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC1C215E2 for ; Mon, 8 Oct 2018 19:42:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCA3D29B85 for ; Mon, 8 Oct 2018 19:42:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C030E29BA7; Mon, 8 Oct 2018 19:42:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B52029B85 for ; Mon, 8 Oct 2018 19:42:55 +0000 (UTC) Received: from alsa.alsa-project.org (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6D0DC267981; Mon, 8 Oct 2018 21:42:53 +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 6233726797C; Mon, 8 Oct 2018 21:42:11 +0200 (CEST) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by alsa0.perex.cz (Postfix) with ESMTP id AE99C26778A for ; Mon, 8 Oct 2018 21:42:09 +0200 (CEST) Received: by mail-qk1-f193.google.com with SMTP id q5-v6so12807640qki.6 for ; Mon, 08 Oct 2018 12:42:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O001s7whb4Ej4c0eyEFKVYHRXfr2pcp/oR1AMNwDnmw=; b=JwuITDaOA/CZ4j/eCYsiE/5VRdi6PX9M1ydYHhAg1c+c4EgKVprm+Ahy8wWGVbEzmD zYXfZO5gzkeREoe/qQ/m4CAtJNh/ejq/8SOhclBriXkX0iUx/khm2gwJg5aE9wIxOmI2 asmJFqjfqK3hcyJn780KklItNkPqbhzvLu8u/8ftP9jKZQNf16Zy614Glen0wuxx07DV mC6rPE96+/AHCOinMWLyIQKEwDigef5fXwf2W2geToRjzcC3M4PdbejDHcgPiGdz2N6S mNDUACgq8lzIjreAG2w6ZFzBNG/YpGkBoYPLtICRluIKwvqe3EFVFK9bLr0WMij2OAVp g4sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O001s7whb4Ej4c0eyEFKVYHRXfr2pcp/oR1AMNwDnmw=; b=LBVpif9rDdMFyxQhyN3R2y6DnUiZNJaSQ6G0Q3+TmoUAOtzyt2CeqU2YLSqkURI/7k kbPpdYvlPMxZz/ugYP0sPNY/ixGSUw9IXVdlLX7zpIKC3GlMFNn47DgbYBGCAxLD6UQ4 nAIAv57d9BEKMlHiRqx8JxKjDiaVkebmRtucz1Vh73Ue4LSJUOobME6VR/3a7WOpm3QX 0F7oX3fNmGZ1xEOgH2ZQ2OuthfSTJwKArCAvpT6FeUm+C4oZDLrGyrH7xSIBo9JE2Eh1 /lIYLW0fceDvVkUNgud1GisgG6aU1NcCUX8W05AC8U6aITW5BKjCMgSEGc3Es2B9voQB Nc0w== X-Gm-Message-State: ABuFfohi93ULVAd+ORgZqqQfxwzjoiGfDe3I2Wcur6FJo8YYhsDpaOoM DbvGAa2lruZF1aG9rpnT5O0= X-Google-Smtp-Source: ACcGV63Hzq5moyUfKMEi5XKQw0d/cXvxQpx/a8/RK9VYOmX1Wzo7ucTN4P1cVkPtoTRYAm4Y/NIvyg== X-Received: by 2002:a37:9ac2:: with SMTP id c185-v6mr19304201qke.162.1539027728282; Mon, 08 Oct 2018 12:42:08 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4273:f812:c27a:7560:4d6a]) by smtp.googlemail.com with ESMTPSA id 76-v6sm13220644qkc.41.2018.10.08.12.42.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 12:42:07 -0700 (PDT) From: Connor McAdams To: Date: Mon, 8 Oct 2018 15:39:57 -0400 Message-Id: <1539027601-20910-2-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> References: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Alastair Bridgewater , Takashi Iwai , conmanx360@gmail.com Subject: [alsa-devel] [PATCH 1/4] ALSA: hda/ca0132 - Fix microphone inconsistency issues 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 patch fixes microphone inconsistency issues by adding a delay to each setup_defaults function. Without this, the microphone only works intermittently. Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index b098504..12a3581 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -7223,6 +7223,8 @@ static void r3d_setup_defaults(struct hda_codec *codec) int num_fx; int idx, i; + msleep(100); + if (spec->dsp_state != DSP_DOWNLOADED) return; @@ -7267,6 +7269,8 @@ static void sbz_setup_defaults(struct hda_codec *codec) int num_fx; int idx, i; + msleep(100); + if (spec->dsp_state != DSP_DOWNLOADED) return; @@ -7324,6 +7328,8 @@ static void ae5_setup_defaults(struct hda_codec *codec) int num_fx; int idx, i; + msleep(100); + if (spec->dsp_state != DSP_DOWNLOADED) return; From patchwork Mon Oct 8 19:39:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor McAdams X-Patchwork-Id: 10631373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1F5015E9 for ; Mon, 8 Oct 2018 19:43:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7F0722AFC for ; Mon, 8 Oct 2018 19:43:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B5432465D; Mon, 8 Oct 2018 19:43:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FB2029B85 for ; Mon, 8 Oct 2018 19:43:07 +0000 (UTC) Received: from alsa.alsa-project.org (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B9B8A26798A; Mon, 8 Oct 2018 21:42:57 +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 7F0D8267980; Mon, 8 Oct 2018 21:42:13 +0200 (CEST) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by alsa0.perex.cz (Postfix) with ESMTP id B146626778A for ; Mon, 8 Oct 2018 21:42:11 +0200 (CEST) Received: by mail-qt1-f195.google.com with SMTP id b4-v6so14181157qtc.7 for ; Mon, 08 Oct 2018 12:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c8DXUNWY9voh42tJuVOp3lKwuUkPa74Oyq6nNSSHTGk=; b=GVRpQnEkc9IJZHseWBJFeuAv1Q2yguyvUiQYKr2QDkqMakEAVfzuJpaixeE5U8LpWT MKO2yntBoneb701MT0ea/G0caUHHhWW7alvQjeRBleEG9lThfTkTPtxi0bqbieClmD7G CyuurN9RBXARNvc/bmzeV6psbLf+cDoAiE9kVDW+8nulF3mgHRx58KK2ou4M74BWR81x IYGMXzClYLqzqyJCgHuSfDxdfm0NAaqMkb9geMpaK8Pegda+eGRrvDUDgmEDLgeydwcd 3dyF76BT45aGKeG4hC5BwqRYN1Y7hmI5RETWJiayD8oEvWNUvXhS/sGqwooo6rjP5r7I /o4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c8DXUNWY9voh42tJuVOp3lKwuUkPa74Oyq6nNSSHTGk=; b=RWdqV3t/Lb6idpmK+PTD5ASE976diTfCjQ4fLVGH5UDAbBI9ZU9ggINRZ1Kmogzjow M3/ZevrmB6PtD/ZCOA/6bNshYz3FIWN1WU18croTiHqwYtMPKno7n9sfNpVw5cGIAAWl FuifRiAyX0QMd8UXmULpxthYkxBWThvTrDvHFUqCHHPdzn4g1/z/Fxr7dxs+TyUSo4MV hUCg10od7Pyo2gZkBoTo7sf9khUSFAn1fEs5PQ7Dizpg1kfaJ4T6Nf3YlUl0GdTBiJWS 8ZlN7Vus/SWDZIqMBCgXTEw8PeVdR9sPBsdLuaH/PgROaX01XEtX+Dl3Am4sL3FPuawI xcIg== X-Gm-Message-State: ABuFfojmjGzvdgU6AVPphwSo1JPrFewus0MMyy9FXiyXZLb1hxFKnM74 zTair9umLY/xV+t5IcBdJYk= X-Google-Smtp-Source: ACcGV61yqCvmySwUg8FOjIhBk7V4DnfY26VhJzQ7MUUiDPxur/3ft0vssPpA/FKz7N0X1DzXD+isjA== X-Received: by 2002:a0c:f24c:: with SMTP id z12-v6mr20415809qvl.87.1539027730569; Mon, 08 Oct 2018 12:42:10 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4273:f812:c27a:7560:4d6a]) by smtp.googlemail.com with ESMTPSA id 76-v6sm13220644qkc.41.2018.10.08.12.42.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 12:42:10 -0700 (PDT) From: Connor McAdams To: Date: Mon, 8 Oct 2018 15:39:58 -0400 Message-Id: <1539027601-20910-3-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> References: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Alastair Bridgewater , Takashi Iwai , conmanx360@gmail.com Subject: [alsa-devel] [PATCH 2/4] ALSA: hda/ca0132 - Clean up patch_ca0132() 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 patch cleans up the patch_ca0132() function with suggestions from Takashi Sakamoto. Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 12a3581..07d50d6 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -8697,10 +8697,6 @@ static int patch_ca0132(struct hda_codec *codec) codec->spec = spec; spec->codec = codec; - codec->patch_ops = ca0132_patch_ops; - codec->pcm_format_first = 1; - codec->no_sticky_stream = 1; - /* Detect codec quirk */ quirk = snd_pci_quirk_lookup(codec->bus->pci, ca0132_quirks); if (quirk) @@ -8711,6 +8707,15 @@ static int patch_ca0132(struct hda_codec *codec) if (spec->quirk == QUIRK_SBZ) sbz_detect_quirk(codec); + if (spec->quirk == QUIRK_ZXR_DBPRO) + codec->patch_ops = dbpro_patch_ops; + else + codec->patch_ops = ca0132_patch_ops; + + codec->pcm_format_first = 1; + codec->no_sticky_stream = 1; + + spec->dsp_state = DSP_DOWNLOAD_INIT; spec->num_mixers = 1; @@ -8725,7 +8730,6 @@ static int patch_ca0132(struct hda_codec *codec) snd_hda_codec_set_name(codec, "Sound Blaster ZxR"); break; case QUIRK_ZXR_DBPRO: - codec->patch_ops = dbpro_patch_ops; break; case QUIRK_R3D: spec->mixers[0] = desktop_mixer; From patchwork Mon Oct 8 19:39:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor McAdams X-Patchwork-Id: 10631375 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C1C7E15E9 for ; Mon, 8 Oct 2018 19:43:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B24572465D for ; Mon, 8 Oct 2018 19:43:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A629727E63; Mon, 8 Oct 2018 19:43:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFE502465D for ; Mon, 8 Oct 2018 19:43:22 +0000 (UTC) Received: from alsa.alsa-project.org (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 31301267988; Mon, 8 Oct 2018 21:43:10 +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 E7F4026778A; Mon, 8 Oct 2018 21:42:16 +0200 (CEST) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by alsa0.perex.cz (Postfix) with ESMTP id CB88F26778A for ; Mon, 8 Oct 2018 21:42:13 +0200 (CEST) Received: by mail-qt1-f193.google.com with SMTP id j46-v6so6548766qtc.9 for ; Mon, 08 Oct 2018 12:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dHfnC+P5xZTqjSVmdAowJtFil8ME13aEEOK76Y/THA0=; b=nPGPSAUrBCB/ybkoTbtxAU1Rt1Q2QpaL7LCAv26WtROLZu4pxsg1jjZY/cgQ25EDfw zTU7vY30i4AzlxqUQClnogfx7h9mfVgZ19SXy+nkSrWDAONJw04OGTARvE3Kfp+fDWEc 48cHi1AxsLmZ1BgHl41AVhhcJgpkrb2TE1IYGFhtN1Md27EOqwYaZLaD7JQZFjlNGnea Ge2pv4UShDEjnm0SAs0aKi/5eBwBGnDFjqQeqRw/DFUntSVQ4x48uToh/tE5Qf2DPhVK ecYXoJ4VoSWEjq9rn9uX46gyMYk9aIEwmXOqUkCC8jDylamqr1LjZpSh/uF2lhpCHi1g HG9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dHfnC+P5xZTqjSVmdAowJtFil8ME13aEEOK76Y/THA0=; b=NsQKgRpvqZRLuzh3HCc65tXaWP3Y76Wtgqz7dJdbdtS/7wqJU0OgTqS4Z30C7EYk3i qKsjJBH0CcHZgBxULDHVIJ1LP7fyttFFXExEpKr5BxnsxSibeNev+mib86Qivkmh4TLz XZgtPB508ct5DfFVexXkSFFG3AOw4W+yOCBK+4Bwub+yoUwclprA23ljGwWbgHov0MEd QoA/uoQphqlQAIw4vDbwEF+pi500CM3pHxRdLdv/zPiyut1PinKtZLP7kEskx9w5Rl9Y WGmmr8CS6k5vM9cmbhRRXNsHqfN1DMC7FeLvR5yuJEXEGFvHO73VGH1izZ51xbJtOAAm TKtA== X-Gm-Message-State: ABuFfogTZd5VNwuIJr27185tQHbdFm0ZzuQPm8dV/3e7x3oPagvA2VoW PnFA25SjVTN4MiY05WOzuPc= X-Google-Smtp-Source: ACcGV62cGLAJfRAOnkdK9U98nch5pmf/dW4mqR4g9xbERObrMgHRw/qW/xfX8cQBTS9WK/gqOlq0tA== X-Received: by 2002:a0c:cb87:: with SMTP id p7mr3411335qvk.63.1539027732742; Mon, 08 Oct 2018 12:42:12 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4273:f812:c27a:7560:4d6a]) by smtp.googlemail.com with ESMTPSA id 76-v6sm13220644qkc.41.2018.10.08.12.42.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 12:42:12 -0700 (PDT) From: Connor McAdams To: Date: Mon, 8 Oct 2018 15:39:59 -0400 Message-Id: <1539027601-20910-4-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> References: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Alastair Bridgewater , Takashi Iwai , conmanx360@gmail.com Subject: [alsa-devel] [PATCH 3/4] ALSA: hda/ca0132 - Add error checking in ca0132_build_controls() 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 patch adds error checking to functions creating controls inside of ca0132_build_controls(). Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 47 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 07d50d6..693b063 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -6365,7 +6365,8 @@ static int ca0132_build_controls(struct hda_codec *codec) NULL, ca0132_alt_slave_pfxs, "Playback Switch", true, &spec->vmaster_mute.sw_kctl); - + if (err < 0) + return err; } /* Add in and out effects controls. @@ -6392,8 +6393,14 @@ static int ca0132_build_controls(struct hda_codec *codec) * prefix, and change PlayEnhancement and CrystalVoice to match. */ if (spec->use_alt_controls) { - ca0132_alt_add_svm_enum(codec); - add_ca0132_alt_eq_presets(codec); + err = ca0132_alt_add_svm_enum(codec); + if (err < 0) + return err; + + err = add_ca0132_alt_eq_presets(codec); + if (err < 0) + return err; + err = add_fx_switch(codec, PLAY_ENHANCEMENT, "Enable OutFX", 0); if (err < 0) @@ -6430,7 +6437,9 @@ static int ca0132_build_controls(struct hda_codec *codec) if (err < 0) return err; } - add_voicefx(codec); + err = add_voicefx(codec); + if (err < 0) + return err; /* * If the codec uses alt_functions, you need the enumerated controls @@ -6438,23 +6447,37 @@ static int ca0132_build_controls(struct hda_codec *codec) * setting control. */ if (spec->use_alt_functions) { - ca0132_alt_add_output_enum(codec); - ca0132_alt_add_mic_boost_enum(codec); + err = ca0132_alt_add_output_enum(codec); + if (err < 0) + return err; + err = ca0132_alt_add_mic_boost_enum(codec); + if (err < 0) + return err; /* * ZxR only has microphone input, there is no front panel * header on the card, and aux-in is handled by the DBPro board. */ - if (spec->quirk != QUIRK_ZXR) - ca0132_alt_add_input_enum(codec); + if (spec->quirk != QUIRK_ZXR) { + err = ca0132_alt_add_input_enum(codec); + if (err < 0) + return err; + } } if (spec->quirk == QUIRK_AE5) { - ae5_add_headphone_gain_enum(codec); - ae5_add_sound_filter_enum(codec); + err = ae5_add_headphone_gain_enum(codec); + if (err < 0) + return err; + err = ae5_add_sound_filter_enum(codec); + if (err < 0) + return err; } - if (spec->quirk == QUIRK_ZXR) - zxr_add_headphone_gain_switch(codec); + if (spec->quirk == QUIRK_ZXR) { + err = zxr_add_headphone_gain_switch(codec); + if (err < 0) + return err; + } #ifdef ENABLE_TUNING_CONTROLS add_tuning_ctls(codec); #endif From patchwork Mon Oct 8 19:40:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor McAdams X-Patchwork-Id: 10631377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 43DA415E2 for ; Mon, 8 Oct 2018 19:43:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34C362465D for ; Mon, 8 Oct 2018 19:43:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 290E627E63; Mon, 8 Oct 2018 19:43:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E58D2465D for ; Mon, 8 Oct 2018 19:43:36 +0000 (UTC) Received: from alsa.alsa-project.org (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 3B33B267995; Mon, 8 Oct 2018 21:43:16 +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 6D97F267984; Mon, 8 Oct 2018 21:42:17 +0200 (CEST) Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by alsa0.perex.cz (Postfix) with ESMTP id A7AC2267977 for ; Mon, 8 Oct 2018 21:42:15 +0200 (CEST) Received: by mail-qt1-f195.google.com with SMTP id o17-v6so6311507qtr.1 for ; Mon, 08 Oct 2018 12:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=0JwxPgmn1m2jNF4k3qwNhh2a8MXZ5t0XCYEwY3serqg=; b=NcmF0HDAKYlvTAfPgnn9pgyM2HOX3yppKjryu2S9TrTFzkOL7MTQ3s4cHhXGBhd8On leZYAkVdMIVgN8sMwiTq1skdO2nr4qiU19CMDcGQqMp1mX/6CIkAJn1fPi4V3qib3vxu jyijuZ9Yz7DwzSi3lC/Vr7d643wKOvYzawdBkN5mWEwRbMXt3byK7sEGF/vV+091E5no 5eLtPn65lIfRG5dLU0HfR4AAMoNwv5QrhTTEu5Y0NYguSsPUr/6PH6nCZKH5U5+Dzagq DiGGYjz57OtLguJDwiI4bzQRcuCATOKt612Q16FHXDoIkbeW30ak48eYV0QquwJ027no JoTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=0JwxPgmn1m2jNF4k3qwNhh2a8MXZ5t0XCYEwY3serqg=; b=k5d8a6AwfqXYIrUtH/0KjR0WvYsBkc2sF0MQfEru2q6HKfOMGCIqEiF7YWghQ76FTZ FXBrJXJ3InKhXD20uiur28I4hXD9NUFVQoNWl0ztw4Dzs8iwrT+VPTDVzSRkEHRPjQbf 23RziCG97YvHWVysL960uFCb3tQujysC7B8oWNiozweyDJGnL5+rtCOnZfvytok9c1AY aDWgLP/bAE07A4fIgvpR14VLKJ6cD4IAj9GcA5FVdPH5cqvuv9JoZrPsepnPecTpgoQE BOV0wDXtSutfYenJBhTFrirJvdpz1oK9/jm1LkBny9O6sX+SzIDuZdJ6dupnOk2HnuAC Bmig== X-Gm-Message-State: ABuFfogY1R+hUqynr+TRQ3iEFp+FXN9QVUPgAsldDERqHjXuunZyEPUs /yYESXpAkyLV64vj7YbM8aU= X-Google-Smtp-Source: ACcGV63SYOr1xjYxnJYgcSx59rIxB6G4mJXjKHb5ZVZyxmywPXvjDlh1HfW81msE9DYNoQHrme40mA== X-Received: by 2002:ad4:42d0:: with SMTP id f16mr2969024qvr.54.1539027734933; Mon, 08 Oct 2018 12:42:14 -0700 (PDT) Received: from localhost.localdomain ([2605:a000:1316:4273:f812:c27a:7560:4d6a]) by smtp.googlemail.com with ESMTPSA id 76-v6sm13220644qkc.41.2018.10.08.12.42.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Oct 2018 12:42:14 -0700 (PDT) From: Connor McAdams To: Date: Mon, 8 Oct 2018 15:40:00 -0400 Message-Id: <1539027601-20910-5-git-send-email-conmanx360@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> References: <1539027601-20910-1-git-send-email-conmanx360@gmail.com> Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Alastair Bridgewater , Takashi Iwai , conmanx360@gmail.com Subject: [alsa-devel] [PATCH 4/4] ALSA: hda/ca0132 - Fix input effect controls for desktop cards 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 patch removes the echo cancellation control for desktop cards, and makes use of the special 0x47 SCP command for noise reduction. Signed-off-by: Connor McAdams --- sound/pci/hda/patch_ca0132.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c index 693b063..1a13cea 100644 --- a/sound/pci/hda/patch_ca0132.c +++ b/sound/pci/hda/patch_ca0132.c @@ -4857,7 +4857,7 @@ static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val) val = 0; /* If Voice Focus on SBZ, set to two channel. */ - if ((nid == VOICE_FOCUS) && (spec->quirk == QUIRK_SBZ) + if ((nid == VOICE_FOCUS) && (spec->use_pci_mmio) && (spec->cur_mic_type != REAR_LINE_IN)) { if (spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) { @@ -4876,7 +4876,7 @@ static int ca0132_effects_set(struct hda_codec *codec, hda_nid_t nid, long val) * For SBZ noise reduction, there's an extra command * to module ID 0x47. No clue why. */ - if ((nid == NOISE_REDUCTION) && (spec->quirk == QUIRK_SBZ) + if ((nid == NOISE_REDUCTION) && (spec->use_pci_mmio) && (spec->cur_mic_type != REAR_LINE_IN)) { if (spec->effects_switch[CRYSTAL_VOICE - EFFECT_START_NID]) { @@ -6374,8 +6374,8 @@ static int ca0132_build_controls(struct hda_codec *codec) */ num_fx = OUT_EFFECTS_COUNT + IN_EFFECTS_COUNT; for (i = 0; i < num_fx; i++) { - /* SBZ and R3D break if Echo Cancellation is used. */ - if (spec->quirk == QUIRK_SBZ || spec->quirk == QUIRK_R3D) { + /* Desktop cards break if Echo Cancellation is used. */ + if (spec->use_pci_mmio) { if (i == (ECHO_CANCELLATION - IN_EFFECT_START_NID + OUT_EFFECTS_COUNT)) continue;