From patchwork Mon Feb 19 12:18:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128807 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3437191ljc; Mon, 19 Feb 2018 04:19:09 -0800 (PST) X-Google-Smtp-Source: AH8x225E3LDOy/dsIAB8zEz7h93E8zwKBdUD57SyKpXaDYKRbQ1d6dQVMai9mA2ehvuOEffu/j36 X-Received: by 10.28.69.87 with SMTP id s84mr10898091wma.107.1519042749056; Mon, 19 Feb 2018 04:19:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519042749; cv=none; d=google.com; s=arc-20160816; b=P4crPKNybl1sf8IQ6kTdCCO/vgzLx5uuTvGc8CsGtXxuiP0mti9vmtHxjf4UF3slpW vYJKoIoGb8gTi9NnlkINLzpnHwNU5d0wzkdh1RDsgFFa7HZyVDSsYaysED9Jun4yWihL UAK1j8KfjFkK39/hDrotp1FZ6y+iCnWOoelI4KQq3Wy+wJjqAxtaD5cFv1RKQNpKRnnn FjeK+01PoVHmtrMQxyOoQXHFB8SUKQQTbceJ2mpQekAG4sN6VUvXB22Mg4qRyR118bFW dblVGfqXANMF5L5zZtMWn6G4DOM/pMUWEmfIWLBsFrNS92+5papjjnckNx51F34XALoU cfsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=Pb4VOc18h6wviZYO91XOd5Rw5gLWWrY+06jFMdz7gZY=; b=knPQvlwlq5qsqvaDvIVCvpZFPCOMD5owDQNRZo7cJ9qkg5NJMNAH5hk3p563JY8lIK t4ZcQY7qVoF1Cbn3vetF5EMMcf+HWuUcilEJwt+jQ3Ffcb0aT1+Yx6k3DpDu1xui13yQ IYWsQqTSVwJ+8gYSpOjIaX38ykF4a67CTDlp+5qNClL/FPI7esDLir+CXmJJM/NC5Okd HzzaTLgQcBcRvnuLj+irJolIpSSrAi0PgcabwG3Hpv9RwHLU3ysDn3VoHoemdoUzGsA6 /wP9In/q05+i7irZFuz3JHj6GGgQ4oC58Ju8WvqH5WuFfTVqUwhBQaAsiqeet6icznQF vodA== 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=Ghf6w/0T; 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 m27si4371661wrm.302.2018.02.19.04.19.08; Mon, 19 Feb 2018 04:19:09 -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=Ghf6w/0T; 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 D8C7326742B; Mon, 19 Feb 2018 13:18:33 +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 6C6482673F2; Mon, 19 Feb 2018 13:18:32 +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 EF453266EBE for ; Mon, 19 Feb 2018 13:18: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=bLc1mP6osa5XXQ2I8tu8O1G1rLnyM6WURba+/hhKkPM=; b=Ghf6w/0TTrOL DCkxdetoPhtHWDrkYQoLTrNz7pxrsDEleX5El7WPyMpQa8Eq1gtTU0A68JHIxP3yI534ulamfnKhX zYdVeDSVWrXsW//3NPxVuAhHpK1m9Nzi7synl573AcDrKnEwJnLAZvjIR3AArTjz83CDWS/To85IX IV608=; 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 1enkOo-0003TZ-K6; Mon, 19 Feb 2018 12:18:26 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1enkOo-0002ko-4K; Mon, 19 Feb 2018 12:18:26 +0000 From: Mark Brown To: Peter Ujfalusi In-Reply-To: <20180219094508.26662-3-peter.ujfalusi@ti.com> Message-Id: Date: Mon, 19 Feb 2018 12:18:26 +0000 Cc: alsa-devel@alsa-project.org, s.mueller-klieser@phytec.de, Liam Girdwood , Jyri Sarha , afd@ti.com, Mark Brown Subject: [alsa-devel] Applied "ASoC: tlv320aic31xx: Do not force power on the DAC/ADC in clock master mode" 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: tlv320aic31xx: Do not force power on the DAC/ADC in clock master mode 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 a16be2a6e2ffa8ad5e24e96289f317e1b5b8c17a Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Mon, 19 Feb 2018 11:45:08 +0200 Subject: [PATCH] ASoC: tlv320aic31xx: Do not force power on the DAC/ADC in clock master mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With P0 R29, Bit2 set the I2S clocks will be running when the DAC/ADC is powered down, but still the codec need to be powered up by needing at least one complete DAPM path for the stream. If the AIF is not needed (analog loopback for example) the I2S clocks will not run as they are not needed. Signed-off-by: Peter Ujfalusi Suggested-by: Stefan Müller-Klieser Signed-off-by: Mark Brown --- sound/soc/codecs/tlv320aic31xx.c | 32 ++++++++++++++++++++++---------- sound/soc/codecs/tlv320aic31xx.h | 1 + 2 files changed, 23 insertions(+), 10 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c index e5a1e2be17aa..bf92d36b8f8a 100644 --- a/sound/soc/codecs/tlv320aic31xx.c +++ b/sound/soc/codecs/tlv320aic31xx.c @@ -501,6 +501,10 @@ static const struct snd_soc_dapm_widget common31xx_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("MICBIAS", SND_SOC_NOPM, 0, 0, mic_bias_event, SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD), + /* Keep BCLK/WCLK enabled even if DAC/ADC is powered down */ + SND_SOC_DAPM_SUPPLY("Activate I2S clocks", AIC31XX_IFACE2, 2, 0, + NULL, 0), + /* Outputs */ SND_SOC_DAPM_OUTPUT("HPL"), SND_SOC_DAPM_OUTPUT("HPR"), @@ -553,6 +557,8 @@ static const struct snd_soc_dapm_widget aic31xx_dapm_widgets[] = { SND_SOC_DAPM_MIXER("Output Right", SND_SOC_NOPM, 0, 0, aic31xx_right_output_switches, ARRAY_SIZE(aic31xx_right_output_switches)), + + SND_SOC_DAPM_AIF_OUT("AIF OUT", "Capture", 0, SND_SOC_NOPM, 0, 0), }; static const struct snd_soc_dapm_widget aic311x_dapm_widgets[] = { @@ -640,6 +646,8 @@ aic31xx_audio_map[] = { {"ADC", NULL, "MIC_GAIN_CTL"}, + {"AIF OUT", NULL, "ADC"}, + /* Left Output */ {"Output Left", "From Left DAC", "DAC Left"}, {"Output Left", "From MIC1LP", "MIC1LP"}, @@ -673,25 +681,29 @@ aic310x_audio_map[] = { /* * Always connected DAPM routes for codec clock master modes. - * If the codec is the master on the I2S bus, we need to power on components - * to have valid DAC_CLK and also the DACs and ADC for playback/capture. + * If the codec is the master on the I2S bus, we need to power up components + * to have valid DAC_CLK. + * + * In order to have the I2S clocks on the bus either the DACs/ADC need to be + * enabled, or the P0/R29/D2 (Keep bclk/wclk in power down) need to be set. + * * Otherwise the codec will not generate clocks on the bus. */ static const struct snd_soc_dapm_route common31xx_cm_audio_map[] = { - {"DAC Left Input", "Off", "AIF IN"}, - {"DAC Right Input", "Off", "AIF IN"}, + {"HPL", NULL, "AIF IN"}, + {"HPR", NULL, "AIF IN"}, - {"HPL", NULL, "DAC Left"}, - {"HPR", NULL, "DAC Right"}, + {"AIF IN", NULL, "Activate I2S clocks"}, }; static const struct snd_soc_dapm_route aic31xx_cm_audio_map[] = { - {"MIC1LP P-Terminal", "Off", "MIC1LP"}, - {"MIC1RP P-Terminal", "Off", "MIC1RP"}, - {"MIC1LM P-Terminal", "Off", "MIC1LM"}, - {"MIC1LM M-Terminal", "Off", "MIC1LM"}, + {"AIF OUT", NULL, "MIC1LP"}, + {"AIF OUT", NULL, "MIC1RP"}, + {"AIF OUT", NULL, "MIC1LM"}, + + {"AIF OUT", NULL, "Activate I2S clocks"}, }; static int aic31xx_add_controls(struct snd_soc_component *component) diff --git a/sound/soc/codecs/tlv320aic31xx.h b/sound/soc/codecs/tlv320aic31xx.h index 15ac7cba86fe..0b587585b38b 100644 --- a/sound/soc/codecs/tlv320aic31xx.h +++ b/sound/soc/codecs/tlv320aic31xx.h @@ -160,6 +160,7 @@ struct aic31xx_pdata { #define AIC31XX_DACMOD2BCLK 0x01 #define AIC31XX_ADC2BCLK 0x02 #define AIC31XX_ADCMOD2BCLK 0x03 +#define AIC31XX_KEEP_I2SCLK BIT(2) /* AIC31XX_ADCFLAG */ #define AIC31XX_ADCPWRSTATUS_MASK BIT(6)