From patchwork Sat Sep 6 12:29:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lars-Peter Clausen X-Patchwork-Id: 4857461 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 569E59F32F for ; Sat, 6 Sep 2014 12:30:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8AA712013D for ; Sat, 6 Sep 2014 12:30:32 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3C0A820131 for ; Sat, 6 Sep 2014 12:30:31 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 46C7726513C; Sat, 6 Sep 2014 14:30:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id D609A264F1A; Sat, 6 Sep 2014 14:29:52 +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 A08E5264FF6; Sat, 6 Sep 2014 14:29:51 +0200 (CEST) Received: from smtp-out-247.synserver.de (smtp-out-247.synserver.de [212.40.185.247]) by alsa0.perex.cz (Postfix) with ESMTP id 3A674264F10 for ; Sat, 6 Sep 2014 14:29:42 +0200 (CEST) Received: (qmail 30759 invoked by uid 0); 6 Sep 2014 12:29:42 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 30472 Received: from ppp-188-174-34-103.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [188.174.34.103] by 217.119.54.87 with SMTP; 6 Sep 2014 12:29:41 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Sat, 6 Sep 2014 14:29:32 +0200 Message-Id: <1410006575-499-2-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1410006575-499-1-git-send-email-lars@metafoo.de> References: <1410006575-499-1-git-send-email-lars@metafoo.de> Cc: Fabio Estevam , alsa-devel@alsa-project.org, Lars-Peter Clausen , Tomoya MORINAGA , Haojian Zhuang , Sean Cross Subject: [alsa-devel] [PATCH 2/5] ASoC: es8328: Cleanup manual bias level transitions 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 Set the CODEC driver's suspend_bias_off flag rather than manually going to SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes the code a bit shorter and cleaner. Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/es8328.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index 3ff7870..f273251 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -602,8 +602,6 @@ static int es8328_suspend(struct snd_soc_codec *codec) es8328 = snd_soc_codec_get_drvdata(codec); - es8328_set_bias_level(codec, SND_SOC_BIAS_OFF); - clk_disable_unprepare(es8328->clk); ret = regulator_bulk_disable(ARRAY_SIZE(es8328->supplies), @@ -643,7 +641,6 @@ static int es8328_resume(struct snd_soc_codec *codec) return ret; } - es8328_set_bias_level(codec, SND_SOC_BIAS_STANDBY); return 0; } @@ -712,6 +709,8 @@ static struct snd_soc_codec_driver es8328_codec_driver = { .resume = es8328_resume, .remove = es8328_remove, .set_bias_level = es8328_set_bias_level, + .suspend_bias_off = true, + .controls = es8328_snd_controls, .num_controls = ARRAY_SIZE(es8328_snd_controls), .dapm_widgets = es8328_dapm_widgets,