From patchwork Sun Apr 18 13:46:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ward X-Patchwork-Id: 12210111 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0877C433ED for ; Sun, 18 Apr 2021 13:48:57 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E8336052B for ; Sun, 18 Apr 2021 13:48:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E8336052B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gatech.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E8D971690; Sun, 18 Apr 2021 15:48:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E8D971690 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618753736; bh=q5pJd3JPFwdmH553Dec37mXQvkfxapANhnLW5nnoVsA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oMnSyokIOztWb5VD3JuKFj/lfSOGg51klUw+a4TM/Q1vTGD4DAIOy7s7elX2Eo4qf p+y0XCJ7wu/FhYX1qQt8jM1lUQ7MnaP1T4cWhfgFD2HOKxFK9LNoAjKO6fvtMoiBFh gc1XQ4+eVEqFJWvJWlTlv8zP+IzjkU4plO9yATa0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8D1BBF80423; Sun, 18 Apr 2021 15:47:17 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AF163F800F2; Sun, 18 Apr 2021 15:47:13 +0200 (CEST) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BBC52F800F2 for ; Sun, 18 Apr 2021 15:47:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BBC52F800F2 Received: by mail-qv1-f45.google.com with SMTP id x27so15703501qvd.2 for ; Sun, 18 Apr 2021 06:47:02 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=dVe072jpHpPfiRxFA7g63W4XJ76XNpC7vmJrY1ltClg=; b=PbFj1Bua9Hnd0WYgzxcuZGXxw2Pw0oeFOEShaa6lXzzqH9Yta+jCIH+2I5QE6TSKpe me1SJHFaA2kSKLN7CcSBNG0qr2X0cDdAYcDAMSMWOHnAC7r+CDgN1wX0rP+pnhWBkbQ+ f8blm4MP6WN6Eoe3J73OEs9P/xcbut9BGjx7R+Bel6/xZZZBSeLZTp1ELbGqD7zzmwUC M0S3jKhdD/z3+7oInM8X3VQQuH6UASagEjNMVuu8GKbEGP3sT2On/kNkdmIoEhdBLvd2 XTf73BbYhkOcWKriWi6VP1DiT106OJW5laAjN17PFkgpZ8fY79lOosFm9gfxVcB2zSmh 1cFw== X-Gm-Message-State: AOAM533dFd+FyZt3oV+SZCdyLbn83jnfJCI5reRZFi2K7Z7GB7gEQanr u5IucvyeVFG5p+RtezIsLCo= X-Google-Smtp-Source: ABdhPJznK9YdOfSBWjTcTjk95iNMzpC5QgKF/1HUfZj4hsarc5KMUhSdxxgwlHltEOH4AYRnhL4CxA== X-Received: by 2002:a0c:ea48:: with SMTP id u8mr17087759qvp.15.1618753620959; Sun, 18 Apr 2021 06:47:00 -0700 (PDT) Received: from localhost.localdomain ([2601:184:417f:5b5f::f3be:e978]) by smtp.gmail.com with ESMTPSA id p23sm3927937qtl.8.2021.04.18.06.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:47:00 -0700 (PDT) From: David Ward To: Oder Chiou , Liam Girdwood , Mark Brown Subject: [PATCH 1/5] ASoC: rt286: Fix upper byte in DMIC2 configuration Date: Sun, 18 Apr 2021 09:46:54 -0400 Message-Id: <20210418134658.4333-2-david.ward@gatech.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210418134658.4333-1-david.ward@gatech.edu> References: <20210418134658.4333-1-david.ward@gatech.edu> MIME-Version: 1.0 Cc: Shuming Fan , alsa-devel@alsa-project.org, Bard Liao , Pierre-Louis Bossart , Mario Limonciello X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This HDA verb sets the upper byte of the Configuration Default register, so only an 8-bit value should be used. For the rt298, the same fix was applied in commit f8f2dc4a7127 ("ASoC: rt298: fix wrong setting of gpio2_en"). Signed-off-by: David Ward --- sound/soc/codecs/rt286.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 8abe232ca4a4..f9b29782b62a 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1204,7 +1204,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, mdelay(10); if (!rt286->pdata.gpio2_en) - regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0x4000); + regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0x40); else regmap_write(rt286->regmap, RT286_SET_DMIC2_DEFAULT, 0); From patchwork Sun Apr 18 13:46:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ward X-Patchwork-Id: 12210109 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AAC9C433ED for ; Sun, 18 Apr 2021 13:48:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AE7E61057 for ; Sun, 18 Apr 2021 13:48:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AE7E61057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gatech.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2E4501687; Sun, 18 Apr 2021 15:48:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E4501687 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618753731; bh=eyVzkalmr2zjBTcTyjWNxmae6JD5HN+3iObZotR8408=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oMJs8FmsAbf8dvrF9h0ieHG68sh89YviXXwaACxZZ5B7HtKyi0U/UKBcLhnmX0Brc 7Dnl0xgTd7GmtEO+9hnlWqjG9Nrj7jax8IbN07mmYrONhAs+ix6HHDOpKFianU79c6 sxVCxVvp8Q+ZStmOjGlYwYIzl2qjHcH/KisOgWW8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C0C30F80164; Sun, 18 Apr 2021 15:47:13 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D985F80278; Sun, 18 Apr 2021 15:47:09 +0200 (CEST) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C258AF80168 for ; Sun, 18 Apr 2021 15:47:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C258AF80168 Received: by mail-qv1-f45.google.com with SMTP id i9so15497200qvo.3 for ; Sun, 18 Apr 2021 06:47:02 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=HCAzuIuwK5FgUK8s8GH5XGY5QjMnQT8rME19SVb24QU=; b=dVe/8AAPGcAHzQIZhUT9/jgOTQT0g8iAqp1AmGjybnY722knSc7wiNnFaEeTTiJI3p EZARCceD6DFl6KxZL1fE0H/RqZnwhDU7X27nUlP7sIDdH0Eq8OpSrzmLZHDbj1cd93Fx Iv5hnyKPjZr5+gQKAqgQ+erkRSY4Sza6eJSPKLGn492/Pe2BwAzJU+wp98MIO5p06AAI ZB/NouYHZS6FUeu2PIBRlvLhDit7oBGe58q3Cnbilez7DpPG+chVUzLM37tKfeN3n5SV /Npp6cmmuf+Du6ZZaJQsjQPtmQuYAJjIQnZA3yi9Jqz2jY4V6V+3JXD1dUHTNvTOhgjn KtEA== X-Gm-Message-State: AOAM532qq+9SxQ5rwvJuC98I2Kj2BM4u8iqwGOfBmOKcsFuMB2PH+2s+ 64/TbZyBrmN99rW5/zSdFbk= X-Google-Smtp-Source: ABdhPJy6jQxv92xagIcr2hVLrv0lw6VRpKPcdea+GgsQA8SF/15wv5Gp+kd/bk/0PkZyrH3PVLHJ4A== X-Received: by 2002:a05:6214:17cd:: with SMTP id cu13mr17119370qvb.17.1618753621801; Sun, 18 Apr 2021 06:47:01 -0700 (PDT) Received: from localhost.localdomain ([2601:184:417f:5b5f::f3be:e978]) by smtp.gmail.com with ESMTPSA id p23sm3927937qtl.8.2021.04.18.06.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:47:01 -0700 (PDT) From: David Ward To: Oder Chiou , Liam Girdwood , Mark Brown Subject: [PATCH 2/5] ASoC: rt286: Configure combo jack for headphones Date: Sun, 18 Apr 2021 09:46:55 -0400 Message-Id: <20210418134658.4333-3-david.ward@gatech.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210418134658.4333-1-david.ward@gatech.edu> References: <20210418134658.4333-1-david.ward@gatech.edu> MIME-Version: 1.0 Cc: Shuming Fan , alsa-devel@alsa-project.org, Bard Liao , Pierre-Louis Bossart , Mario Limonciello X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" During jack detection, the combo jack is configured for a CTIA headset, and then for an OMTP headset, while sensing the mic connection. If a mic is not found in either case, the combo jack should be re-configured for headphones only. This is consistent with the HDA driver behavior. Signed-off-by: David Ward --- sound/soc/codecs/rt286.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index f9b29782b62a..67a5affdb705 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -252,11 +252,16 @@ static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) msleep(300); regmap_read(rt286->regmap, RT286_CBJ_CTRL2, &val); - if (0x0070 == (val & 0x0070)) + if (0x0070 == (val & 0x0070)) { *mic = true; - else + } else { *mic = false; + regmap_update_bits(rt286->regmap, + RT286_CBJ_CTRL1, + 0xfcc0, 0xc400); + } } + regmap_update_bits(rt286->regmap, RT286_DC_GAIN, 0x200, 0x0); From patchwork Sun Apr 18 13:46:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ward X-Patchwork-Id: 12210117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 551F2C433B4 for ; Sun, 18 Apr 2021 13:50:21 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CA5F361057 for ; Sun, 18 Apr 2021 13:50:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA5F361057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gatech.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 59E1D16AA; Sun, 18 Apr 2021 15:49:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 59E1D16AA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618753819; bh=1PgFdV9G2QWDdVY4MaKTvreupi1RSiujyPWDLI79ZAQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=i2N7Kp7Sw+EqBQVI7gHLc+ZTLmaKB3TazTNyqRAcZYOQl5JXIhCPixMNSo+wh7fP9 ydm4V8YmD9eORSKtRbmMD8nIN87TQpR3ZnELJw1X2+MsdfhOeXWgMLaWo0F3F1c2f+ JmZLT6oKHkXlVr688ZYzkBSwRTixl+5wKSfFVcA4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 432EEF804A9; Sun, 18 Apr 2021 15:48:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38BFBF80273; Sun, 18 Apr 2021 15:47:57 +0200 (CEST) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D2F2DF80273 for ; Sun, 18 Apr 2021 15:47:03 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D2F2DF80273 Received: by mail-qv1-f54.google.com with SMTP id dp18so11048969qvb.5 for ; Sun, 18 Apr 2021 06:47:03 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=i2s1yyziAApLNMk5wHeYSLF57BtVllGzKRDg9f231Go=; b=iGOXBLoIdnzz9AxW3HEMihKIS2HSfX9imEuV3387pFI5+Xwu9skAMLxDOJ20L8QTMv pdK9FeXJB52gkUpYC/TdleeylFsF9mBAuiYP8r4yEtsZJBgIX0DKaEftrFBZjfToWiL8 8aANghNYf51u3YUBS9C/FQcgsPX3a3MILMY9Ew1+Yjdyl59fI5Xv3mpb3BPz9AWFIxY1 rU6XK7WT0e/LCKv9KRIgnQn4mIsfV3Jfxt3IBXfUuZ5ZSoM45likl4B9JyREIE9uo0TW asDYaTRuAzN3sWg3UOOgJDiswSaBBFt/ztkNSiyAgH572kZiWo/tQqT3+UQzYZ5IXxvV 3E2Q== X-Gm-Message-State: AOAM533xL0DTmo2H3r1lM2fgURu2Plq00ph0l1eECyPkv2IjbqNuFmhd z4lAX3colwquG4YWuQ+R/jc= X-Google-Smtp-Source: ABdhPJyvY/4h1w1CFLpq3liDdP2Gm0Lr8cQNt5IW11+QoBDJ121UBaGRz2k3quHDp/fzjATFWNz0Ow== X-Received: by 2002:a0c:f452:: with SMTP id h18mr12447612qvm.27.1618753622528; Sun, 18 Apr 2021 06:47:02 -0700 (PDT) Received: from localhost.localdomain ([2601:184:417f:5b5f::f3be:e978]) by smtp.gmail.com with ESMTPSA id p23sm3927937qtl.8.2021.04.18.06.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:47:02 -0700 (PDT) From: David Ward To: Oder Chiou , Liam Girdwood , Mark Brown Subject: [PATCH 3/5] ASoC: rt298: Configure combo jack for headphones Date: Sun, 18 Apr 2021 09:46:56 -0400 Message-Id: <20210418134658.4333-4-david.ward@gatech.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210418134658.4333-1-david.ward@gatech.edu> References: <20210418134658.4333-1-david.ward@gatech.edu> MIME-Version: 1.0 Cc: Shuming Fan , alsa-devel@alsa-project.org, Bard Liao , Pierre-Louis Bossart , Mario Limonciello X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" During jack detection, the combo jack is configured for a CTIA headset, and then for an OMTP headset, while sensing the mic connection. If a mic is not found in either case, the combo jack should be re-configured for headphones only. This is consistent with the HDA driver behavior. Signed-off-by: David Ward --- sound/soc/codecs/rt298.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index 32cc9b6287d2..c592c40a7ab3 100644 --- a/sound/soc/codecs/rt298.c +++ b/sound/soc/codecs/rt298.c @@ -267,11 +267,16 @@ static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic) msleep(300); regmap_read(rt298->regmap, RT298_CBJ_CTRL2, &val); - if (0x0070 == (val & 0x0070)) + if (0x0070 == (val & 0x0070)) { *mic = true; - else + } else { *mic = false; + regmap_update_bits(rt298->regmap, + RT298_CBJ_CTRL1, + 0xfcc0, 0xc400); + } } + regmap_update_bits(rt298->regmap, RT298_DC_GAIN, 0x200, 0x0); From patchwork Sun Apr 18 13:46:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ward X-Patchwork-Id: 12210115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 276EBC433B4 for ; Sun, 18 Apr 2021 13:49:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3B60161057 for ; Sun, 18 Apr 2021 13:49:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B60161057 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gatech.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CAC3D16A0; Sun, 18 Apr 2021 15:48:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAC3D16A0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618753783; bh=1CjRm5ecSlygOf9UWKFV6kZydosGPNtVOybVRYxAbao=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Mjeeh7a0nt8oKfSRvcXjjTsXpk8K0TkG1LztpiavjrYAflV9/w9P6xVL02cLa1gI9 40nzeVGnDgGZapopH8UgyIvlnedG4lea3aUDmYUb8TVdMkz6OZJXFMsupKUViSoTrO x3zHe+K/zckBfKOtXnnDvl7YO00axvst2huQaiZ0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4BD7AF80431; Sun, 18 Apr 2021 15:47:59 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2E79CF80253; Sun, 18 Apr 2021 15:47:57 +0200 (CEST) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5E21FF80253 for ; Sun, 18 Apr 2021 15:47:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5E21FF80253 Received: by mail-qk1-f173.google.com with SMTP id u20so1298930qku.10 for ; Sun, 18 Apr 2021 06:47:04 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=W6Zca4GVJY1fggJs5iafYXFuVE85I8IMOERxrI28jD8=; b=G1lJSpWLyenT27qti8nnrYq2MtXLTTz2+C4t4icy4Q/EojfcChvZ5QiLLeXAFHBmvG JhuvY0kOCMynGmLD/3FFJTw9ZHwcNOfOKxTLb5N3rRFczx6GYZ8KEFBuMZt/HFWcZmHq nZQpucpEV/i4k/+TuymxVro2HxVxz1k1xM46cSTENXJ/L9nXFq4ChgxrgjocMMD1HcuM uEXFilW/oO1xztqkUudlbvu343KnEp/VYGWvLSViuyxPTv7pXdraUG9LFzATHMsbiG8t SqKbJSVyBtfIJe6ebAL8sXvcKsETe2opK1dcf2XliM3cpvCv/WRYzVZaQuIzu/oFcLR/ PmKw== X-Gm-Message-State: AOAM532gFkVu4h2/7gPMTC+WUpgxLes/SDPqKXG2V0S4gp1Ko+6vmZNV yTE1j3s1f8G9sinj6ePplXY= X-Google-Smtp-Source: ABdhPJz/cCWYxz+Q7XrC4BWia1woqDR4nMpolxZi0gZGfeldAQFyGM+X6tEWTuUgN1KZRv97N8G3QQ== X-Received: by 2002:a37:8a01:: with SMTP id m1mr8036277qkd.85.1618753623229; Sun, 18 Apr 2021 06:47:03 -0700 (PDT) Received: from localhost.localdomain ([2601:184:417f:5b5f::f3be:e978]) by smtp.gmail.com with ESMTPSA id p23sm3927937qtl.8.2021.04.18.06.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:47:03 -0700 (PDT) From: David Ward To: Oder Chiou , Liam Girdwood , Mark Brown Subject: [PATCH 4/5] ASoC: rt286: Make RT286_SET_GPIO_* readable and writable Date: Sun, 18 Apr 2021 09:46:57 -0400 Message-Id: <20210418134658.4333-5-david.ward@gatech.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210418134658.4333-1-david.ward@gatech.edu> References: <20210418134658.4333-1-david.ward@gatech.edu> MIME-Version: 1.0 Cc: Shuming Fan , alsa-devel@alsa-project.org, Bard Liao , Pierre-Louis Bossart , Mario Limonciello X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The GPIO configuration cannot be applied if the registers are inaccessible. This prevented the headset mic from working on the Dell XPS 13 9343. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=114171 Signed-off-by: David Ward --- sound/soc/codecs/rt286.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 67a5affdb705..45e4a48ef5bf 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -171,6 +171,9 @@ static bool rt286_readable_register(struct device *dev, unsigned int reg) case RT286_PROC_COEF: case RT286_SET_AMP_GAIN_ADC_IN1: case RT286_SET_AMP_GAIN_ADC_IN2: + case RT286_SET_GPIO_MASK: + case RT286_SET_GPIO_DIRECTION: + case RT286_SET_GPIO_DATA: case RT286_SET_POWER(RT286_DAC_OUT1): case RT286_SET_POWER(RT286_DAC_OUT2): case RT286_SET_POWER(RT286_ADC_IN1): From patchwork Sun Apr 18 13:46:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ward X-Patchwork-Id: 12210113 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB359C433ED for ; Sun, 18 Apr 2021 13:49:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10389610E9 for ; Sun, 18 Apr 2021 13:49:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 10389610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gatech.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 648891694; Sun, 18 Apr 2021 15:48:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 648891694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1618753771; bh=ZI5QQ/bbj3QBa/D0oJ4bsx8wq8DGJ1ndYzD2xNPE/WU=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=da/l5163I+JPZRnccRLLfseHY1FuqYtznEXOqoCOQeR+MppGwV9NKFvQ3FwotpQV0 Ujsa1wNI/ce6FW/528sfJV6Wh91tvuF3oKbP4wo30xPl3zGmZWbb3K39HsGxLn9/8S 4qVIBc27b1H+g4Uz3HHjj+uH7jcbVA4yKIwAOUUA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8EABDF80275; Sun, 18 Apr 2021 15:47:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22312F80430; Sun, 18 Apr 2021 15:47:57 +0200 (CEST) Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BA709F80275 for ; Sun, 18 Apr 2021 15:47:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BA709F80275 Received: by mail-qk1-f172.google.com with SMTP id t17so5012451qkg.4 for ; Sun, 18 Apr 2021 06:47:05 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=lp/9/DD1lUyADLZD2qHRRtq0jLfJJ3OREWhew5pzIJE=; b=pXtD5UAjFEBY4ryK5U58dQ18yoBwtcnptmk2QeCOS0ZrAGXyV2MhJwdJdjf3+UBSaS i3MmkVyhGZXDqiJ8fSGYE5SICvbdrnHvyDMHJiDYMkU8XxUIy/RXIfCLrHWzRQW6ROoR Rwkd7bN54jz6wwjKh62LNupqCEM7j8OTevNWML1mK/6ZxTTlQKrHq70jLcIDWXd1DoVm vO1Xh/4ILIM4/+8FtDgK+uQBY/V6knNuWJUsmwE90ohFTvVNXx+Jd2vy04R9I2k1wCoW EHh6rQ57ss8kjLyzfIaJA4njuJZlm4Jceh0MMO6mgO4HmrRmI8t6nJqjtVBITrPjyzdl j3eg== X-Gm-Message-State: AOAM533iuVETI3qn6Mml/UNAh6e6/Jh7XFxqgqtk5bInYAbAggGK8wSm fQFJpZHeVjd/e6/MACWqBlQ= X-Google-Smtp-Source: ABdhPJxj39YC97UG4tTrm0WxuPSKMt9mlC1rvrOoafcPbTP7DUt1Y9v7NxedgXOLs5UX+e8I/t20BA== X-Received: by 2002:a37:a206:: with SMTP id l6mr7883768qke.5.1618753624457; Sun, 18 Apr 2021 06:47:04 -0700 (PDT) Received: from localhost.localdomain ([2601:184:417f:5b5f::f3be:e978]) by smtp.gmail.com with ESMTPSA id p23sm3927937qtl.8.2021.04.18.06.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Apr 2021 06:47:04 -0700 (PDT) From: David Ward To: Oder Chiou , Liam Girdwood , Mark Brown Subject: [PATCH 5/5] ASoC: rt286: Generalize support for ALC3263 codec Date: Sun, 18 Apr 2021 09:46:58 -0400 Message-Id: <20210418134658.4333-6-david.ward@gatech.edu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210418134658.4333-1-david.ward@gatech.edu> References: <20210418134658.4333-1-david.ward@gatech.edu> MIME-Version: 1.0 Cc: Shuming Fan , alsa-devel@alsa-project.org, Bard Liao , Pierre-Louis Bossart , Mario Limonciello X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The ALC3263 codec on the XPS 13 9343 is also found on the Latitude 13 7350 and Venue 11 Pro 7140. They require the same handling for the combo jack to work with a headset: GPIO pin 6 must be set. The HDA driver always sets this pin on the ALC3263, which it distinguishes by the codec vendor/device ID 0x10ec0288 and PCI subsystem vendor ID 0x1028 (Dell). The ASoC driver does not use PCI, so adapt this check to use DMI to determine if Dell is the system vendor. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=150601 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205961 Signed-off-by: David Ward --- sound/soc/codecs/rt286.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 45e4a48ef5bf..802f4851c3df 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1125,12 +1125,11 @@ static const struct dmi_system_id force_combo_jack_table[] = { { } }; -static const struct dmi_system_id dmi_dell_dino[] = { +static const struct dmi_system_id dmi_dell[] = { { - .ident = "Dell Dino", + .ident = "Dell", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343") } }, { } @@ -1141,7 +1140,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, { struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev); struct rt286_priv *rt286; - int i, ret, val; + int i, ret, vendor_id; rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), GFP_KERNEL); @@ -1157,14 +1156,15 @@ static int rt286_i2c_probe(struct i2c_client *i2c, } ret = regmap_read(rt286->regmap, - RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val); + RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &vendor_id); if (ret != 0) { dev_err(&i2c->dev, "I2C error %d\n", ret); return ret; } - if (val != RT286_VENDOR_ID && val != RT288_VENDOR_ID) { + if (vendor_id != RT286_VENDOR_ID && vendor_id != RT288_VENDOR_ID) { dev_err(&i2c->dev, - "Device with ID register %#x is not rt286\n", val); + "Device with ID register %#x is not rt286\n", + vendor_id); return -ENODEV; } @@ -1188,8 +1188,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c, if (pdata) rt286->pdata = *pdata; - if (dmi_check_system(force_combo_jack_table) || - dmi_check_system(dmi_dell_dino)) + if ((vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) || + dmi_check_system(force_combo_jack_table)) rt286->pdata.cbj_en = true; regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); @@ -1228,7 +1228,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); - if (dmi_check_system(dmi_dell_dino)) { + if (vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) { regmap_update_bits(rt286->regmap, RT286_SET_GPIO_MASK, 0x40, 0x40); regmap_update_bits(rt286->regmap,