From patchwork Thu Mar 1 19:26:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 130399 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp3190329edc; Thu, 1 Mar 2018 11:27:14 -0800 (PST) X-Google-Smtp-Source: AG47ELtViQRaVZuhw3FTKD+rCO+bmGVghghhRyn6ACR/45ZxFATHfkyH+l+jY/RWiaYFUjpg2DPO X-Received: by 10.223.132.167 with SMTP id 36mr3073168wrg.227.1519932434555; Thu, 01 Mar 2018 11:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519932434; cv=none; d=google.com; s=arc-20160816; b=WpCVotPtxPgbbAsaRYn4ZYMLSC7+MxcOUrJbs0DJLvypL/eUONs3Gv9Mfcun25VHYA ZtGnK8k50bIgJcoW/8IeM88lB+6EqfW9Uf7xxOGB+JyTpdwVsbd0agNJ/t4VFJJdJILM XoKRvJfvDJO29P3a21R7dtMqUpP1IyT8bfHqVAUPtQ5qnk+18AabDuf39017sj7h2GaI 3nFO9ScjNe0c+g8VR66+Diz35stnvIqlCDDOms4Q1WW+7cyjXiPiVc0DnW3NsFnHzRmm JArUK1CnK1oz2UJhLNpZSuCqoIBOFTNLjnXvDf7Pwner5oZhDcAOU9rCDXpWTTj4beqI LXJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=8Yl6Y6u93hzt9tguJiOjK3RWUX3Jl1+E5FjVLqhxfqQ=; b=AGkMAMSmTd1/kYAyzCPMkM1U5dkh6V7uQ+HJ4yNPvgoJUtP5EkIjylY8XVbbX8Zinh 6qOwrryKvHKtf2AIbCmmqi6jbFf9iASSoVGMRMPktxwiUY3dUQ/lLry5qoGbA4nQkCpt 0YVMmEDxBvVFijYTVvml0qiShpTQesTqB+EPs1GpHPN+SeD9ZmMxI+gaH7BC5Gb8faQX CxbsNMe9KePuGggV78LC+3uJxxJ2yIcV+FEH/rd5zlnZ+w0BjD+GAvALUqdky52qpBeh vSbQ9TRK0nfQdIorQqfNCe4T7pnuWtITVWbsWzO8ylv8FcYgZ6HjViPRLGXQpstqHKJ1 2X+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mtUyDUpK; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id b48si3435444wra.503.2018.03.01.11.27.14; Thu, 01 Mar 2018 11:27:14 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=mtUyDUpK; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 21B55267BB7; Thu, 1 Mar 2018 20:26:35 +0100 (CET) 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 7709F267BAC; Thu, 1 Mar 2018 20:26:30 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id CA7EB267BAA for ; Thu, 1 Mar 2018 20:26:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=UmSgM/Vb1z+sXRBK4CsTJ7OC4/YU47TVuiDPY3MHfzE=; b=mtUyDUpK/0pL GdjGlxS18THC7Mwm3vWlM+T6puuiczu8c19e0A4al5AHlPZQDRmdIdkaDInEUw2t31WU/oJRcVa4Y A0p/AcY9AeG3z178QMrRPtAEx4SlILToKkViyUJ4vKdY8pbR9YwlBxET/K/LUyEOAli5cuDtdfLRx 7VUYk=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1erTqO-0005jY-Gy; Thu, 01 Mar 2018 19:26:20 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1erTqO-0001ZG-2X; Thu, 01 Mar 2018 19:26:20 +0000 From: Mark Brown To: Hans de Goede In-Reply-To: <20180225104713.4745-9-hdegoede@redhat.com> Message-Id: Date: Thu, 01 Mar 2018 19:26:20 +0000 Cc: Oder Chiou , alsa-devel@alsa-project.org, Pierre-Louis Bossart , Takashi Iwai , Mark Brown , Carlo Caione , Bard Liao Subject: [alsa-devel] Applied "ASoC: rt5651: Fix bias_level confusion" to the asoc tree 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 The patch ASoC: rt5651: Fix bias_level confusion has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 984c803f9a2ad6f1d2bea0b7ef2e3c18d69fbdfd Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Sun, 25 Feb 2018 11:46:49 +0100 Subject: [PATCH] ASoC: rt5651: Fix bias_level confusion The rt5651_set_bias_level() function was turning everything off at SND_SOC_BIAS_STANDBY, rather then at SND_SOC_BIAS_OFF, requiring the bias- level to be raised to SND_SOC_BIAS_PREPARE before turning anything on. This is not how the bias-levels are supposed to work, this commit fixes this by turning everything off at the SND_SOC_BIAS_OFF level and enabling the pwr-bits needed for minimum functionality at SND_SOC_BIAS_STANDBY. This fixes the minimum set of pwr-bits not getting enabled when force-enabling some dapm-supplies (e.g. for jack type detection), which raises the bias-level to standby. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- sound/soc/codecs/rt5651.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) -- 2.16.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c index 8548f9406520..c565607f95f7 100644 --- a/sound/soc/codecs/rt5651.c +++ b/sound/soc/codecs/rt5651.c @@ -1526,6 +1526,13 @@ static int rt5651_set_bias_level(struct snd_soc_component *component, switch (level) { case SND_SOC_BIAS_PREPARE: if (SND_SOC_BIAS_STANDBY == snd_soc_component_get_bias_level(component)) { + if (snd_soc_component_read32(component, RT5651_PLL_MODE_1) & 0x9200) + snd_soc_component_update_bits(component, RT5651_D_MISC, + 0xc00, 0xc00); + } + break; + case SND_SOC_BIAS_STANDBY: + if (SND_SOC_BIAS_OFF == snd_soc_component_get_bias_level(component)) { snd_soc_component_update_bits(component, RT5651_PWR_ANLG1, RT5651_PWR_VREF1 | RT5651_PWR_MB | RT5651_PWR_BG | RT5651_PWR_VREF2, @@ -1539,13 +1546,10 @@ static int rt5651_set_bias_level(struct snd_soc_component *component, RT5651_PWR_LDO_DVO_MASK, RT5651_PWR_LDO_DVO_1_2V); snd_soc_component_update_bits(component, RT5651_D_MISC, 0x1, 0x1); - if (snd_soc_component_read32(component, RT5651_PLL_MODE_1) & 0x9200) - snd_soc_component_update_bits(component, RT5651_D_MISC, - 0xc00, 0xc00); } break; - case SND_SOC_BIAS_STANDBY: + case SND_SOC_BIAS_OFF: snd_soc_component_write(component, RT5651_D_MISC, 0x0010); snd_soc_component_write(component, RT5651_PWR_DIG1, 0x0000); snd_soc_component_write(component, RT5651_PWR_DIG2, 0x0000);