From patchwork Fri Feb 13 04:43:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5822901 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59B489F37F for ; Fri, 13 Feb 2015 04:44:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 951DA20260 for ; Fri, 13 Feb 2015 04:44:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 7D233200F0 for ; Fri, 13 Feb 2015 04:44:27 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 98A41265487; Fri, 13 Feb 2015 05:44:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org 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 EB7B326535C; Fri, 13 Feb 2015 05:43:51 +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 9E245265382; Fri, 13 Feb 2015 05:43:50 +0100 (CET) Received: from relmlie2.idc.renesas.com (relmlor3.renesas.com [210.160.252.173]) by alsa0.perex.cz (Postfix) with ESMTP id ECBA026545B for ; Fri, 13 Feb 2015 05:43:32 +0100 (CET) Received: from unknown (HELO relmlir1.idc.renesas.com) ([10.200.68.151]) by relmlie2.idc.renesas.com with ESMTP; 13 Feb 2015 13:43:30 +0900 Received: from relmlac2.idc.renesas.com (relmlac2.idc.renesas.com [10.200.69.22]) by relmlir1.idc.renesas.com (Postfix) with ESMTP id 635454B173; Fri, 13 Feb 2015 13:43:30 +0900 (JST) Received: by relmlac2.idc.renesas.com (Postfix, from userid 0) id 4FEA02806E; Fri, 13 Feb 2015 13:43:30 +0900 (JST) Received: from relmlac2.idc.renesas.com (localhost [127.0.0.1]) by relmlac2.idc.renesas.com (Postfix) with ESMTP id 49FA02806D; Fri, 13 Feb 2015 13:43:30 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac2.idc.renesas.com with ESMTP id PBV10479; Fri, 13 Feb 2015 13:43:30 +0900 X-IronPort-AV: E=Sophos;i="5.09,568,1418050800"; d="scan'208";a="180907454" Received: from mail-sg1lp0088.outbound.protection.outlook.com (HELO APAC01-SG1-obe.outbound.protection.outlook.com) ([207.46.51.88]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Feb 2015 13:43:29 +0900 Received: from remon.renesas.com (211.11.155.132) by HKXPR06MB167.apcprd06.prod.outlook.com (10.242.124.19) with Microsoft SMTP Server (TLS) id 15.1.87.18; Fri, 13 Feb 2015 04:43:27 +0000 Message-ID: <871tlu5sjx.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") To: Mark Brown In-Reply-To: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> References: <874mqq5slj.wl%kuninori.morimoto.gx@renesas.com> Date: Fri, 13 Feb 2015 04:43:27 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SINPR01CA0042.apcprd01.prod.exchangelabs.com (10.141.109.42) To HKXPR06MB167.apcprd06.prod.outlook.com (10.242.124.19) Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB167; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKXPR06MB167; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(83506001)(19580395003)(50466002)(229853001)(66066001)(47776003)(62966003)(77156002)(110136001)(19580405001)(77096005)(2950100001)(46406003)(50986999)(42186005)(46102003)(76176999)(53416004)(54356999)(86362001)(23726002)(40100003)(33646002)(36756003)(122386002)(92566002); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB167; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB167; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2015 04:43:27.6965 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB167 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 2/5 v4] ASoC: soc-core: deactivate pins in snd_soc_instantiate_card() 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 From: Kuninori Morimoto snd_soc_instantiate_card() is the final method of snd_soc_register_card(). Deactivate pins to sleep state is related to snd_soc_instantiate_card(), not snd_soc_register_card() Signed-off-by: Kuninori Morimoto --- v3 -> v4 - no change sound/soc/soc-core.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index a760f6e..7f123bf 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1652,6 +1652,23 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) snd_soc_dapm_sync(&card->dapm); mutex_unlock(&card->mutex); + /* deactivate pins to sleep state */ + for (i = 0; i < card->num_rtd; i++) { + struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + int j; + + for (j = 0; j < rtd->num_codecs; j++) { + struct snd_soc_dai *codec_dai = rtd->codec_dais[j]; + + if (!codec_dai->active) + pinctrl_pm_select_sleep_state(codec_dai->dev); + } + + if (!cpu_dai->active) + pinctrl_pm_select_sleep_state(cpu_dai->dev); + } + return 0; probe_aux_dev_err: @@ -2372,22 +2389,6 @@ int snd_soc_register_card(struct snd_soc_card *card) if (ret != 0) soc_cleanup_card_debugfs(card); - /* deactivate pins to sleep state */ - for (i = 0; i < card->num_rtd; i++) { - struct snd_soc_pcm_runtime *rtd = &card->rtd[i]; - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - int j; - - for (j = 0; j < rtd->num_codecs; j++) { - struct snd_soc_dai *codec_dai = rtd->codec_dais[j]; - if (!codec_dai->active) - pinctrl_pm_select_sleep_state(codec_dai->dev); - } - - if (!cpu_dai->active) - pinctrl_pm_select_sleep_state(cpu_dai->dev); - } - return ret; } EXPORT_SYMBOL_GPL(snd_soc_register_card);