From patchwork Wed Oct 5 13:51:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Kulhavy X-Patchwork-Id: 9362999 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DAE76077E for ; Wed, 5 Oct 2016 14:28:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A89CC28C7A for ; Wed, 5 Oct 2016 14:28:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A762A28C7E; Wed, 5 Oct 2016 14:28:40 +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=-1.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM autolearn=no 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 D57E128C87 for ; Wed, 5 Oct 2016 14:28:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DC58A261740; Wed, 5 Oct 2016 16:28:36 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 68AFF266671; Wed, 5 Oct 2016 16:26:11 +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 9B3902665C3; Wed, 5 Oct 2016 15:51:32 +0200 (CEST) Received: from fep23.mx.upcmail.net (fep23.mx.upcmail.net [62.179.121.43]) by alsa0.perex.cz (Postfix) with ESMTP id B62E62665E5 for ; Wed, 5 Oct 2016 15:51:21 +0200 (CEST) Received: from edge03.upcmail.net ([192.168.13.238]) by viefep23-int.chello.at (InterMail vM.8.01.05.21 201-2260-151-156-20141103) with ESMTP id <20161005135121.LSRK12996.viefep23-int.chello.at@edge03.upcmail.net> for ; Wed, 5 Oct 2016 15:51:21 +0200 Received: from localhost.localdomain ([83.150.41.162]) by edge03.upcmail.net with edge id rprH1t00x3VvXnX01prLin; Wed, 05 Oct 2016 15:51:20 +0200 X-SourceIP: 83.150.41.162 X-Authenticated-Sender: brain@hispeed.ch From: Petr Kulhavy To: broonie@kernel.org, lgirdwood@gmail.com Date: Wed, 5 Oct 2016 15:51:05 +0200 Message-Id: <1475675467-5575-3-git-send-email-brain@jikos.cz> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475675467-5575-1-git-send-email-brain@jikos.cz> References: <1475675467-5575-1-git-send-email-brain@jikos.cz> Cc: alsa-devel@alsa-project.org, Petr Kulhavy Subject: [alsa-devel] [PATCH v2 2/4] ASoC: tas571x: remove improper PDN signal usage in set_bias_level 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 The set_bias_level toggles the PDN signal when entering SND_SOC_BIAS_STANDBY and SND_SOC_BIAS_OFF. However this has no effect and actually breaks things down (tested with TAS5717) due to the following reasons: 1) holding down PDN does not save power but holding down RST does 2) now hard mute via register 0x5 is implemented and therefore it is no longer needed to toggle PDN to enter all channel shut down 3) in order to leave PDN it is required to toggle the RST signal (see TAS5721 datasheet), which was not implemented 4) toggling PDN as implemented actually mutes PWMs and there is no audio output (tested on TAS5717) For these reasons remove the PDN signal toggling and just initialize it to inactive in probe(). Signed-off-by: Petr Kulhavy --- sound/soc/codecs/tas571x.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 4d61357..a8a3279 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -341,20 +341,9 @@ static int tas571x_set_bias_level(struct snd_soc_codec *codec, return ret; } } - - gpiod_set_value(priv->pdn_gpio, 0); - usleep_range(5000, 6000); - - regcache_cache_only(priv->regmap, false); - ret = regcache_sync(priv->regmap); - if (ret) - return ret; } break; case SND_SOC_BIAS_OFF: - regcache_cache_only(priv->regmap, true); - gpiod_set_value(priv->pdn_gpio, 1); - if (!IS_ERR(priv->mclk)) clk_disable_unprepare(priv->mclk); break; @@ -771,9 +760,6 @@ static int tas571x_i2c_probe(struct i2c_client *client, return ret; } - regcache_cache_only(priv->regmap, true); - gpiod_set_value(priv->pdn_gpio, 1); - return snd_soc_register_codec(&client->dev, &priv->codec_driver, &tas571x_dai, 1); }