From patchwork Wed Jul 24 01:53:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 11055567 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F2DE13B1 for ; Wed, 24 Jul 2019 02:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C84B286D3 for ; Wed, 24 Jul 2019 02:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40D3928789; Wed, 24 Jul 2019 02:17:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82B73286D3 for ; Wed, 24 Jul 2019 02:17:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [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 A3DD81AAC; Wed, 24 Jul 2019 04:08:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A3DD81AAC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563934141; bh=WthM2vrxmL8xHl+GY6P3vNENqnxCelu2mhi2vwPxa1M=; h=Date:From:To:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=VBYIj3BxNroLvpSkwkuxEfpxGu1M02ZbUTqqUvDdD0dIZcZf07PaKEsDKE5EcIwHf csPNSdHRxWqF9udoum3kWMjcCuOGjW7xuEoIET0KtC5e+s1NTQy7A0MFrf+sbS4HRQ mfOHWucUo+iZ1zkLoQ5lRMvJVaolxT9zXcxRy9J0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DFA1EF8071C; Wed, 24 Jul 2019 03:53:54 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5B23EF8072A; Wed, 24 Jul 2019 03:53:53 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 248FCF8071F for ; Wed, 24 Jul 2019 03:53:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 248FCF8071F Date: 24 Jul 2019 10:53:47 +0900 X-IronPort-AV: E=Sophos;i="5.64,300,1559487600"; d="scan'208";a="22240294" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 24 Jul 2019 10:53:47 +0900 Received: from morimoto-PC.renesas.com (unknown [10.166.18.140]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id C601A4000C6C; Wed, 24 Jul 2019 10:53:47 +0900 (JST) Message-ID: <8736iwtd3r.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.5 Mule/6.0 To: Mark Brown In-Reply-To: <8736iwurtc.wl-kuninori.morimoto.gx@renesas.com> References: <8736iwurtc.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 25/25] ASoC: soc-component: move snd_soc_component_set_bias_level() 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" X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto This patch moves snd_soc_component_set_bias_level() to soc-component.c It will be used at soc-dapm.c :: snd_soc_dapm_force_bias_level(), but no effect by this patch. int snd_soc_dapm_force_bias_level(...) { => int ret = 0; => if (dapm->set_bias_level) => ret = dapm->set_bias_level(dapm, level); ... } Signed-off-by: Kuninori Morimoto --- include/sound/soc-component.h | 2 ++ sound/soc/soc-component.c | 10 ++++++++++ sound/soc/soc-core.c | 11 +---------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h index 8c88058..7c9ae25 100644 --- a/include/sound/soc-component.h +++ b/include/sound/soc-component.h @@ -278,6 +278,8 @@ void snd_soc_component_seq_notifier(struct snd_soc_dapm_context *dapm, enum snd_soc_dapm_type type, int subseq); int snd_soc_component_stream_event(struct snd_soc_dapm_context *dapm, int event); +int snd_soc_component_set_bias_level(struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level); #ifdef CONFIG_REGMAP void snd_soc_component_init_regmap(struct snd_soc_component *component, diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index ab8e7cc..b7a7ec7 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -71,6 +71,16 @@ int snd_soc_component_stream_event(struct snd_soc_dapm_context *dapm, return 0; } +int snd_soc_component_set_bias_level(struct snd_soc_dapm_context *dapm, + enum snd_soc_bias_level level) +{ + struct snd_soc_component *component = dapm->component; + + if (component->driver->set_bias_level) + return component->driver->set_bias_level(component, level); + return 0; +} + int snd_soc_component_enable_pin(struct snd_soc_component *component, const char *pin) { diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 6f7de6a..112bde1 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2692,14 +2692,6 @@ int snd_soc_register_dai(struct snd_soc_component *component, } EXPORT_SYMBOL_GPL(snd_soc_register_dai); -static int snd_soc_component_set_bias_level(struct snd_soc_dapm_context *dapm, - enum snd_soc_bias_level level) -{ - struct snd_soc_component *component = dapm->component; - - return component->driver->set_bias_level(component, level); -} - static int snd_soc_component_initialize(struct snd_soc_component *component, const struct snd_soc_component_driver *driver, struct device *dev) { @@ -2722,8 +2714,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component, dapm->suspend_bias_off = driver->suspend_bias_off; dapm->seq_notifier = snd_soc_component_seq_notifier; dapm->stream_event = snd_soc_component_stream_event; - if (driver->set_bias_level) - dapm->set_bias_level = snd_soc_component_set_bias_level; + dapm->set_bias_level = snd_soc_component_set_bias_level; INIT_LIST_HEAD(&component->dai_list); mutex_init(&component->io_mutex);