From patchwork Tue Jan 14 01:33:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 193862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F29B8C33CB1 for ; Tue, 14 Jan 2020 13:23:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8954620678 for ; Tue, 14 Jan 2020 13:23:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8954620678 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=renesas.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (unknown [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 652B92A33; Tue, 14 Jan 2020 02:42:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 652B92A33 Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8A7C9F8033D; Tue, 14 Jan 2020 02:33:22 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0C9D5F8033E; Tue, 14 Jan 2020 02:33:20 +0100 (CET) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id DA4A2F8025A for ; Tue, 14 Jan 2020 02:33:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DA4A2F8025A Date: 14 Jan 2020 10:33:14 +0900 X-IronPort-AV: E=Sophos;i="5.69,431,1571670000"; d="scan'208";a="36372229" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Jan 2020 10:33:14 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 0E20D4148A7F; Tue, 14 Jan 2020 10:33:14 +0900 (JST) Message-ID: <87sgkig6ud.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 From: Kuninori Morimoto To: Mark Brown In-Reply-To: <87ftgihlic.wl-kuninori.morimoto.gx@renesas.com> References: <87ftgihlic.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Cc: Linux-ALSA Subject: [alsa-devel] [PATCH 16/16] ASoC: soc-core: remove DAI suspend/resume X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" From: Kuninori Morimoto Historically, CPU and Codec were implemented different, but now it is merged as Component. ALSA SoC is supporting suspend/resume at DAI and Component level. The method is like below. 1) Suspend/Resume all CPU DAI if bus-control was 0 2) Suspend/Resume all Component 3) Suspend/Resume all CPU DAI if bus-control was 1 Historically 2) was Codec special operation. Because CPU and Codec were merged into Component, CPU has 3 chance to suspend/resume(= 1/2/3), but Codec has 1 chance to suspend/resume(= 2). Here, 1) 2) are caring bus-control, but no driver which is supporting suspend/resume has bus-control. This means 3) is never used. Here, used parameter for suspend/resume component->dev and dai->dev are same pointer. For these reason, we can merge DAI and Component suspend/resume. One note is that we should use 2), because it is caring BIAS level. This patch removes 1) and 3). Signed-off-by: Kuninori Morimoto --- include/sound/soc-dai.h | 2 -- sound/soc/soc-core.c | 41 ----------------------------------------- sound/soc/soc-dai.c | 12 ------------ 3 files changed, 55 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 939c73d..2ccecf3 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -286,8 +286,6 @@ struct snd_soc_dai_driver { /* DAI driver callbacks */ int (*probe)(struct snd_soc_dai *dai); int (*remove)(struct snd_soc_dai *dai); - int (*suspend)(struct snd_soc_dai *dai); - int (*resume)(struct snd_soc_dai *dai); /* compress dai */ int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num); /* Optional Callback used at pcm creation*/ diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index acf6f14..b0ec323 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -558,16 +558,6 @@ int snd_soc_suspend(struct device *dev) if (card->suspend_pre) card->suspend_pre(card); - for_each_card_rtds(card, rtd) { - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - - if (rtd->dai_link->ignore_suspend) - continue; - - if (!cpu_dai->driver->bus_control) - snd_soc_dai_suspend(cpu_dai); - } - /* close any waiting streams */ snd_soc_flush_all_delayed_work(card); @@ -639,16 +629,6 @@ int snd_soc_suspend(struct device *dev) } } - for_each_card_rtds(card, rtd) { - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - - if (rtd->dai_link->ignore_suspend) - continue; - - if (cpu_dai->driver->bus_control) - snd_soc_dai_suspend(cpu_dai); - } - if (card->suspend_post) card->suspend_post(card); @@ -682,17 +662,6 @@ static void soc_resume_deferred(struct work_struct *work) if (card->resume_pre) card->resume_pre(card); - /* resume control bus DAIs */ - for_each_card_rtds(card, rtd) { - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - - if (rtd->dai_link->ignore_suspend) - continue; - - if (cpu_dai->driver->bus_control) - snd_soc_dai_resume(cpu_dai); - } - for_each_card_components(card, component) { if (snd_soc_component_is_suspended(component)) snd_soc_component_resume(component); @@ -726,16 +695,6 @@ static void soc_resume_deferred(struct work_struct *work) } } - for_each_card_rtds(card, rtd) { - struct snd_soc_dai *cpu_dai = rtd->cpu_dai; - - if (rtd->dai_link->ignore_suspend) - continue; - - if (!cpu_dai->driver->bus_control) - snd_soc_dai_resume(cpu_dai); - } - if (card->resume_post) card->resume_post(card); diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 1c7f638..51031e33 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -354,18 +354,6 @@ snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai, return delay; } -void snd_soc_dai_suspend(struct snd_soc_dai *dai) -{ - if (dai->driver->suspend) - dai->driver->suspend(dai); -} - -void snd_soc_dai_resume(struct snd_soc_dai *dai) -{ - if (dai->driver->resume) - dai->driver->resume(dai); -} - int snd_soc_dai_probe(struct snd_soc_dai *dai) { if (dai->driver->probe)