From patchwork Fri Oct 28 15:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 13025436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 1D485C38A02 for ; Mon, 31 Oct 2022 06:47:51 +0000 (UTC) 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 4ED36166E; Mon, 31 Oct 2022 07:46:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4ED36166E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1667198869; bh=S42DRyQJvW7TZ+pT+uzx8w8nEiWf3kDosmTLCv5ZehE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=H+962EZPArqKzD6kD8Uo0Z0SsAUQ08jUMOdSOK1Zk/RGl+MpsvzDZBQ6tujpX2C1h 7oMUJo0SmxNObI//7cmflxz4I6gN/X0LRtaQPKWMssbqz+yxPij0m6wv7nZfh8xC6d Qpwpbh7S1W5wlchakvooQ6CrASEzx1LuTZoJ8LiU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2E06DF80563; Mon, 31 Oct 2022 07:45:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 39B91F8024C; Fri, 28 Oct 2022 17:26:59 +0200 (CEST) Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) (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 1D0A2F80095 for ; Fri, 28 Oct 2022 17:26:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1D0A2F80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.b="N4qct+2/" Received: by mail-ej1-x636.google.com with SMTP id y14so13720741ejd.9 for ; Fri, 28 Oct 2022 08:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KYAU7odEMWKCjcropggkZQwO0OXnOT7Nxlue1f2Igjw=; b=N4qct+2/SkZTJmUhVNcb4x9h7lglsGkPGesm5ETCb6oDXj/896682W1IKcdN13TLcG gbEtaMgVEyleOH1zypX/bT1pazrPuMqQPG5xvSv2qzdZvL+olVF/KWwtwno67arAzTkL W3K4jUtGoo3rlzaDH5gok3XY0vEyMjSuHY5fM5MRm6iD2G5SkAdWW7k4zv9U0+pP97HT uo0nP/LOksN6bp8kC4OfFV2xDijskpC/DXBwG0FeSQU97vxR09Cjo1eHTCFA85h8ArXI s1aKN9+FHg9TcVnM4ILkZaZb96o1MkKsTKtaEvRHhjqMVKYr8i1XIlAiLkmu+lE8P1oO EArA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KYAU7odEMWKCjcropggkZQwO0OXnOT7Nxlue1f2Igjw=; b=ZmIGlW30GNtzXtJMtojYmZu6079RlBi1cbFv3moTZr1Jf/89raGkTyT7CcjmxcELpk HWPerwEl5a63txDA75zDa/7rZOgDX5WfFli2GaZZz+scC2t763ohOLBy69fxk9psTtZR ddp/zA5RZVPFpP/fXorrjumdCFYqH9J6ziqnR6o/BQp5+jJwP54QGh9ELQBhZjzIahg1 FV4IjNIcyk7GPm7NIKVuUvXg8pTEYqRgKYfxBXjbjYXy/intnnsv2EQxfnlfQd1GXDXg lStzEjkLXwIfXQurncNccZMexZ1NtK0DfzhjJAFl7gbYSOCJHT5vFj+HF6tT28pT3viE hlzw== X-Gm-Message-State: ACrzQf1mn2OYi92k9h5LuCvz5BGHq4/+fxTtl/803EBV9YQryZzUcyKs Be4Mz2Se7vHb+d+X6Lmi5v48lA== X-Google-Smtp-Source: AMsMyM4W1T435LCEpPz8XnDAEEj28TglPOt1WbD5txMFkIDdY7TDsPUrl+yprTOYVSDAYlOwSgOmjQ== X-Received: by 2002:a17:906:30c5:b0:782:707:9e2d with SMTP id b5-20020a17090630c500b0078207079e2dmr46375763ejb.286.1666970810840; Fri, 28 Oct 2022 08:26:50 -0700 (PDT) Received: from dtpc.zanders.be (78-22-137-109.access.telenet.be. [78.22.137.109]) by smtp.gmail.com with ESMTPSA id 17-20020a170906319100b00730df07629fsm2349839ejy.174.2022.10.28.08.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:26:50 -0700 (PDT) From: Maarten Zanders To: Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 1/3] ASoC: adau1372: fix mclk Date: Fri, 28 Oct 2022 17:26:23 +0200 Message-Id: <20221028152626.109603-2-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221028152626.109603-1-maarten.zanders@mind.be> References: <20221028152626.109603-1-maarten.zanders@mind.be> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 31 Oct 2022 07:45:34 +0100 Cc: alsa-devel@alsa-project.org, Maarten Zanders , linux-kernel@vger.kernel.org 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" "mclk" is retrieved from the configuration and assigned to adau1372->clk. However adau1372->mclk (==NULL) is used for clk_prepare_enable() and clk_disable_unprepare() which don't have any effect. Remove .clk from struct adau1372 and use .mclk throughout. This change ensures that the input clock is switched on/off when the bias level is changed. Signed-off-by: Maarten Zanders --- sound/soc/codecs/adau1372.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index a9f89e8565ec..00d0825e193b 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -25,7 +25,6 @@ #include "adau-utils.h" struct adau1372 { - struct clk *clk; struct regmap *regmap; void (*switch_mode)(struct device *dev); bool use_pll; @@ -925,9 +924,9 @@ int adau1372_probe(struct device *dev, struct regmap *regmap, if (!adau1372) return -ENOMEM; - adau1372->clk = devm_clk_get(dev, "mclk"); - if (IS_ERR(adau1372->clk)) - return PTR_ERR(adau1372->clk); + adau1372->mclk = devm_clk_get(dev, "mclk"); + if (IS_ERR(adau1372->mclk)) + return PTR_ERR(adau1372->mclk); adau1372->pd_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_HIGH); if (IS_ERR(adau1372->pd_gpio)) @@ -947,7 +946,7 @@ int adau1372_probe(struct device *dev, struct regmap *regmap, * 12.288MHz. Automatically choose a valid configuration from the * external clock. */ - rate = clk_get_rate(adau1372->clk); + rate = clk_get_rate(adau1372->mclk); switch (rate) { case 12288000: From patchwork Fri Oct 28 15:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 13025437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DD64FC38A02 for ; Mon, 31 Oct 2022 06:48:11 +0000 (UTC) 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 0B9901666; Mon, 31 Oct 2022 07:47:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0B9901666 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1667198890; bh=YMOtPkOlPZk8uyFF900L+p9YhZlveegjIkZ1s2ts3I0=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=OlPNKIJXiJpqV3ICuyWb/6qlC8fBoAfGVjGKMGK/EwZjX77eA1mpfUeFyByAmiOnq w230fdhF79+OUIw+w3hDMV/o6siY3ZuhXIXXhiOCw5R5Xc3XmaEXIjOKF9jnhfNhGA yUhNWuhWno0KsrA+Xc/ZDV94ynA/oWHzQEI+Oe+g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EA2DBF80570; Mon, 31 Oct 2022 07:45:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D65D4F804C1; Fri, 28 Oct 2022 17:27:00 +0200 (CEST) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 ADD05F800E1 for ; Fri, 28 Oct 2022 17:26:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz ADD05F800E1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.b="A9tM9pd5" Received: by mail-ej1-x632.google.com with SMTP id kt23so13685681ejc.7 for ; Fri, 28 Oct 2022 08:26:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qWOXtZdeE7MXcWYkV9UqH7xJWnsDsrChaSh5X+0ymME=; b=A9tM9pd5l2CdvVGQhJ9hSPryXHIi3u3k5PvNLdLItJWafLR3Mz9QQCXpsQJHcYDxY1 1GpOIJEHJpegytu5MENt44AgAUdDFP+h7HObOzqEd1gASFiK7tCocoQnyDsnYYlX4uUG 0G/JXcIRm9pLLVRiDrN+bICu8NFfvCqar3Ifkqm8Pin7Ezm39JktPAuTD6B+5uvn8pET pqcQN46LVvX5NJMDwHLGbHxgibD3+cYVR98HaGPcImq5eSXXYxYwBZPlu+HiMEXvgVoH 3Q9/NV7S7yXI+M9b5X5rmf6CiBDS9VxDApVoIjzcGmz8AB+c1NsPov04khEdmo5u5J/s Zu1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qWOXtZdeE7MXcWYkV9UqH7xJWnsDsrChaSh5X+0ymME=; b=1XmtH/n6/l9OmVUVhhtxcQfX6aBJvkvtqDpZPO5BL+c1DF4OiONe1hiQL2On5FqttM QoLr8pYd3VpcDAeYxAECJcLevaO1okGwm0zTrsmoX8sjV5jiP21IHYOVAF1WSAviqPS+ xS3u15WmsX3HytK3djjWGMwdp7OmoiCjs34W8ZYEma1NNcVZZx2j8pqHPEJdZDOPiy/z N8dr2yiRa85nFA/dhgeEXgDRe5Z3c+bz9Q+V+PTc/q8KZQXYCGcTPr9Pdo/mr43rpKc7 6cW1v+IhtNr3I1v0c7VKg5l4xzawlceM1bVM0Iy5AoZo8bqJrBhhaBPZ0CSLc2YzaR6z eBmQ== X-Gm-Message-State: ACrzQf1HQ+OGra9QaOQa04zt3FfaGiVjUqlr567Pz0C9O0+7NJ6iWl9y 6CxeD1m1TBdIf1pdQfaYnEwceg== X-Google-Smtp-Source: AMsMyM7s4zQhZSZe0Gwp4o8LLInXxkJAz9VOMp7gKPhy4+xNy/Geo2aAiMWI5r+csh+Y04c6Ix2YwQ== X-Received: by 2002:a17:907:1b1f:b0:72f:56db:cce9 with SMTP id mp31-20020a1709071b1f00b0072f56dbcce9mr46674745ejc.605.1666970812645; Fri, 28 Oct 2022 08:26:52 -0700 (PDT) Received: from dtpc.zanders.be (78-22-137-109.access.telenet.be. [78.22.137.109]) by smtp.gmail.com with ESMTPSA id 17-20020a170906319100b00730df07629fsm2349839ejy.174.2022.10.28.08.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:26:52 -0700 (PDT) From: Maarten Zanders To: Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 2/3] ASoC: adau1372: add support for S24_LE mode Date: Fri, 28 Oct 2022 17:26:24 +0200 Message-Id: <20221028152626.109603-3-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221028152626.109603-1-maarten.zanders@mind.be> References: <20221028152626.109603-1-maarten.zanders@mind.be> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 31 Oct 2022 07:45:34 +0100 Cc: alsa-devel@alsa-project.org, Maarten Zanders , linux-kernel@vger.kernel.org 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 ADAU1372 contains 24bit ADCs and DACs. Allow the driver to use its native mode which uses the same settings as the current 32 bit mode. Signed-off-by: Maarten Zanders --- sound/soc/codecs/adau1372.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index 00d0825e193b..6b35981c8777 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -662,6 +662,7 @@ static int adau1372_hw_params(struct snd_pcm_substream *substream, case 16: sai1 = ADAU1372_SAI1_BCLKRATE; break; + case 24: case 32: sai1 = 0; break; @@ -699,6 +700,7 @@ static int adau1372_set_tdm_slot(struct snd_soc_dai *dai, unsigned int tx_mask, case 16: sai1 = ADAU1372_SAI1_BCLK_TDMC; break; + case 24: case 32: sai1 = 0; break; @@ -869,7 +871,9 @@ static const struct snd_soc_dai_ops adau1372_dai_ops = { .startup = adau1372_startup, }; -#define ADAU1372_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE) +#define ADAU1372_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) static struct snd_soc_dai_driver adau1372_dai_driver = { .name = "adau1372", From patchwork Fri Oct 28 15:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Zanders X-Patchwork-Id: 13025438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D81DFC38A02 for ; Mon, 31 Oct 2022 06:48:20 +0000 (UTC) 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 F3E8E1654; Mon, 31 Oct 2022 07:47:28 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F3E8E1654 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1667198899; bh=z/VdrABl0kCxE7w0XsOVtXZCCrsTiTTn598YS2Fh7eA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ACwvyV57+tWhV4TVAjhAHIkTmAV0kK5kEHkG4wwzMpbT1egq/dJDqxLD38fIKoh9u J49B+KAPF06UHqmDvW1IZMpw8ZYe2Y5GTuR2LzcV5d3RvDVKA/ocBH6xGVdsAaYDvU VgbVusFigLktC12FuwTp4DZmp2lFjQHWTMXXt++w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 924EEF80578; Mon, 31 Oct 2022 07:45:40 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7F99DF80095; Fri, 28 Oct 2022 17:27:04 +0200 (CEST) Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) (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 5E02CF80095 for ; Fri, 28 Oct 2022 17:26:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5E02CF80095 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=mind.be header.i=@mind.be header.b="EuqLHIac" Received: by mail-ej1-x633.google.com with SMTP id t25so13733485ejb.8 for ; Fri, 28 Oct 2022 08:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind.be; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eLsw+iN8jpJl9FHuzYsNNqJNfmeMGSrcPtNG/wbe8TE=; b=EuqLHIacnhZIvU2B46I6TgVFg7XuOAx4Nvgd4xed1aECAOsYi8YmKNhhzxZzDwE0zP zHcoIa7ttY6R0Hae+7JQ59m21JEFYFNadu7wUJSW2S6qAbe8qFlHan6TYxl+KiHTeC7l z/yIQjFKeSn38ut/Kvd1aM8redbgqqGnYscyt8fDc8XvQUZ2fRNO30AjWAH78blaeiuL ck3u9aDzCZd9jBoct8NexLa0AbYyXX+oHjMNtx70tQD+70XE/VagDl92yY2DFXTgW+O1 pkq2CviPYMfm9yf2Rp65/uVHMI6BGKYtMCQDAQ17bAk5LngNeQeVP8ZJ5gvD70qBrEVB an2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eLsw+iN8jpJl9FHuzYsNNqJNfmeMGSrcPtNG/wbe8TE=; b=aIy1GWcSLrhXWS41FxRXfDQCf3hH2rcJBRdYnfLrv45CbHJFRlJhYlSAcSSfWt+Oop 6Qo1B4K1w+VbUAVbhoDLeggXbALuR/pt2k0oypX8l/Wbes9OigYT2zagKF+Q+j4ACTSv flQWKBZC55paXnT7LG0wc+ElrsZ+ZXT/Fa9GWxoXC6nGdIgPxa5U+vi+zSXVUeFpf8NZ BJ0DBPHh7ZvOz5z0PZUKQ5yGRE6IUxF+gYtPrOWWRa7BiCuFuyGWcjKccLr5qSO46P8X ZMxdy0E8HkCCB1vTlz4Odd9Ji4pY1VxkKg5KQMBSuv0IChJ6ZjmlhFTtJQJbuU0oZDiv Tx5w== X-Gm-Message-State: ACrzQf1mgTpLmuFZCrDu0amRrFn5Wc066lIZCSdPNhjgZhzsRyrMGsWu mGojilk4xj8vcrg3PJP9hlKKrA== X-Google-Smtp-Source: AMsMyM5YKp142ssImrqyoaxRTpa8mAxOIIlTKUWb2Y2mcX9lTDP2Y/CP2TRhAuarq2nTy03foaT+/A== X-Received: by 2002:a17:907:2cd9:b0:78d:9f4c:9cff with SMTP id hg25-20020a1709072cd900b0078d9f4c9cffmr47298639ejc.345.1666970814476; Fri, 28 Oct 2022 08:26:54 -0700 (PDT) Received: from dtpc.zanders.be (78-22-137-109.access.telenet.be. [78.22.137.109]) by smtp.gmail.com with ESMTPSA id 17-20020a170906319100b00730df07629fsm2349839ejy.174.2022.10.28.08.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 08:26:54 -0700 (PDT) From: Maarten Zanders To: Lars-Peter Clausen , =?utf-8?q?Nuno_S=C3=A1?= , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 3/3] ASoC: adau1372: correct PGA enable & mute bit Date: Fri, 28 Oct 2022 17:26:25 +0200 Message-Id: <20221028152626.109603-4-maarten.zanders@mind.be> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221028152626.109603-1-maarten.zanders@mind.be> References: <20221028152626.109603-1-maarten.zanders@mind.be> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 31 Oct 2022 07:45:34 +0100 Cc: alsa-devel@alsa-project.org, Maarten Zanders , linux-kernel@vger.kernel.org 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 DAPM control for PGAx uses the PGA mute bit for power management. This bit is active high but is set to non-inverted (ie when powering, it will mute). The ALSA control "PGA x Capture Switch" uses the active high PGA_ENx bit, but is set to inverted. So when enabling this switch, the PGA gets disabled. To correct the behaviour, invert both these bits. Signed-off-by: Maarten Zanders --- sound/soc/codecs/adau1372.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/adau1372.c b/sound/soc/codecs/adau1372.c index 6b35981c8777..c5e0f10e6982 100644 --- a/sound/soc/codecs/adau1372.c +++ b/sound/soc/codecs/adau1372.c @@ -206,10 +206,10 @@ static const struct snd_kcontrol_new adau1372_controls[] = { 2, 1, 0, adau1372_pga_boost_tlv), SOC_SINGLE_TLV("PGA 3 Boost Capture Volume", ADAU1372_REG_PGA_BOOST, 3, 1, 0, adau1372_pga_boost_tlv), - SOC_SINGLE("PGA 0 Capture Switch", ADAU1372_REG_PGA_CTRL(0), 7, 1, 1), - SOC_SINGLE("PGA 1 Capture Switch", ADAU1372_REG_PGA_CTRL(1), 7, 1, 1), - SOC_SINGLE("PGA 2 Capture Switch", ADAU1372_REG_PGA_CTRL(2), 7, 1, 1), - SOC_SINGLE("PGA 3 Capture Switch", ADAU1372_REG_PGA_CTRL(3), 7, 1, 1), + SOC_SINGLE("PGA 0 Capture Switch", ADAU1372_REG_PGA_CTRL(0), 7, 1, 0), + SOC_SINGLE("PGA 1 Capture Switch", ADAU1372_REG_PGA_CTRL(1), 7, 1, 0), + SOC_SINGLE("PGA 2 Capture Switch", ADAU1372_REG_PGA_CTRL(2), 7, 1, 0), + SOC_SINGLE("PGA 3 Capture Switch", ADAU1372_REG_PGA_CTRL(3), 7, 1, 0), SOC_SINGLE_TLV("DAC 0 Playback Volume", ADAU1372_REG_DAC_VOL(0), 0, 0xff, 1, adau1372_digital_tlv), @@ -369,10 +369,10 @@ static const struct snd_soc_dapm_widget adau1372_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("MICBIAS0", ADAU1372_REG_MICBIAS, 4, 0, NULL, 0), SND_SOC_DAPM_SUPPLY("MICBIAS1", ADAU1372_REG_MICBIAS, 5, 0, NULL, 0), - SND_SOC_DAPM_PGA("PGA0", ADAU1372_REG_PGA_CTRL(0), 6, 0, NULL, 0), - SND_SOC_DAPM_PGA("PGA1", ADAU1372_REG_PGA_CTRL(1), 6, 0, NULL, 0), - SND_SOC_DAPM_PGA("PGA2", ADAU1372_REG_PGA_CTRL(2), 6, 0, NULL, 0), - SND_SOC_DAPM_PGA("PGA3", ADAU1372_REG_PGA_CTRL(3), 6, 0, NULL, 0), + SND_SOC_DAPM_PGA("PGA0", ADAU1372_REG_PGA_CTRL(0), 6, 1, NULL, 0), + SND_SOC_DAPM_PGA("PGA1", ADAU1372_REG_PGA_CTRL(1), 6, 1, NULL, 0), + SND_SOC_DAPM_PGA("PGA2", ADAU1372_REG_PGA_CTRL(2), 6, 1, NULL, 0), + SND_SOC_DAPM_PGA("PGA3", ADAU1372_REG_PGA_CTRL(3), 6, 1, NULL, 0), SND_SOC_DAPM_ADC("ADC0", NULL, ADAU1372_REG_ADC_CTRL2, 0, 0), SND_SOC_DAPM_ADC("ADC1", NULL, ADAU1372_REG_ADC_CTRL2, 1, 0), SND_SOC_DAPM_ADC("ADC2", NULL, ADAU1372_REG_ADC_CTRL3, 0, 0),