From patchwork Sun Nov 23 12:37:47 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: 5361061 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2982FC11AC for ; Sun, 23 Nov 2014 13:00:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4F75F20251 for ; Sun, 23 Nov 2014 13:00:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 24CFD200F0 for ; Sun, 23 Nov 2014 13:00:15 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0359D2664A5; Sun, 23 Nov 2014 14:00:13 +0100 (CET) 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=ham version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 91EFE2664C8; Sun, 23 Nov 2014 13:43:26 +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 7E8102664CB; Sun, 23 Nov 2014 13:43:25 +0100 (CET) Received: from smtp-out-218.synserver.de (smtp-out-218.synserver.de [212.40.185.218]) by alsa0.perex.cz (Postfix) with ESMTP id 9623E261A5F for ; Sun, 23 Nov 2014 13:38:13 +0100 (CET) Received: (qmail 19653 invoked by uid 0); 23 Nov 2014 12:38:13 -0000 X-SynServer-TrustedSrc: 1 X-SynServer-AuthUser: lars@metafoo.de X-SynServer-PPID: 18412 Received: from ppp-212-114-236-115.dynamic.mnet-online.de (HELO lars-adi-laptop.fritz.box) [212.114.236.115] by 217.119.54.87 with SMTP; 23 Nov 2014 12:38:13 -0000 From: Lars-Peter Clausen To: Mark Brown , Liam Girdwood Date: Sun, 23 Nov 2014 13:37:47 +0100 Message-Id: <1416746269-4935-31-git-send-email-lars@metafoo.de> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1416746269-4935-1-git-send-email-lars@metafoo.de> References: <1416746269-4935-1-git-send-email-lars@metafoo.de> Cc: Charles Keepax , patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, Lars-Peter Clausen Subject: [alsa-devel] [PATCH 31/32] ASoC: wm9712: 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. This makes the code a bit shorter and cleaner. The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe() can also be removed as the core will automatically do this after the CODEC has been probed. Signed-off-by: Lars-Peter Clausen --- sound/soc/codecs/wm9712.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index 52a211b..7c45971 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -636,12 +636,6 @@ err: return -EIO; } -static int wm9712_soc_suspend(struct snd_soc_codec *codec) -{ - wm9712_set_bias_level(codec, SND_SOC_BIAS_OFF); - return 0; -} - static int wm9712_soc_resume(struct snd_soc_codec *codec) { struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); @@ -686,8 +680,6 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec) /* set alc mux to none */ ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); - wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - return 0; reset_err: @@ -706,11 +698,11 @@ static int wm9712_soc_remove(struct snd_soc_codec *codec) static struct snd_soc_codec_driver soc_codec_dev_wm9712 = { .probe = wm9712_soc_probe, .remove = wm9712_soc_remove, - .suspend = wm9712_soc_suspend, .resume = wm9712_soc_resume, .read = ac97_read, .write = ac97_write, .set_bias_level = wm9712_set_bias_level, + .suspend_bias_off = true, .reg_cache_size = ARRAY_SIZE(wm9712_reg), .reg_word_size = sizeof(u16), .reg_cache_step = 2,