From patchwork Sat Mar 1 16:04:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang Xiao X-Patchwork-Id: 3747451 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 32F829F381 for ; Sat, 1 Mar 2014 16:05:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 61B9120374 for ; Sat, 1 Mar 2014 16:05:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 433BB20328 for ; Sat, 1 Mar 2014 16:05:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3ED94265593; Sat, 1 Mar 2014 17:05:33 +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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 0E40C265338; Sat, 1 Mar 2014 17:04:52 +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 1ADA4265284; Sat, 1 Mar 2014 17:04:50 +0100 (CET) Received: from mx1.mxmail.xiaomi.com (mx1.mxmail.xiaomi.com [58.68.235.87]) by alsa0.perex.cz (Postfix) with ESMTP id 5BFFC261A9A for ; Sat, 1 Mar 2014 17:04:40 +0100 (CET) Received: from mail.xiaomi.com (unknown [114.255.3.134]) by mx1.mxmail.xiaomi.com (Postfix) with ESMTP id 549E9811FD; Sun, 2 Mar 2014 00:04:03 +0800 (CST) Received: from xiaoxiang-desktop.mioffice.cn (10.237.130.10) by EX-CAS2.xiaomi.net (10.237.8.100) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sun, 2 Mar 2014 00:04:03 +0800 From: Xiang Xiao To: , Date: Sun, 2 Mar 2014 00:04:02 +0800 Message-ID: <1393689843-22916-1-git-send-email-xiaoxiang@xiaomi.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-Originating-IP: [10.237.130.10] X-EsetResult: clean, is OK X-EsetId: E374883E57221E38B336D9 Cc: alsa-devel@alsa-project.org, xiaoxiang@xiaomi.com Subject: [alsa-devel] [PATCH 1/2] ASoC: dapm: Power off all widgets in the snd_soc_dapm_shutdown 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The widgets generated by the machine driver need to power off too. Signed-off-by: Xiang Xiao --- sound/soc/soc-dapm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 3651a37..00ed0e9 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3899,7 +3899,7 @@ void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm) } EXPORT_SYMBOL_GPL(snd_soc_dapm_free); -static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) +static void soc_dapm_shutdown_dapm(struct snd_soc_dapm_context *dapm) { struct snd_soc_card *card = dapm->card; struct snd_soc_dapm_widget *w; @@ -3939,12 +3939,12 @@ static void soc_dapm_shutdown_codec(struct snd_soc_dapm_context *dapm) */ void snd_soc_dapm_shutdown(struct snd_soc_card *card) { - struct snd_soc_codec *codec; + struct snd_soc_dapm_context *dapm; - list_for_each_entry(codec, &card->codec_dev_list, card_list) { - soc_dapm_shutdown_codec(&codec->dapm); - if (codec->dapm.bias_level == SND_SOC_BIAS_STANDBY) - snd_soc_dapm_set_bias_level(&codec->dapm, + list_for_each_entry(dapm, &card->dapm_list, list) { + soc_dapm_shutdown_dapm(dapm); + if (dapm->bias_level == SND_SOC_BIAS_STANDBY) + snd_soc_dapm_set_bias_level(dapm, SND_SOC_BIAS_OFF); } }