From patchwork Mon Oct 3 14:40:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Kulhavy X-Patchwork-Id: 9360769 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 AA71D6075E for ; Mon, 3 Oct 2016 17:31:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8E2E28808 for ; Mon, 3 Oct 2016 17:31:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD3EC2880E; Mon, 3 Oct 2016 17:31:05 +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.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham 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 CC72328808 for ; Mon, 3 Oct 2016 17:31:04 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 2899B266C85; Mon, 3 Oct 2016 19:31:03 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 76280266C73; Mon, 3 Oct 2016 19:28:38 +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 A6AB0266B93; Mon, 3 Oct 2016 16:41:19 +0200 (CEST) Received: from fep23.mx.upcmail.net (fep23.mx.upcmail.net [62.179.121.43]) by alsa0.perex.cz (Postfix) with ESMTP id A2BC9266B9B for ; Mon, 3 Oct 2016 16:41:08 +0200 (CEST) Received: from edge01.upcmail.net ([192.168.13.236]) by viefep23-int.chello.at (InterMail vM.8.01.05.21 201-2260-151-156-20141103) with ESMTP id <20161003144108.FDMU3040.viefep23-int.chello.at@edge01.upcmail.net> for ; Mon, 3 Oct 2016 16:41:08 +0200 Received: from localhost.localdomain ([83.150.41.162]) by edge01.upcmail.net with edge id r2h21t00N3VvXnX012h70t; Mon, 03 Oct 2016 16:41:07 +0200 X-SourceIP: 83.150.41.162 X-Authenticated-Sender: brain@hispeed.ch From: Petr Kulhavy To: broonie@kernel.org, lgirdwood@gmail.com Date: Mon, 3 Oct 2016 16:40:48 +0200 Message-Id: <1475505650-8572-4-git-send-email-brain@jikos.cz> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475505650-8572-1-git-send-email-brain@jikos.cz> References: <1475505650-8572-1-git-send-email-brain@jikos.cz> Cc: alsa-devel@alsa-project.org, Petr Kulhavy Subject: [alsa-devel] [PATCH 3/5] 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); }