From patchwork Mon Feb 9 08:06:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 5798961 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 710199F336 for ; Mon, 9 Feb 2015 08:08:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACEA120120 for ; Mon, 9 Feb 2015 08:08:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8059B20035 for ; Mon, 9 Feb 2015 08:08:38 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A798D2606A2; Mon, 9 Feb 2015 09:08:37 +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 D1F842605D2; Mon, 9 Feb 2015 09:07:11 +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 6B6162605D2; Mon, 9 Feb 2015 09:07:10 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 9E4EC2605C3 for ; Mon, 9 Feb 2015 09:06:32 +0100 (CET) Received: from unknown (HELO relmlir4.idc.renesas.com) ([10.200.68.154]) by relmlie3.idc.renesas.com with ESMTP; 09 Feb 2015 17:06:30 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir4.idc.renesas.com (Postfix) with ESMTP id 0BEFD4325E; Mon, 9 Feb 2015 17:06:31 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id E164C480A3; Mon, 9 Feb 2015 17:06:30 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id AE764480A4; Mon, 9 Feb 2015 17:06:30 +0900 (JST) Received: from relmlii2.idc.renesas.com [10.200.68.66] by relmlac4.idc.renesas.com with ESMTP id TAA21817; Mon, 9 Feb 2015 17:06:30 +0900 X-IronPort-AV: E=Sophos;i="5.09,542,1418050800"; d="scan'208";a="180591838" Received: from mail-hk1lp0122.outbound.protection.outlook.com (HELO APAC01-HK1-obe.outbound.protection.outlook.com) ([207.46.51.122]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA; 09 Feb 2015 17:06:29 +0900 Received: from remon.renesas.com (211.11.155.132) by HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) with Microsoft SMTP Server (TLS) id 15.1.75.20; Mon, 9 Feb 2015 08:06:28 +0000 Message-ID: <874mqvwlrt.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.14.0 Emacs/23.3 Mule/6.0 To: Mark Brown In-Reply-To: <87a90nwlur.wl%kuninori.morimoto.gx@renesas.com> References: <87h9v4gbhg.wl%kuninori.morimoto.gx@renesas.com> <87iofj7qhc.wl%kuninori.morimoto.gx@renesas.com> <20150204205503.GM21293@sirena.org.uk> <87a90nwlur.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Date: Mon, 9 Feb 2015 08:06:28 +0000 X-Originating-IP: [211.11.155.132] X-ClientProxiedBy: SIXPR06CA0058.apcprd06.prod.outlook.com (25.160.171.176) To HKXPR06MB165.apcprd06.prod.outlook.com (10.242.124.16) 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:HKXPR06MB165; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:HKXPR06MB165; X-Forefront-PRVS: 04825EA361 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(19580405001)(62966003)(19580395003)(110136001)(42186005)(40100003)(23726002)(46102003)(77096005)(47776003)(122386002)(86362001)(46406003)(33646002)(2950100001)(66066001)(50986999)(87976001)(54356999)(76176999)(50466002)(229853001)(77156002)(92566002)(36756003)(53416004); DIR:OUT; SFP:1102; SCL:1; SRVR:HKXPR06MB165; H:remon.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:HKXPR06MB165; X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2015 08:06:28.5000 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HKXPR06MB165 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH 4/6] 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 --- 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 39a8cab..db7b070 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1642,6 +1642,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: @@ -2362,22 +2379,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);