From patchwork Tue Jun 23 01:19:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192355 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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 478E1C433E2 for ; Wed, 24 Jun 2020 07:51:17 +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 CA9A92085B for ; Wed, 24 Jun 2020 07:51:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="aghf7Ygg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA9A92085B 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 (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 5B2131809; Wed, 24 Jun 2020 09:50:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5B2131809 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985075; bh=in89xyYa93xGj8OvC3Ofe5NZH555LdXlFB5d1wKpJUI=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aghf7YggiX/+hsJWlSBqJdl+zakCqQGWu8pASy3fmUMYzlLxCSzI21QZUtehQLL0/ dU7H+GY2FbRxVhVqUEin9/R6UNwP8vj+Yxlst1+z5uuKxM/uDOZKikze2hjWrs7F9v BMDWP/8Lkc7tpE/+ex4Rq6U2jv6Tw+w43SGb8yAA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 11DADF80246; Wed, 24 Jun 2020 09:49:34 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93238F80162; Tue, 23 Jun 2020 03:19:41 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 4DF71F80157 for ; Tue, 23 Jun 2020 03:19:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4DF71F80157 Date: 23 Jun 2020 10:19:31 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50118810" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:19:31 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 51D884008C65; Tue, 23 Jun 2020 10:19:31 +0900 (JST) Message-ID: <87eeq637ff.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 01/19] ASoC: hdmi-codec: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:28 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } For hdmi-codec, we need to update struct hdmi_codec_ops, and all its users in the same time. Signed-off-by: Kuninori Morimoto --- drivers/gpu/drm/bridge/sii902x.c | 9 ++++++--- drivers/gpu/drm/exynos/exynos_hdmi.c | 8 ++++++-- drivers/gpu/drm/i2c/tda998x_drv.c | 9 ++++++--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 8 ++++++-- drivers/gpu/drm/rockchip/cdn-dp-core.c | 9 ++++++--- drivers/gpu/drm/sti/sti_hdmi.c | 8 ++++++-- drivers/gpu/drm/zte/zx_hdmi.c | 9 ++++++--- include/sound/hdmi-codec.h | 3 ++- sound/soc/codecs/hdmi-codec.c | 13 +++++++------ 9 files changed, 51 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 6dad025f8da7..68b850f3a027 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -672,11 +672,14 @@ static void sii902x_audio_shutdown(struct device *dev, void *data) clk_disable_unprepare(sii902x->audio.mclk); } -static int sii902x_audio_digital_mute(struct device *dev, - void *data, bool enable) +static int sii902x_audio_mute(struct device *dev, void *data, + bool enable, int direction) { struct sii902x *sii902x = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + mutex_lock(&sii902x->mutex); sii902x_mute(sii902x, enable); @@ -724,7 +727,7 @@ static int sii902x_audio_get_dai_id(struct snd_soc_component *component, static const struct hdmi_codec_ops sii902x_audio_codec_ops = { .hw_params = sii902x_audio_hw_params, .audio_shutdown = sii902x_audio_shutdown, - .digital_mute = sii902x_audio_digital_mute, + .mute_stream = sii902x_audio_mute, .get_eld = sii902x_audio_get_eld, .get_dai_id = sii902x_audio_get_dai_id, }; diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 95dd399aa9cc..f0f8fb9c62ec 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1604,10 +1604,14 @@ static int hdmi_audio_hw_params(struct device *dev, void *data, return 0; } -static int hdmi_audio_digital_mute(struct device *dev, void *data, bool mute) +static int hdmi_audio_mute(struct device *dev, void *data, + bool mute, int direction) { struct hdmi_context *hdata = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + mutex_lock(&hdata->mutex); hdata->audio.mute = mute; @@ -1634,7 +1638,7 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, static const struct hdmi_codec_ops audio_codec_ops = { .hw_params = hdmi_audio_hw_params, .audio_shutdown = hdmi_audio_shutdown, - .digital_mute = hdmi_audio_digital_mute, + .mute_stream = hdmi_audio_mute, .get_eld = hdmi_audio_get_eld, }; diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 9517f522dcb9..e24cbfbb154a 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -1133,11 +1133,14 @@ static void tda998x_audio_shutdown(struct device *dev, void *data) mutex_unlock(&priv->audio_mutex); } -static int tda998x_audio_digital_mute(struct device *dev, void *data, - bool enable) +static int tda998x_audio_mute_stream(struct device *dev, void *data, + bool enable, int direction) { struct tda998x_priv *priv = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + mutex_lock(&priv->audio_mutex); tda998x_audio_mute(priv, enable); @@ -1162,7 +1165,7 @@ static int tda998x_audio_get_eld(struct device *dev, void *data, static const struct hdmi_codec_ops audio_codec_ops = { .hw_params = tda998x_audio_hw_params, .audio_shutdown = tda998x_audio_shutdown, - .digital_mute = tda998x_audio_digital_mute, + .mute_stream = tda998x_audio_mute_stream, .get_eld = tda998x_audio_get_eld, }; diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c index 5feb760617cb..7721b4762758 100644 --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c @@ -1647,10 +1647,14 @@ static void mtk_hdmi_audio_shutdown(struct device *dev, void *data) } static int -mtk_hdmi_audio_digital_mute(struct device *dev, void *data, bool enable) +mtk_hdmi_audio_mute(struct device *dev, void *data, + bool enable, int direction) { struct mtk_hdmi *hdmi = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + dev_dbg(dev, "%s(%d)\n", __func__, enable); if (enable) @@ -1692,7 +1696,7 @@ static const struct hdmi_codec_ops mtk_hdmi_audio_codec_ops = { .hw_params = mtk_hdmi_audio_hw_params, .audio_startup = mtk_hdmi_audio_startup, .audio_shutdown = mtk_hdmi_audio_shutdown, - .digital_mute = mtk_hdmi_audio_digital_mute, + .mute_stream = mtk_hdmi_audio_mute, .get_eld = mtk_hdmi_audio_get_eld, .hook_plugged_cb = mtk_hdmi_audio_hook_plugged_cb, }; diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index c634b95b50f7..aacde58b8fe8 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -817,12 +817,15 @@ static void cdn_dp_audio_shutdown(struct device *dev, void *data) mutex_unlock(&dp->lock); } -static int cdn_dp_audio_digital_mute(struct device *dev, void *data, - bool enable) +static int cdn_dp_audio_mute_stream(struct device *dev, void *data, + bool enable, int direction) { struct cdn_dp_device *dp = dev_get_drvdata(dev); int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + mutex_lock(&dp->lock); if (!dp->active) { ret = -ENODEV; @@ -849,7 +852,7 @@ static int cdn_dp_audio_get_eld(struct device *dev, void *data, static const struct hdmi_codec_ops audio_codec_ops = { .hw_params = cdn_dp_audio_hw_params, .audio_shutdown = cdn_dp_audio_shutdown, - .digital_mute = cdn_dp_audio_digital_mute, + .mute_stream = cdn_dp_audio_mute_stream, .get_eld = cdn_dp_audio_get_eld, }; diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 5b15c4974e6b..471ac2139a64 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c @@ -1191,10 +1191,14 @@ static int hdmi_audio_hw_params(struct device *dev, return 0; } -static int hdmi_audio_digital_mute(struct device *dev, void *data, bool enable) +static int hdmi_audio_mute(struct device *dev, void *data, + bool enable, int direction) { struct sti_hdmi *hdmi = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + DRM_DEBUG_DRIVER("%s\n", enable ? "enable" : "disable"); if (enable) @@ -1219,7 +1223,7 @@ static int hdmi_audio_get_eld(struct device *dev, void *data, uint8_t *buf, size static const struct hdmi_codec_ops audio_codec_ops = { .hw_params = hdmi_audio_hw_params, .audio_shutdown = hdmi_audio_shutdown, - .digital_mute = hdmi_audio_digital_mute, + .mute_stream = hdmi_audio_mute, .get_eld = hdmi_audio_get_eld, }; diff --git a/drivers/gpu/drm/zte/zx_hdmi.c b/drivers/gpu/drm/zte/zx_hdmi.c index 76a16d997a23..bb4ab395f71d 100644 --- a/drivers/gpu/drm/zte/zx_hdmi.c +++ b/drivers/gpu/drm/zte/zx_hdmi.c @@ -439,11 +439,14 @@ static int zx_hdmi_audio_hw_params(struct device *dev, return zx_hdmi_infoframe_trans(hdmi, &frame, FSEL_AUDIO); } -static int zx_hdmi_audio_digital_mute(struct device *dev, void *data, - bool enable) +static int zx_hdmi_audio_mute(struct device *dev, void *data, + bool enable, int direction) { struct zx_hdmi *hdmi = dev_get_drvdata(dev); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (enable) hdmi_writeb_mask(hdmi, TPI_AUD_CONFIG, TPI_AUD_MUTE, TPI_AUD_MUTE); @@ -468,7 +471,7 @@ static const struct hdmi_codec_ops zx_hdmi_codec_ops = { .audio_startup = zx_hdmi_audio_startup, .hw_params = zx_hdmi_audio_hw_params, .audio_shutdown = zx_hdmi_audio_shutdown, - .digital_mute = zx_hdmi_audio_digital_mute, + .mute_stream = zx_hdmi_audio_mute, .get_eld = zx_hdmi_audio_get_eld, }; diff --git a/include/sound/hdmi-codec.h b/include/sound/hdmi-codec.h index 83b17682e01c..4b7cc86bae95 100644 --- a/include/sound/hdmi-codec.h +++ b/include/sound/hdmi-codec.h @@ -76,7 +76,8 @@ struct hdmi_codec_ops { * Mute/unmute HDMI audio stream. * Optional */ - int (*digital_mute)(struct device *dev, void *data, bool enable); + int (*mute_stream)(struct device *dev, void *data, + bool enable, int direction); /* * Provides EDID-Like-Data from connected HDMI device. diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index f005751da2cc..422ed5cd427f 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -558,13 +558,14 @@ static int hdmi_codec_i2s_set_fmt(struct snd_soc_dai *dai, return 0; } -static int hdmi_codec_digital_mute(struct snd_soc_dai *dai, int mute) +static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - if (hcp->hcd.ops->digital_mute) - return hcp->hcd.ops->digital_mute(dai->dev->parent, - hcp->hcd.data, mute); + if (hcp->hcd.ops->mute_stream) + return hcp->hcd.ops->mute_stream(dai->dev->parent, + hcp->hcd.data, + mute, direction); return 0; } @@ -574,14 +575,14 @@ static const struct snd_soc_dai_ops hdmi_codec_i2s_dai_ops = { .shutdown = hdmi_codec_shutdown, .hw_params = hdmi_codec_hw_params, .set_fmt = hdmi_codec_i2s_set_fmt, - .digital_mute = hdmi_codec_digital_mute, + .mute_stream = hdmi_codec_mute, }; static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = { .startup = hdmi_codec_startup, .shutdown = hdmi_codec_shutdown, .hw_params = hdmi_codec_hw_params, - .digital_mute = hdmi_codec_digital_mute, + .mute_stream = hdmi_codec_mute, }; #define HDMI_RATES (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\ From patchwork Tue Jun 23 01:19:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192354 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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 EA62CC433E0 for ; Wed, 24 Jun 2020 07:52:35 +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 70CCF2085B for ; Wed, 24 Jun 2020 07:52:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="trL+nGyf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70CCF2085B 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 (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 087A51802; Wed, 24 Jun 2020 09:51:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 087A51802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985154; bh=nJY5pM1XJK+PkGo8ItvEhMxQJ8KB2jky9DEP6kMh9Dg=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=trL+nGyfAspfiwz+TOnbuEmjRF63P4Q/DyBI4H4PXBuSYGO9qzH4+6mkN/Th4GzzH lzh+oacmH5zaXx95oLFc5FzzOS6GryxLVcEWKFYJwxOstZRK7LSNjdxp51uXkmqekj lx7fhxDpmRXNlEiFMEmzQDwxIVs4yCUkGY/8Hi0k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4B6F5F802A1; Wed, 24 Jun 2020 09:49:37 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C6C3FF80162; Tue, 23 Jun 2020 03:19:47 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 686DBF8015A for ; Tue, 23 Jun 2020 03:19:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 686DBF8015A Date: 23 Jun 2020 10:19:43 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50118833" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:19:43 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 765E04001DB1; Tue, 23 Jun 2020 10:19:43 +0900 (JST) Message-ID: <87blla37f2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 03/19] ASoC: spear: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:28 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/spear/spdif_out.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 58d5843811f9..c53c59f3b359 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -188,11 +188,14 @@ static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd, return ret; } -static int spdif_digital_mute(struct snd_soc_dai *dai, int mute) +static int spdif_mute(struct snd_soc_dai *dai, int mute, int direction) { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); u32 val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + host->saved_params.mute = mute; val = readl(host->io_base + SPDIF_OUT_CTRL); val &= ~SPDIF_OPMODE_MASK; @@ -229,7 +232,8 @@ static int spdif_mute_put(struct snd_kcontrol *kcontrol, if (host->saved_params.mute == ucontrol->value.integer.value[0]) return 0; - spdif_digital_mute(cpu_dai, ucontrol->value.integer.value[0]); + spdif_mute(cpu_dai, ucontrol->value.integer.value[0], + SNDRV_PCM_STREAM_PLAYBACK); return 1; } @@ -250,7 +254,7 @@ static int spdif_soc_dai_probe(struct snd_soc_dai *dai) } static const struct snd_soc_dai_ops spdif_out_dai_ops = { - .digital_mute = spdif_digital_mute, + .mute_stream = spdif_mute, .startup = spdif_out_startup, .shutdown = spdif_out_shutdown, .trigger = spdif_out_trigger, From patchwork Tue Jun 23 01:19:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192353 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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 311F0C433E0 for ; Wed, 24 Jun 2020 07:57:13 +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 AE0BD20874 for ; Wed, 24 Jun 2020 07:57:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="guiugTSS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE0BD20874 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 (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 2959A17F9; Wed, 24 Jun 2020 09:56:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2959A17F9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985431; bh=zniIKLWgw1oSJHh7xT29+yyI1bZ+tYb8LtxgX9lWPPo=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=guiugTSSY7iO1Uz2FJlXsYKBXHmZ8Sf39iUDnx9LHCqWW7jhZCSpF9ZO7M7Chrrve YCm9tbFC2wljl96772SVUHzWvebQnsxrrYjYm+6NCajgfloLeqPkS6SekG8rdvoFSe hG360HcvwEjjTrsbfxOlTs1yTJ2PoaKjhB2n54jA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 190FAF8032A; Wed, 24 Jun 2020 09:49:50 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 683C7F8015B; Tue, 23 Jun 2020 03:19:57 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 1EF51F80157 for ; Tue, 23 Jun 2020 03:19:51 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1EF51F80157 Date: 23 Jun 2020 10:19:49 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50329359" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 23 Jun 2020 10:19:49 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 64BC94183C30; Tue, 23 Jun 2020 10:19:49 +0900 (JST) Message-ID: <87a70u37ex.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 04/19] ASoC: meson: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:28 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/meson/axg-spdifout.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/meson/axg-spdifout.c b/sound/soc/meson/axg-spdifout.c index 7ce6aa97ddf7..b5dcbfc35a1b 100644 --- a/sound/soc/meson/axg-spdifout.c +++ b/sound/soc/meson/axg-spdifout.c @@ -108,10 +108,13 @@ static int axg_spdifout_trigger(struct snd_pcm_substream *substream, int cmd, } } -static int axg_spdifout_digital_mute(struct snd_soc_dai *dai, int mute) +static int axg_spdifout_mute(struct snd_soc_dai *dai, int mute, int direction) { struct axg_spdifout *priv = snd_soc_dai_get_drvdata(dai); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + /* Use spdif valid bit to perform digital mute */ regmap_update_bits(priv->map, SPDIFOUT_CTRL0, SPDIFOUT_CTRL0_VSET, mute ? SPDIFOUT_CTRL0_VSET : 0); @@ -285,7 +288,7 @@ static void axg_spdifout_shutdown(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops axg_spdifout_ops = { .trigger = axg_spdifout_trigger, - .digital_mute = axg_spdifout_digital_mute, + .mute_stream = axg_spdifout_mute, .hw_params = axg_spdifout_hw_params, .startup = axg_spdifout_startup, .shutdown = axg_spdifout_shutdown, From patchwork Tue Jun 23 01:20:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192352 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=-4.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY 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 EB636C433DF for ; Wed, 24 Jun 2020 07:58:14 +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 4974320B1F for ; Wed, 24 Jun 2020 07:58:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="gj9Efqbh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4974320B1F 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 (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 CDDE0182C; Wed, 24 Jun 2020 09:57:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDDE0182C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985492; bh=pADqnG0RdF2cQ23bDRAturGFFHwbjH93Qjwi3HRb4U4=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=gj9EfqbhIyFjgbtmdd9/Mcv0R4O44EMP5MAwurd4nYM7Gal2IpmgVDLhMqmmT1QtU 5GfUVpE+XPV+G3KkgTMPHlixheaLWGZcw12fFTDhrvBhUBLNzKx6UV2Zh66rDC8Agd redDH8R5/w3CRvjXYiLRHKPPGC5JJnWN0RAx/RBg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id ED288F80338; Wed, 24 Jun 2020 09:49:52 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id ED9FFF80162; Tue, 23 Jun 2020 03:20:10 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 38318F8015A for ; Tue, 23 Jun 2020 03:20:02 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 38318F8015A Date: 23 Jun 2020 10:20:02 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50329387" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:02 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 4212C4001DB1; Tue, 23 Jun 2020 10:20:02 +0900 (JST) Message-ID: <877dvy37ek.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 06/19] ASoC: codecs: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:28 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/88pm860x-codec.c | 9 +++++--- sound/soc/codecs/ad193x.c | 7 +++++-- sound/soc/codecs/adau1701.c | 7 +++++-- sound/soc/codecs/cpcap.c | 15 +++++++++---- sound/soc/codecs/cq93vc.c | 7 +++++-- sound/soc/codecs/isabelle.c | 21 +++++++++++++------ sound/soc/codecs/jz4770.c | 7 +++++-- sound/soc/codecs/lm49453.c | 35 ++++++++++++++++++++++--------- sound/soc/codecs/ml26124.c | 7 +++++-- sound/soc/codecs/nau8822.c | 7 +++++-- sound/soc/codecs/rk3328_codec.c | 7 +++++-- sound/soc/codecs/sgtl5000.c | 7 +++++-- sound/soc/codecs/sta529.c | 7 +++++-- sound/soc/codecs/tfa9879.c | 7 +++++-- sound/soc/codecs/twl6040.c | 7 +++++-- sound/soc/codecs/uda134x.c | 7 +++++-- 16 files changed, 117 insertions(+), 47 deletions(-) diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index 068914d0ef3d..c668029258b0 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c @@ -902,11 +902,14 @@ static const struct snd_soc_dapm_route pm860x_dapm_routes[] = { * Use MUTE_LEFT & MUTE_RIGHT to implement digital mute. * These bits can also be used to mute. */ -static int pm860x_digital_mute(struct snd_soc_dai *codec_dai, int mute) +static int pm860x_mute(struct snd_soc_dai *codec_dai, int mute, int direction) { struct snd_soc_component *component = codec_dai->component; int data = 0, mask = MUTE_LEFT | MUTE_RIGHT; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) data = mask; snd_soc_component_update_bits(component, PM860X_DAC_OFFSET, mask, data); @@ -1136,14 +1139,14 @@ static int pm860x_set_bias_level(struct snd_soc_component *component, } static const struct snd_soc_dai_ops pm860x_pcm_dai_ops = { - .digital_mute = pm860x_digital_mute, + .mute_stream = pm860x_mute, .hw_params = pm860x_pcm_hw_params, .set_fmt = pm860x_pcm_set_dai_fmt, .set_sysclk = pm860x_set_dai_sysclk, }; static const struct snd_soc_dai_ops pm860x_i2s_dai_ops = { - .digital_mute = pm860x_digital_mute, + .mute_stream = pm860x_mute, .hw_params = pm860x_i2s_hw_params, .set_fmt = pm860x_i2s_set_dai_fmt, .set_sysclk = pm860x_set_dai_sysclk, diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 980e024a5720..5af815f1028d 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -143,10 +143,13 @@ static inline bool ad193x_has_adc(const struct ad193x_priv *ad193x) * DAI ops entries */ -static int ad193x_mute(struct snd_soc_dai *dai, int mute) +static int ad193x_mute(struct snd_soc_dai *dai, int mute, int direction) { struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(dai->component); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) regmap_update_bits(ad193x->regmap, AD193X_DAC_CTRL2, AD193X_DAC_MASTER_MUTE, @@ -371,7 +374,7 @@ static int ad193x_startup(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops ad193x_dai_ops = { .startup = ad193x_startup, .hw_params = ad193x_hw_params, - .digital_mute = ad193x_mute, + .mute_stream = ad193x_mute, .set_tdm_slot = ad193x_set_tdm_slot, .set_sysclk = ad193x_set_dai_sysclk, .set_fmt = ad193x_set_dai_fmt, diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 115e296b2ad6..2aa41f91386f 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -573,13 +573,16 @@ static int adau1701_set_bias_level(struct snd_soc_component *component, return 0; } -static int adau1701_digital_mute(struct snd_soc_dai *dai, int mute) +static int adau1701_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; unsigned int mask = ADAU1701_DSPCTRL_DAM; struct adau1701 *adau1701 = snd_soc_component_get_drvdata(component); unsigned int val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val = 0; else @@ -631,7 +634,7 @@ static int adau1701_startup(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops adau1701_dai_ops = { .set_fmt = adau1701_set_dai_fmt, .hw_params = adau1701_hw_params, - .digital_mute = adau1701_digital_mute, + .mute_stream = adau1701_mute, .startup = adau1701_startup, }; diff --git a/sound/soc/codecs/cpcap.c b/sound/soc/codecs/cpcap.c index d7f05b384f1f..24a1d1196d3a 100644 --- a/sound/soc/codecs/cpcap.c +++ b/sound/soc/codecs/cpcap.c @@ -1216,7 +1216,7 @@ static int cpcap_hifi_set_dai_fmt(struct snd_soc_dai *codec_dai, return regmap_update_bits(cpcap->regmap, reg, mask, val); } -static int cpcap_hifi_set_mute(struct snd_soc_dai *dai, int mute) +static int cpcap_hifi_set_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); @@ -1224,6 +1224,9 @@ static int cpcap_hifi_set_mute(struct snd_soc_dai *dai, int mute) static const u16 mask = BIT(CPCAP_BIT_ST_DAC_SW); u16 val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val = 0; else @@ -1237,7 +1240,7 @@ static const struct snd_soc_dai_ops cpcap_dai_hifi_ops = { .hw_params = cpcap_hifi_hw_params, .set_sysclk = cpcap_hifi_set_dai_sysclk, .set_fmt = cpcap_hifi_set_dai_fmt, - .digital_mute = cpcap_hifi_set_mute, + .mute_stream = cpcap_hifi_set_mute, }; static int cpcap_voice_hw_params(struct snd_pcm_substream *substream, @@ -1370,7 +1373,8 @@ static int cpcap_voice_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; } -static int cpcap_voice_set_mute(struct snd_soc_dai *dai, int mute) +static int cpcap_voice_set_mute(struct snd_soc_dai *dai, + int mute, int direction) { struct snd_soc_component *component = dai->component; struct cpcap_audio *cpcap = snd_soc_component_get_drvdata(component); @@ -1378,6 +1382,9 @@ static int cpcap_voice_set_mute(struct snd_soc_dai *dai, int mute) static const u16 mask = BIT(CPCAP_BIT_CDC_SW); u16 val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val = 0; else @@ -1391,7 +1398,7 @@ static const struct snd_soc_dai_ops cpcap_dai_voice_ops = { .hw_params = cpcap_voice_hw_params, .set_sysclk = cpcap_voice_set_dai_sysclk, .set_fmt = cpcap_voice_set_dai_fmt, - .digital_mute = cpcap_voice_set_mute, + .mute_stream = cpcap_voice_set_mute, }; static struct snd_soc_dai_driver cpcap_dai[] = { diff --git a/sound/soc/codecs/cq93vc.c b/sound/soc/codecs/cq93vc.c index b0cc61178a41..4a41cc551bdd 100644 --- a/sound/soc/codecs/cq93vc.c +++ b/sound/soc/codecs/cq93vc.c @@ -30,11 +30,14 @@ static const struct snd_kcontrol_new cq93vc_snd_controls[] = { SOC_SINGLE("Mono DAC Playback Volume", DAVINCI_VC_REG09, 0, 0x3f, 0), }; -static int cq93vc_mute(struct snd_soc_dai *dai, int mute) +static int cq93vc_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; u8 reg; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) reg = DAVINCI_VC_REG09_MUTE; else @@ -87,7 +90,7 @@ static int cq93vc_set_bias_level(struct snd_soc_component *component, #define CQ93VC_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE) static const struct snd_soc_dai_ops cq93vc_dai_ops = { - .digital_mute = cq93vc_mute, + .mute_stream = cq93vc_mute, .set_sysclk = cq93vc_set_dai_sysclk, }; diff --git a/sound/soc/codecs/isabelle.c b/sound/soc/codecs/isabelle.c index 3626f70f7768..204b89d6aa4a 100644 --- a/sound/soc/codecs/isabelle.c +++ b/sound/soc/codecs/isabelle.c @@ -860,24 +860,33 @@ static const struct snd_soc_dapm_route isabelle_intercon[] = { { "LINEOUT2", NULL, "LINEOUT2 Driver" }, }; -static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute) +static int isabelle_hs_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, ISABELLE_DAC1_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; } -static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute) +static int isabelle_hf_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, ISABELLE_DAC2_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; } -static int isabelle_line_mute(struct snd_soc_dai *dai, int mute) +static int isabelle_line_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, ISABELLE_DAC3_SOFTRAMP_REG, BIT(4), (mute ? BIT(4) : 0)); @@ -1014,19 +1023,19 @@ static int isabelle_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) static const struct snd_soc_dai_ops isabelle_hs_dai_ops = { .hw_params = isabelle_hw_params, .set_fmt = isabelle_set_dai_fmt, - .digital_mute = isabelle_hs_mute, + .mute_stream = isabelle_hs_mute, }; static const struct snd_soc_dai_ops isabelle_hf_dai_ops = { .hw_params = isabelle_hw_params, .set_fmt = isabelle_set_dai_fmt, - .digital_mute = isabelle_hf_mute, + .mute_stream = isabelle_hf_mute, }; static const struct snd_soc_dai_ops isabelle_line_dai_ops = { .hw_params = isabelle_hw_params, .set_fmt = isabelle_set_dai_fmt, - .digital_mute = isabelle_line_mute, + .mute_stream = isabelle_line_mute, }; static const struct snd_soc_dai_ops isabelle_ul_dai_ops = { diff --git a/sound/soc/codecs/jz4770.c b/sound/soc/codecs/jz4770.c index 34775aa62402..c9e2ac155421 100644 --- a/sound/soc/codecs/jz4770.c +++ b/sound/soc/codecs/jz4770.c @@ -264,7 +264,7 @@ static int jz4770_codec_pcm_trigger(struct snd_pcm_substream *substream, return ret; } -static int jz4770_codec_digital_mute(struct snd_soc_dai *dai, int mute) +static int jz4770_codec_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *codec = dai->component; struct jz_codec *jz_codec = snd_soc_component_get_drvdata(codec); @@ -272,6 +272,9 @@ static int jz4770_codec_digital_mute(struct snd_soc_dai *dai, int mute) unsigned int val; int change, err; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + change = snd_soc_component_update_bits(codec, JZ4770_CODEC_REG_CR_DAC, REG_CR_DAC_MUTE, mute ? REG_CR_DAC_MUTE : 0); @@ -753,7 +756,7 @@ static const struct snd_soc_dai_ops jz4770_codec_dai_ops = { .shutdown = jz4770_codec_shutdown, .hw_params = jz4770_codec_hw_params, .trigger = jz4770_codec_pcm_trigger, - .digital_mute = jz4770_codec_digital_mute, + .mute_stream = jz4770_codec_mute, }; #define JZ_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ diff --git a/sound/soc/codecs/lm49453.c b/sound/soc/codecs/lm49453.c index f864b07cb0b8..32a384d0ec18 100644 --- a/sound/soc/codecs/lm49453.c +++ b/sound/soc/codecs/lm49453.c @@ -1218,36 +1218,51 @@ static int lm49453_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, return 0; } -static int lm49453_hp_mute(struct snd_soc_dai *dai, int mute) +static int lm49453_hp_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(1)|BIT(0), (mute ? (BIT(1)|BIT(0)) : 0)); return 0; } -static int lm49453_lo_mute(struct snd_soc_dai *dai, int mute) +static int lm49453_lo_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(3)|BIT(2), (mute ? (BIT(3)|BIT(2)) : 0)); return 0; } -static int lm49453_ls_mute(struct snd_soc_dai *dai, int mute) +static int lm49453_ls_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(5)|BIT(4), (mute ? (BIT(5)|BIT(4)) : 0)); return 0; } -static int lm49453_ep_mute(struct snd_soc_dai *dai, int mute) +static int lm49453_ep_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(4), (mute ? BIT(4) : 0)); return 0; } -static int lm49453_ha_mute(struct snd_soc_dai *dai, int mute) +static int lm49453_ha_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, LM49453_P0_DAC_DSP_REG, BIT(7)|BIT(6), (mute ? (BIT(7)|BIT(6)) : 0)); return 0; @@ -1288,35 +1303,35 @@ static const struct snd_soc_dai_ops lm49453_headset_dai_ops = { .hw_params = lm49453_hw_params, .set_sysclk = lm49453_set_dai_sysclk, .set_fmt = lm49453_set_dai_fmt, - .digital_mute = lm49453_hp_mute, + .mute_stream = lm49453_hp_mute, }; static const struct snd_soc_dai_ops lm49453_speaker_dai_ops = { .hw_params = lm49453_hw_params, .set_sysclk = lm49453_set_dai_sysclk, .set_fmt = lm49453_set_dai_fmt, - .digital_mute = lm49453_ls_mute, + .mute_stream = lm49453_ls_mute, }; static const struct snd_soc_dai_ops lm49453_haptic_dai_ops = { .hw_params = lm49453_hw_params, .set_sysclk = lm49453_set_dai_sysclk, .set_fmt = lm49453_set_dai_fmt, - .digital_mute = lm49453_ha_mute, + .mute_stream = lm49453_ha_mute, }; static const struct snd_soc_dai_ops lm49453_ep_dai_ops = { .hw_params = lm49453_hw_params, .set_sysclk = lm49453_set_dai_sysclk, .set_fmt = lm49453_set_dai_fmt, - .digital_mute = lm49453_ep_mute, + .mute_stream = lm49453_ep_mute, }; static const struct snd_soc_dai_ops lm49453_lineout_dai_ops = { .hw_params = lm49453_hw_params, .set_sysclk = lm49453_set_dai_sysclk, .set_fmt = lm49453_set_dai_fmt, - .digital_mute = lm49453_lo_mute, + .mute_stream = lm49453_lo_mute, }; /* LM49453 dai structure. */ diff --git a/sound/soc/codecs/ml26124.c b/sound/soc/codecs/ml26124.c index 55823bc95d06..cbfd3919e31c 100644 --- a/sound/soc/codecs/ml26124.c +++ b/sound/soc/codecs/ml26124.c @@ -372,11 +372,14 @@ static int ml26124_hw_params(struct snd_pcm_substream *substream, return 0; } -static int ml26124_mute(struct snd_soc_dai *dai, int mute) +static int ml26124_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct ml26124_priv *priv = snd_soc_component_get_drvdata(component); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + switch (priv->substream->stream) { case SNDRV_PCM_STREAM_CAPTURE: snd_soc_component_update_bits(component, ML26124_REC_PLYBAK_RUN, BIT(0), 1); @@ -492,7 +495,7 @@ static int ml26124_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops ml26124_dai_ops = { .hw_params = ml26124_hw_params, - .digital_mute = ml26124_mute, + .mute_stream = ml26124_mute, .set_fmt = ml26124_set_dai_fmt, .set_sysclk = ml26124_set_dai_sysclk, }; diff --git a/sound/soc/codecs/nau8822.c b/sound/soc/codecs/nau8822.c index 79928ddeb7a1..9e7937f889cd 100644 --- a/sound/soc/codecs/nau8822.c +++ b/sound/soc/codecs/nau8822.c @@ -900,10 +900,13 @@ static int nau8822_hw_params(struct snd_pcm_substream *substream, return 0; } -static int nau8822_mute(struct snd_soc_dai *dai, int mute) +static int nau8822_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + dev_dbg(component->dev, "%s: %d\n", __func__, mute); if (mute) @@ -967,7 +970,7 @@ static int nau8822_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops nau8822_dai_ops = { .hw_params = nau8822_hw_params, - .digital_mute = nau8822_mute, + .mute_stream = nau8822_mute, .set_fmt = nau8822_set_dai_fmt, .set_sysclk = nau8822_set_dai_sysclk, .set_pll = nau8822_set_pll, diff --git a/sound/soc/codecs/rk3328_codec.c b/sound/soc/codecs/rk3328_codec.c index 115706a55577..7f235d0da3f5 100644 --- a/sound/soc/codecs/rk3328_codec.c +++ b/sound/soc/codecs/rk3328_codec.c @@ -107,12 +107,15 @@ static int rk3328_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) return 0; } -static int rk3328_digital_mute(struct snd_soc_dai *dai, int mute) +static int rk3328_mute(struct snd_soc_dai *dai, int mute, int direction) { struct rk3328_codec_priv *rk3328 = snd_soc_component_get_drvdata(dai->component); unsigned int val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val = HPOUTL_MUTE | HPOUTR_MUTE; else @@ -316,7 +319,7 @@ static void rk3328_pcm_shutdown(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops rk3328_dai_ops = { .hw_params = rk3328_hw_params, .set_fmt = rk3328_set_dai_fmt, - .digital_mute = rk3328_digital_mute, + .mute_stream = rk3328_mute, .startup = rk3328_pcm_startup, .shutdown = rk3328_pcm_shutdown, }; diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index eb08976a7d06..9a87c08caca3 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -775,11 +775,14 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = { }; /* mute the codec used by alsa core */ -static int sgtl5000_digital_mute(struct snd_soc_dai *codec_dai, int mute) +static int sgtl5000_mute(struct snd_soc_dai *codec_dai, int mute, int direction) { struct snd_soc_component *component = codec_dai->component; u16 i2s_pwr = SGTL5000_I2S_IN_POWERUP; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + /* * During 'digital mute' do not mute DAC * because LINE_IN would be muted aswell. We want to mute @@ -1160,7 +1163,7 @@ static int sgtl5000_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops sgtl5000_ops = { .hw_params = sgtl5000_pcm_hw_params, - .digital_mute = sgtl5000_digital_mute, + .mute_stream = sgtl5000_mute, .set_fmt = sgtl5000_set_dai_fmt, .set_sysclk = sgtl5000_set_dai_sysclk, }; diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index 2881a0f7bb39..3bcb55b240df 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c @@ -251,10 +251,13 @@ static int sta529_hw_params(struct snd_pcm_substream *substream, return 0; } -static int sta529_mute(struct snd_soc_dai *dai, int mute) +static int sta529_mute(struct snd_soc_dai *dai, int mute, int direction) { u8 val = 0; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val |= CODEC_MUTE_VAL; @@ -291,7 +294,7 @@ static int sta529_set_dai_fmt(struct snd_soc_dai *codec_dai, u32 fmt) static const struct snd_soc_dai_ops sta529_dai_ops = { .hw_params = sta529_hw_params, .set_fmt = sta529_set_dai_fmt, - .digital_mute = sta529_mute, + .mute_stream = sta529_mute, }; static struct snd_soc_dai_driver sta529_dai = { diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c index abc114a3ae2b..d59a2b1e380c 100644 --- a/sound/soc/codecs/tfa9879.c +++ b/sound/soc/codecs/tfa9879.c @@ -93,10 +93,13 @@ static int tfa9879_hw_params(struct snd_pcm_substream *substream, return 0; } -static int tfa9879_digital_mute(struct snd_soc_dai *dai, int mute) +static int tfa9879_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(component, TFA9879_MISC_CONTROL, TFA9879_S_MUTE_MASK, !!mute << TFA9879_S_MUTE_SHIFT); @@ -251,7 +254,7 @@ static const struct regmap_config tfa9879_regmap = { static const struct snd_soc_dai_ops tfa9879_dai_ops = { .hw_params = tfa9879_hw_params, - .digital_mute = tfa9879_digital_mute, + .mute_stream = tfa9879_mute, .set_fmt = tfa9879_set_fmt, }; diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index f34637afee51..9fead4faa739 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -997,8 +997,11 @@ static void twl6040_mute_path(struct snd_soc_component *component, enum twl6040_ } } -static int twl6040_digital_mute(struct snd_soc_dai *dai, int mute) +static int twl6040_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + switch (dai->id) { case TWL6040_DAI_LEGACY: twl6040_mute_path(dai->component, TWL6040_DAI_DL1, mute); @@ -1020,7 +1023,7 @@ static const struct snd_soc_dai_ops twl6040_dai_ops = { .hw_params = twl6040_hw_params, .prepare = twl6040_prepare, .set_sysclk = twl6040_set_dai_sysclk, - .digital_mute = twl6040_digital_mute, + .mute_stream = twl6040_mute, }; static struct snd_soc_dai_driver twl6040_dai[] = { diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 1cc7f56912dc..a58291581813 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -117,12 +117,15 @@ static inline void uda134x_reset(struct snd_soc_component *component) regmap_update_bits(uda134x->regmap, UDA134X_STATUS0, mask, 0); } -static int uda134x_mute(struct snd_soc_dai *dai, int mute) +static int uda134x_mute(struct snd_soc_dai *dai, int mute, int direction) { struct uda134x_priv *uda134x = snd_soc_component_get_drvdata(dai->component); unsigned int mask = 1<<2; unsigned int val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + pr_debug("%s mute: %d\n", __func__, mute); if (mute) @@ -416,7 +419,7 @@ static const struct snd_soc_dai_ops uda134x_dai_ops = { .startup = uda134x_startup, .shutdown = uda134x_shutdown, .hw_params = uda134x_hw_params, - .digital_mute = uda134x_mute, + .mute_stream = uda134x_mute, .set_sysclk = uda134x_set_dai_sysclk, .set_fmt = uda134x_set_dai_fmt, }; From patchwork Tue Jun 23 01:20: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: 192351 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=-4.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED 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 20801C433DF for ; Wed, 24 Jun 2020 07:59:23 +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 A39542088E for ; Wed, 24 Jun 2020 07:59:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WDl/WQa7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A39542088E 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 (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 3DD72182D; Wed, 24 Jun 2020 09:58:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3DD72182D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985561; bh=4SwFetcor+Y6AMDJCc25LqWZ69zlupe/NwrNSS33Nq0=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WDl/WQa7k9rmhih8tDezPHgGMMzFR1kOAWylyJEhr+8p7gsy4NocRZHZ317hSYhN6 8EHqqxtiUBxC2tBRjj4bNk0qLnBPaIotUqPd0bNyneZasuIC/Wo3f2+jAwg21RJOld KW/6wDIepQhbVH7ywFSjmsSUVSTTyIhPrQTu6KI0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 93876F80343; Wed, 24 Jun 2020 09:49:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 729B3F80162; Tue, 23 Jun 2020 03:20:21 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 75B30F8010D for ; Tue, 23 Jun 2020 03:20:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 75B30F8010D Date: 23 Jun 2020 10:20:14 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50118916" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:14 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 89EEC4001DC8; Tue, 23 Jun 2020 10:20:13 +0900 (JST) Message-ID: <874kr237e8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 08/19] ASoC: codecs: tas*: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/tas2552.c | 7 +++++-- sound/soc/codecs/tas2562.c | 7 +++++-- sound/soc/codecs/tas2770.c | 7 +++++-- sound/soc/codecs/tas571x.c | 7 +++++-- sound/soc/codecs/tas5720.c | 7 +++++-- sound/soc/codecs/tas6424.c | 7 +++++-- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 529c0fb93f9b..32610af4d5e7 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c @@ -465,11 +465,14 @@ static int tas2552_set_dai_tdm_slot(struct snd_soc_dai *dai, return 0; } -static int tas2552_mute(struct snd_soc_dai *dai, int mute) +static int tas2552_mute(struct snd_soc_dai *dai, int mute, int direction) { u8 cfg1_reg = 0; struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) cfg1_reg |= TAS2552_MUTE; @@ -519,7 +522,7 @@ static const struct snd_soc_dai_ops tas2552_speaker_dai_ops = { .set_sysclk = tas2552_set_dai_sysclk, .set_fmt = tas2552_set_dai_fmt, .set_tdm_slot = tas2552_set_dai_tdm_slot, - .digital_mute = tas2552_mute, + .mute_stream = tas2552_mute, }; /* Formats supported by TAS2552 driver. */ diff --git a/sound/soc/codecs/tas2562.c b/sound/soc/codecs/tas2562.c index 7fae88655a0f..c818be9536be 100644 --- a/sound/soc/codecs/tas2562.c +++ b/sound/soc/codecs/tas2562.c @@ -334,10 +334,13 @@ static int tas2562_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) return 0; } -static int tas2562_mute(struct snd_soc_dai *dai, int mute) +static int tas2562_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + return snd_soc_component_update_bits(component, TAS2562_PWR_CTRL, TAS2562_MODE_MASK, mute ? TAS2562_MUTE : 0); @@ -552,7 +555,7 @@ static const struct snd_soc_dai_ops tas2562_speaker_dai_ops = { .hw_params = tas2562_hw_params, .set_fmt = tas2562_set_dai_fmt, .set_tdm_slot = tas2562_set_dai_tdm_slot, - .digital_mute = tas2562_mute, + .mute_stream = tas2562_mute, }; static struct snd_soc_dai_driver tas2562_dai[] = { diff --git a/sound/soc/codecs/tas2770.c b/sound/soc/codecs/tas2770.c index 54c8135fe43c..60ef721fb456 100644 --- a/sound/soc/codecs/tas2770.c +++ b/sound/soc/codecs/tas2770.c @@ -189,11 +189,14 @@ static const struct snd_soc_dapm_route tas2770_audio_map[] = { {"VSENSE", "Switch", "VMON"}, }; -static int tas2770_mute(struct snd_soc_dai *dai, int mute) +static int tas2770_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) ret = snd_soc_component_update_bits(component, TAS2770_PWR_CTRL, @@ -530,7 +533,7 @@ static int tas2770_set_dai_tdm_slot(struct snd_soc_dai *dai, } static struct snd_soc_dai_ops tas2770_dai_ops = { - .digital_mute = tas2770_mute, + .mute_stream = tas2770_mute, .hw_params = tas2770_hw_params, .set_fmt = tas2770_set_fmt, .set_tdm_slot = tas2770_set_dai_tdm_slot, diff --git a/sound/soc/codecs/tas571x.c b/sound/soc/codecs/tas571x.c index 5b7f9fcf6cbf..a65a874fa974 100644 --- a/sound/soc/codecs/tas571x.c +++ b/sound/soc/codecs/tas571x.c @@ -301,12 +301,15 @@ static int tas571x_hw_params(struct snd_pcm_substream *substream, TAS571X_SDI_FMT_MASK, val); } -static int tas571x_mute(struct snd_soc_dai *dai, int mute) +static int tas571x_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; u8 sysctl2; int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + sysctl2 = mute ? TAS571X_SYS_CTRL_2_SDN_MASK : 0; ret = snd_soc_component_update_bits(component, @@ -354,7 +357,7 @@ static int tas571x_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops tas571x_dai_ops = { .set_fmt = tas571x_set_dai_fmt, .hw_params = tas571x_hw_params, - .digital_mute = tas571x_mute, + .mute_stream = tas571x_mute, }; diff --git a/sound/soc/codecs/tas5720.c b/sound/soc/codecs/tas5720.c index e159f839d928..b445f4cf035e 100644 --- a/sound/soc/codecs/tas5720.c +++ b/sound/soc/codecs/tas5720.c @@ -199,11 +199,14 @@ static int tas5720_set_dai_tdm_slot(struct snd_soc_dai *dai, return ret; } -static int tas5720_mute(struct snd_soc_dai *dai, int mute) +static int tas5720_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + ret = snd_soc_component_update_bits(component, TAS5720_DIGITAL_CTRL2_REG, TAS5720_MUTE, mute ? TAS5720_MUTE : 0); if (ret < 0) { @@ -604,7 +607,7 @@ static const struct snd_soc_dai_ops tas5720_speaker_dai_ops = { .hw_params = tas5720_hw_params, .set_fmt = tas5720_set_dai_fmt, .set_tdm_slot = tas5720_set_dai_tdm_slot, - .digital_mute = tas5720_mute, + .mute_stream = tas5720_mute, }; /* diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index aaba39295079..33b97a603a1d 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -252,12 +252,15 @@ static int tas6424_set_dai_tdm_slot(struct snd_soc_dai *dai, return 0; } -static int tas6424_mute(struct snd_soc_dai *dai, int mute) +static int tas6424_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); unsigned int val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + dev_dbg(component->dev, "%s() mute=%d\n", __func__, mute); if (tas6424->mute_gpio) { @@ -382,7 +385,7 @@ static const struct snd_soc_dai_ops tas6424_speaker_dai_ops = { .hw_params = tas6424_hw_params, .set_fmt = tas6424_set_dai_fmt, .set_tdm_slot = tas6424_set_dai_tdm_slot, - .digital_mute = tas6424_mute, + .mute_stream = tas6424_mute, }; static struct snd_soc_dai_driver tas6424_dai[] = { From patchwork Tue Jun 23 01:20:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192350 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=-4.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED 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 ED79BC433DF for ; Wed, 24 Jun 2020 08:00:29 +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 772432088E for ; Wed, 24 Jun 2020 08:00:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Ran6ms+w" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 772432088E 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 (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 106B81822; Wed, 24 Jun 2020 09:59:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 106B81822 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985628; bh=CgTRV2ZBPAlZSaP9P+b4nbPEKqAXsDJ28KCD9miw1Yo=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ran6ms+wxaRf0ynbOjb7KqTBxsKeUGuVKoQMgIHoPWeHoCn1pKriTldAtp90DCrLN ArsawYmd0GTveCN0lYio8HhSVh6DuyLYSFjWBxnYZb4ssiq95gCTbtz70Yzy5acuJq 7oyYqPUgfKB4KxxNihzZFaU4H5PaT7Gw0VBLuEoU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E1C75F80348; Wed, 24 Jun 2020 09:49:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1F04EF80162; Tue, 23 Jun 2020 03:20:35 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id DC775F8015A for ; Tue, 23 Jun 2020 03:20:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DC775F8015A Date: 23 Jun 2020 10:20:24 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50329454" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:24 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 542114001DB1; Tue, 23 Jun 2020 10:20:24 +0900 (JST) Message-ID: <871rm637dy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 10/19] ASoC: codecs: pcm*: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/pcm1681.c | 7 +++++-- sound/soc/codecs/pcm1789.c | 7 +++++-- sound/soc/codecs/pcm179x.c | 7 +++++-- sound/soc/codecs/pcm3168a.c | 7 +++++-- sound/soc/codecs/pcm512x.c | 7 +++++-- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c index 4767e158cd5e..0f641d29b8b3 100644 --- a/sound/soc/codecs/pcm1681.c +++ b/sound/soc/codecs/pcm1681.c @@ -147,12 +147,15 @@ static int pcm1681_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; } -static int pcm1681_digital_mute(struct snd_soc_dai *dai, int mute) +static int pcm1681_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct pcm1681_private *priv = snd_soc_component_get_drvdata(component); int val; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) val = PCM1681_SOFT_MUTE_ALL; else @@ -205,7 +208,7 @@ static int pcm1681_hw_params(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops pcm1681_dai_ops = { .set_fmt = pcm1681_set_dai_fmt, .hw_params = pcm1681_hw_params, - .digital_mute = pcm1681_digital_mute, + .mute_stream = pcm1681_mute, }; static const struct snd_soc_dapm_widget pcm1681_dapm_widgets[] = { diff --git a/sound/soc/codecs/pcm1789.c b/sound/soc/codecs/pcm1789.c index 8df6447c76a6..eb887802c6d0 100644 --- a/sound/soc/codecs/pcm1789.c +++ b/sound/soc/codecs/pcm1789.c @@ -60,11 +60,14 @@ static int pcm1789_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; } -static int pcm1789_digital_mute(struct snd_soc_dai *codec_dai, int mute) +static int pcm1789_mute(struct snd_soc_dai *codec_dai, int mute, int direction) { struct snd_soc_component *component = codec_dai->component; struct pcm1789_private *priv = snd_soc_component_get_drvdata(component); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + return regmap_update_bits(priv->regmap, PCM1789_SOFT_MUTE, PCM1789_MUTE_MASK, mute ? 0 : PCM1789_MUTE_MASK); @@ -167,7 +170,7 @@ static int pcm1789_trigger(struct snd_pcm_substream *substream, int cmd, static const struct snd_soc_dai_ops pcm1789_dai_ops = { .set_fmt = pcm1789_set_dai_fmt, .hw_params = pcm1789_hw_params, - .digital_mute = pcm1789_digital_mute, + .mute_stream = pcm1789_mute, .trigger = pcm1789_trigger, }; diff --git a/sound/soc/codecs/pcm179x.c b/sound/soc/codecs/pcm179x.c index 9e70b7385c69..cc944250ad71 100644 --- a/sound/soc/codecs/pcm179x.c +++ b/sound/soc/codecs/pcm179x.c @@ -76,12 +76,15 @@ static int pcm179x_set_dai_fmt(struct snd_soc_dai *codec_dai, return 0; } -static int pcm179x_digital_mute(struct snd_soc_dai *dai, int mute) +static int pcm179x_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct pcm179x_private *priv = snd_soc_component_get_drvdata(component); int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + ret = regmap_update_bits(priv->regmap, PCM179X_SOFT_MUTE, PCM179X_MUTE_MASK, !!mute); if (ret < 0) @@ -145,7 +148,7 @@ static int pcm179x_hw_params(struct snd_pcm_substream *substream, static const struct snd_soc_dai_ops pcm179x_dai_ops = { .set_fmt = pcm179x_set_dai_fmt, .hw_params = pcm179x_hw_params, - .digital_mute = pcm179x_digital_mute, + .mute_stream = pcm179x_mute, }; static const DECLARE_TLV_DB_SCALE(pcm179x_dac_tlv, -12000, 50, 1); diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index 9711fab296eb..e9756c45e15d 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -290,11 +290,14 @@ static int pcm3168a_reset(struct pcm3168a_priv *pcm3168a) PCM3168A_MRST_MASK | PCM3168A_SRST_MASK); } -static int pcm3168a_digital_mute(struct snd_soc_dai *dai, int mute) +static int pcm3168a_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component); + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + regmap_write(pcm3168a->regmap, PCM3168A_DAC_MUTE, mute ? 0xff : 0); return 0; @@ -570,7 +573,7 @@ static const struct snd_soc_dai_ops pcm3168a_dai_ops = { .set_fmt = pcm3168a_set_dai_fmt, .set_sysclk = pcm3168a_set_dai_sysclk, .hw_params = pcm3168a_hw_params, - .digital_mute = pcm3168a_digital_mute, + .mute_stream = pcm3168a_mute, .set_tdm_slot = pcm3168a_set_tdm_slot, }; diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c index 4cbef9affffd..5a82a59d6336 100644 --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c @@ -1394,13 +1394,16 @@ static int pcm512x_set_bclk_ratio(struct snd_soc_dai *dai, unsigned int ratio) return 0; } -static int pcm512x_digital_mute(struct snd_soc_dai *dai, int mute) +static int pcm512x_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component); int ret; unsigned int mute_det; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + mutex_lock(&pcm512x->mutex); if (mute) { @@ -1445,7 +1448,7 @@ static const struct snd_soc_dai_ops pcm512x_dai_ops = { .startup = pcm512x_dai_startup, .hw_params = pcm512x_hw_params, .set_fmt = pcm512x_set_fmt, - .digital_mute = pcm512x_digital_mute, + .mute_stream = pcm512x_mute, .set_bclk_ratio = pcm512x_set_bclk_ratio, }; From patchwork Tue Jun 23 01:20:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192349 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=-4.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED 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 BFCC9C433DF for ; Wed, 24 Jun 2020 08:01:32 +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 4ACB820DD4 for ; Wed, 24 Jun 2020 08:01:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="oE5mPMyd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4ACB820DD4 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 (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 C9C7F1843; Wed, 24 Jun 2020 10:00:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C9C7F1843 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985690; bh=o5zhxYsQKPEEJnQl2JUGDpqVP3t1ZQfsistcPwWdJpk=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=oE5mPMydwRPxMa1yZXCOVod0g2zMNiM+N3nPN66P+k8irSf9D68BIOe+zA1uTLNeo xY/QOj7RKgJda9WM/8leqygYU2Lj1TvbPelgK8XfzKXQCLBSrt2vN0cgV+Btrs6QvY yMAfi00wpuSUBJTeLYkQMz6m1ZWe0i4riq4Slsjc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 08DC1F8035F; Wed, 24 Jun 2020 09:50:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3A6F3F801DB; Tue, 23 Jun 2020 03:20:46 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id 48A04F8015B for ; Tue, 23 Jun 2020 03:20:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48A04F8015B Date: 23 Jun 2020 10:20:38 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50329473" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:38 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 890584001DC8; Tue, 23 Jun 2020 10:20:37 +0900 (JST) Message-ID: <87y2oe1st4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 12/19] ASoC: codecs: alc*: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/alc5623.c | 7 +++++-- sound/soc/codecs/alc5632.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index c70c49bb4a3e..de7cabaa211c 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c @@ -737,12 +737,15 @@ static int alc5623_pcm_hw_params(struct snd_pcm_substream *substream, return 0; } -static int alc5623_mute(struct snd_soc_dai *dai, int mute) +static int alc5623_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; u16 hp_mute = ALC5623_MISC_M_DAC_L_INPUT | ALC5623_MISC_M_DAC_R_INPUT; u16 mute_reg = snd_soc_component_read(component, ALC5623_MISC_CTRL) & ~hp_mute; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) mute_reg |= hp_mute; @@ -829,7 +832,7 @@ static int alc5623_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops alc5623_dai_ops = { .hw_params = alc5623_pcm_hw_params, - .digital_mute = alc5623_mute, + .mute_stream = alc5623_mute, .set_fmt = alc5623_set_dai_fmt, .set_sysclk = alc5623_set_dai_sysclk, .set_pll = alc5623_set_dai_pll, diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index f49543163f69..f90bd77438b8 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c @@ -902,13 +902,16 @@ static int alc5632_pcm_hw_params(struct snd_pcm_substream *substream, return 0; } -static int alc5632_mute(struct snd_soc_dai *dai, int mute) +static int alc5632_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; u16 hp_mute = ALC5632_MISC_HP_DEPOP_MUTE_L |ALC5632_MISC_HP_DEPOP_MUTE_R; u16 mute_reg = snd_soc_component_read(component, ALC5632_MISC_CTRL) & ~hp_mute; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) mute_reg |= hp_mute; @@ -1005,7 +1008,7 @@ static int alc5632_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops alc5632_dai_ops = { .hw_params = alc5632_pcm_hw_params, - .digital_mute = alc5632_mute, + .mute_stream = alc5632_mute, .set_fmt = alc5632_set_dai_fmt, .set_sysclk = alc5632_set_dai_sysclk, .set_pll = alc5632_set_dai_pll, From patchwork Tue Jun 23 01:20:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192348 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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 5CB80C433E0 for ; Wed, 24 Jun 2020 08:02:41 +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 DDFAC20FC3 for ; Wed, 24 Jun 2020 08:02:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WxrOvIWy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DDFAC20FC3 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 (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 5E3A61846; Wed, 24 Jun 2020 10:01:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5E3A61846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985759; bh=MSw9CUCjVn+3Qoq5CW6dQIqIMQ+qyPCTVXbkIWPfOn0=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WxrOvIWyAg33G/OQEaqddwxvWqfVY5CDmB5c/C/r46TXbR2vmHcNbchi3zXCe4/Dh CelXNsdZ3Ah1moV9fRDMPjEjmlgTE8VnlZbMd8J+NSQDZY+ZpLqtScWOelAnc/j0++ QurBnlBn8FXWD17AWTrzyk+a4i48mNnGKQIk91i4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D5B82F8036A; Wed, 24 Jun 2020 09:50:03 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 895A1F8015B; Tue, 23 Jun 2020 03:20:52 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 45B67F8015A for ; Tue, 23 Jun 2020 03:20:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 45B67F8015A Date: 23 Jun 2020 10:20:48 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50118976" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:48 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 52737418450A; Tue, 23 Jun 2020 10:20:48 +0900 (JST) Message-ID: <87v9ji1ssu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 14/19] ASoC: codecs: es*: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/es8316.c | 7 +++++-- sound/soc/codecs/es8328.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c index 36eef1fb3d18..6e0066fc9e26 100644 --- a/sound/soc/codecs/es8316.c +++ b/sound/soc/codecs/es8316.c @@ -507,8 +507,11 @@ static int es8316_pcm_hw_params(struct snd_pcm_substream *substream, return 0; } -static int es8316_mute(struct snd_soc_dai *dai, int mute) +static int es8316_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + snd_soc_component_update_bits(dai->component, ES8316_DAC_SET1, 0x20, mute ? 0x20 : 0); return 0; @@ -522,7 +525,7 @@ static const struct snd_soc_dai_ops es8316_ops = { .hw_params = es8316_pcm_hw_params, .set_fmt = es8316_set_dai_fmt, .set_sysclk = es8316_set_dai_sysclk, - .digital_mute = es8316_mute, + .mute_stream = es8316_mute, }; static struct snd_soc_dai_driver es8316_dai = { diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index fdf64c29f563..b8ac7b31e2b9 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -449,8 +449,11 @@ static const struct snd_soc_dapm_route es8328_dapm_routes[] = { { "ROUT2", NULL, "Right Out 2" }, }; -static int es8328_mute(struct snd_soc_dai *dai, int mute) +static int es8328_mute(struct snd_soc_dai *dai, int mute, int direction) { + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + return snd_soc_component_update_bits(dai->component, ES8328_DACCONTROL3, ES8328_DACCONTROL3_DACMUTE, mute ? ES8328_DACCONTROL3_DACMUTE : 0); @@ -692,7 +695,7 @@ static int es8328_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops es8328_dai_ops = { .startup = es8328_startup, .hw_params = es8328_hw_params, - .digital_mute = es8328_mute, + .mute_stream = es8328_mute, .set_sysclk = es8328_set_sysclk, .set_fmt = es8328_set_dai_fmt, }; From patchwork Tue Jun 23 01:20:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192347 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=-4.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNWANTED_LANGUAGE_BODY, URIBL_BLOCKED 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 AA75FC433E0 for ; Wed, 24 Jun 2020 08:03:45 +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 34E1020DD4 for ; Wed, 24 Jun 2020 08:03:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="QjQ4s4tG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34E1020DD4 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 (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 C0346184C; Wed, 24 Jun 2020 10:02:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C0346184C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985823; bh=7ZFS20Q6logQXKqWc3Zs7rbpi7HU02BwC0xL5PZLxt8=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=QjQ4s4tGFW6ahLmvt5UnYmYaFW2HsZV3t0TxESxQtqp6kahA6ekwcbBp2JcWNm9DL J7DY/5bwrWTtSW6Q7suU4hh/f7i/vlnZt37yPv5SFZjD+buzUPbUTBRg21TQJtD4zj Xke9nWP2Z+lPwHuvpM7nys17U6tqMExvncbWZr7A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5A1B6F80372; Wed, 24 Jun 2020 09:50:07 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4B329F8015B; Tue, 23 Jun 2020 03:21:04 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 0DC7FF8015A for ; Tue, 23 Jun 2020 03:20:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0DC7FF8015A Date: 23 Jun 2020 10:20:59 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50118990" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:20:59 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 1ED024184514; Tue, 23 Jun 2020 10:20:59 +0900 (JST) Message-ID: <87sgem1ssj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 16/19] ASoC: codecs: cs*: merge .digital_mute() into .mute_stream() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 snd_soc_dai_digital_mute() is internally using both mute_stream() (1) or digital_mute() (2), but the difference between these 2 are only handling direction. We can merge digital_mute() into mute_stream int snd_soc_dai_digital_mute(xxx, int direction) { ... else if (dai->driver->ops->mute_stream) (1) return dai->driver->ops->mute_stream(xxx, direction); else if (direction == SNDRV_PCM_STREAM_PLAYBACK && dai->driver->ops->digital_mute) (2) return dai->driver->ops->digital_mute(xxx); ... } Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/cs4265.c | 7 +++++-- sound/soc/codecs/cs4270.c | 7 +++++-- sound/soc/codecs/cs42l42.c | 7 +++++-- sound/soc/codecs/cs42l51.c | 7 +++++-- sound/soc/codecs/cs42l52.c | 7 +++++-- sound/soc/codecs/cs42l56.c | 7 +++++-- sound/soc/codecs/cs42xx8.c | 7 +++++-- sound/soc/codecs/cs4341.c | 7 +++++-- sound/soc/codecs/cs4349.c | 7 +++++-- 9 files changed, 45 insertions(+), 18 deletions(-) diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 2fb65f246b0c..06182df8948a 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -378,10 +378,13 @@ static int cs4265_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } -static int cs4265_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs4265_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) { snd_soc_component_update_bits(component, CS4265_DAC_CTL, CS4265_DAC_CTL_MUTE, @@ -498,7 +501,7 @@ static int cs4265_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops cs4265_ops = { .hw_params = cs4265_pcm_hw_params, - .digital_mute = cs4265_digital_mute, + .mute_stream = cs4265_mute, .set_fmt = cs4265_set_fmt, .set_sysclk = cs4265_set_sysclk, }; diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 3e8dabc14f05..3c45406339f4 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -406,12 +406,15 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream, * board does not have the MUTEA or MUTEB pins connected to such circuitry, * then this function will do nothing. */ -static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute) +static int cs4270_dai_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct cs4270_private *cs4270 = snd_soc_component_get_drvdata(component); int reg6; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + reg6 = snd_soc_component_read(component, CS4270_MUTE); if (mute) @@ -471,7 +474,7 @@ static const struct snd_soc_dai_ops cs4270_dai_ops = { .hw_params = cs4270_hw_params, .set_sysclk = cs4270_set_dai_sysclk, .set_fmt = cs4270_set_dai_fmt, - .digital_mute = cs4270_dai_mute, + .mute_stream = cs4270_dai_mute, }; static struct snd_soc_dai_driver cs4270_dai = { diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 3bc2fa229ef3..4ef52eae1999 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -849,12 +849,15 @@ static int cs42l42_set_sysclk(struct snd_soc_dai *dai, return 0; } -static int cs42l42_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs42l42_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; unsigned int regval; u8 fullScaleVol; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) { /* Mark SCLK as not present to turn on the internal * oscillator. @@ -909,7 +912,7 @@ static const struct snd_soc_dai_ops cs42l42_ops = { .hw_params = cs42l42_pcm_hw_params, .set_fmt = cs42l42_set_dai_fmt, .set_sysclk = cs42l42_set_sysclk, - .digital_mute = cs42l42_digital_mute + .mute_stream = cs42l42_mute }; static struct snd_soc_dai_driver cs42l42_dai = { diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c index dde9812490de..b419a578968e 100644 --- a/sound/soc/codecs/cs42l51.c +++ b/sound/soc/codecs/cs42l51.c @@ -484,12 +484,15 @@ static int cs42l51_hw_params(struct snd_pcm_substream *substream, return 0; } -static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute) +static int cs42l51_dai_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; int reg; int mask = CS42L51_DAC_OUT_CTL_DACA_MUTE|CS42L51_DAC_OUT_CTL_DACB_MUTE; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + reg = snd_soc_component_read(component, CS42L51_DAC_OUT_CTL); if (mute) @@ -511,7 +514,7 @@ static const struct snd_soc_dai_ops cs42l51_dai_ops = { .hw_params = cs42l51_hw_params, .set_sysclk = cs42l51_set_dai_sysclk, .set_fmt = cs42l51_set_dai_fmt, - .digital_mute = cs42l51_dai_mute, + .mute_stream = cs42l51_dai_mute, }; static struct snd_soc_dai_driver cs42l51_dai = { diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index 2ea4cba3be2a..7d2a77b3114b 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c @@ -784,10 +784,13 @@ static int cs42l52_set_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } -static int cs42l52_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs42l52_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) snd_soc_component_update_bits(component, CS42L52_PB_CTL1, CS42L52_PB_CTL1_MUTE_MASK, @@ -865,7 +868,7 @@ static int cs42l52_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops cs42l52_ops = { .hw_params = cs42l52_pcm_hw_params, - .digital_mute = cs42l52_digital_mute, + .mute_stream = cs42l52_mute, .set_fmt = cs42l52_set_fmt, .set_sysclk = cs42l52_set_sysclk, }; diff --git a/sound/soc/codecs/cs42l56.c b/sound/soc/codecs/cs42l56.c index ac569ab3d30f..77749849cf8f 100644 --- a/sound/soc/codecs/cs42l56.c +++ b/sound/soc/codecs/cs42l56.c @@ -800,10 +800,13 @@ static int cs42l56_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return 0; } -static int cs42l56_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs42l56_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + if (mute) { /* Hit the DSP Mixer first */ snd_soc_component_update_bits(component, CS42L56_DSP_MUTE_CTL, @@ -929,7 +932,7 @@ static int cs42l56_set_bias_level(struct snd_soc_component *component, static const struct snd_soc_dai_ops cs42l56_ops = { .hw_params = cs42l56_pcm_hw_params, - .digital_mute = cs42l56_digital_mute, + .mute_stream = cs42l56_mute, .set_fmt = cs42l56_set_dai_fmt, .set_sysclk = cs42l56_set_sysclk, }; diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index 94b1adb088fd..b08d44794cdb 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c @@ -362,13 +362,16 @@ static int cs42xx8_hw_free(struct snd_pcm_substream *substream, return 0; } -static int cs42xx8_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs42xx8_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); u8 dac_unmute = cs42xx8->tx_channels ? ~((0x1 << cs42xx8->tx_channels) - 1) : 0; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + regmap_write(cs42xx8->regmap, CS42XX8_DACMUTE, mute ? CS42XX8_DACMUTE_ALL : dac_unmute); @@ -380,7 +383,7 @@ static const struct snd_soc_dai_ops cs42xx8_dai_ops = { .set_sysclk = cs42xx8_set_dai_sysclk, .hw_params = cs42xx8_hw_params, .hw_free = cs42xx8_hw_free, - .digital_mute = cs42xx8_digital_mute, + .mute_stream = cs42xx8_mute, }; static struct snd_soc_dai_driver cs42xx8_dai = { diff --git a/sound/soc/codecs/cs4341.c b/sound/soc/codecs/cs4341.c index ade7477d04f1..a47ad98eafd6 100644 --- a/sound/soc/codecs/cs4341.c +++ b/sound/soc/codecs/cs4341.c @@ -116,11 +116,14 @@ static int cs4341_hw_params(struct snd_pcm_substream *substream, CS4341_MODE2_DIF, mode); } -static int cs4341_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs4341_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; int ret; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + ret = snd_soc_component_update_bits(component, CS4341_REG_VOLA, CS4341_VOLX_MUTE, mute ? CS4341_VOLX_MUTE : 0); @@ -174,7 +177,7 @@ static const struct snd_kcontrol_new cs4341_controls[] = { static const struct snd_soc_dai_ops cs4341_dai_ops = { .set_fmt = cs4341_set_fmt, .hw_params = cs4341_hw_params, - .digital_mute = cs4341_digital_mute, + .mute_stream = cs4341_mute, }; static struct snd_soc_dai_driver cs4341_dai = { diff --git a/sound/soc/codecs/cs4349.c b/sound/soc/codecs/cs4349.c index 3381209a882d..208a94dd4eed 100644 --- a/sound/soc/codecs/cs4349.c +++ b/sound/soc/codecs/cs4349.c @@ -131,11 +131,14 @@ static int cs4349_pcm_hw_params(struct snd_pcm_substream *substream, return 0; } -static int cs4349_digital_mute(struct snd_soc_dai *dai, int mute) +static int cs4349_mute(struct snd_soc_dai *dai, int mute, int direction) { struct snd_soc_component *component = dai->component; int reg; + if (direction != SNDRV_PCM_STREAM_PLAYBACK) + return 0; + reg = 0; if (mute) reg = MUTE_AB_MASK; @@ -236,7 +239,7 @@ static const struct snd_soc_dapm_route cs4349_routes[] = { static const struct snd_soc_dai_ops cs4349_dai_ops = { .hw_params = cs4349_pcm_hw_params, .set_fmt = cs4349_set_dai_fmt, - .digital_mute = cs4349_digital_mute, + .mute_stream = cs4349_mute, }; static struct snd_soc_dai_driver cs4349_dai = { From patchwork Tue Jun 23 01:21:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 192346 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=-7.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 148EDC433E0 for ; Wed, 24 Jun 2020 08:04:47 +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 944BD20FC3 for ; Wed, 24 Jun 2020 08:04:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="P36FOpkS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 944BD20FC3 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 (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 2EC3E1800; Wed, 24 Jun 2020 10:03:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2EC3E1800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1592985885; bh=QAwj8N81fFmTwJFwRH2P4jAZ0iSvyJDoHg35tx42lDQ=; h=Date:From:Subject:To:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=P36FOpkSlj1GKYR7nhoLC2fvfEvy4r9Mot/VtRiSuKmOavKQh00z75d60oYRO44ns tcpE9o0TlPT/huaRrTyazEnBd8A/vIpqIT/3CkPcEXuD1ydZastEfEpke468iB//Ik SR4iVQlJpQSYNz2xUXNdYIH1aZJII8sLCoP37kYA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C6F87F80385; Wed, 24 Jun 2020 09:50:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 37617F8015B; Tue, 23 Jun 2020 03:21:18 +0200 (CEST) Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by alsa1.perex.cz (Postfix) with ESMTP id 2C55EF80157 for ; Tue, 23 Jun 2020 03:21:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C55EF80157 Date: 23 Jun 2020 10:21:09 +0900 X-IronPort-AV: E=Sophos;i="5.75,268,1589209200"; d="scan'208";a="50119025" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 23 Jun 2020 10:21:09 +0900 Received: from mercury.renesas.com (unknown [10.166.252.133]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 71B8841846B1; Tue, 23 Jun 2020 10:21:09 +0900 (JST) Message-ID: <87pn9q1ss8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 18/19] ASoC: soc-dai: remove .digital_mute User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> References: <87ftam37ko.wl-kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-Mailman-Approved-At: Wed, 24 Jun 2020 09:49:29 +0200 Cc: Shengjiu Wang , Linux-ALSA , Michael Walle , =?iso-8859-1?q?=22Heiko_St=FCbner?= =?iso-8859-1?q?=22?= , Neil Armstrong , David Airlie , =?iso-8859-2?q?=22Micha=B3_Miros=B3a?= =?iso-8859-2?q?w=22?= , Jonghwan Choi , Alexandre Belloni , Paul Cercueil , Andrzej Hajda , Frank Shi , Laurent Pinchart , Benjamin Gaignard , "Andrew F. Davis" , Fabio Estevam , Jerome Brunet , Nikita Yushchenko , Pierre-Louis Bossart , Lars-Peter Clausen , Joonyoung Shim , Matthias Reichl , Katsuhiro Suzuki , Kevin Hilman , Kai Vehmanen , Takashi Iwai , YueHaibing , Russell King , Krzysztof Kozlowski , Daniel Drake , Tzung-Bi Shih , Ludovic Desroches , Kukjin Kim , Ranjani Sridharan , Dinghao Liu , Codrin Ciubotariu , Cheng-Yi Chiang , Chun-Kuang Hu , Bartosz Golaszewski , Charles Keepax , Philipp Zabel , Jonas Karlman , Liam Girdwood , Nicolas Ferre , Chuhong Yuan , Robin Murphy , James Schulman , Inki Dae , Masahiro Yamada , Christophe JAILLET , Dan Murphy , Matthias Brugger , =?iso-8859-1?q?=22Nuno_S=E1=22?= , Vincent Abriou , Peter Ujfalusi , Jernej Skrabec , Support Opensource , Marek Szyprowski , Jason Yan , Stephen Boyd , Pankaj Bharadiya , David Rhodes , Seung-Woo Kim , Sandy Huang , Pavel Dobias , Philipp Puschmann , Kyungmin Park , Vishwas A Deshpande , Daniel Vetter , Colin Ian King , Kevin Cernekee , Lucas Stach , Shawn Guo , Peter Rosin , M R Swami Reddy 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 All drivers are now using .mute_stream. Let's remove .digital_mute. Signed-off-by: Kuninori Morimoto --- include/sound/soc-dai.h | 1 - sound/soc/soc-dai.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 212257e84fac..a3db208cd062 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -246,7 +246,6 @@ struct snd_soc_dai_ops { * DAI digital mute - optional. * Called by soc-core to minimise any pops. */ - int (*digital_mute)(struct snd_soc_dai *dai, int mute); int (*mute_stream)(struct snd_soc_dai *dai, int mute, int stream); /* diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index b05e18b63a1c..b0fc3d8b1798 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -301,10 +301,6 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, if (dai->driver->ops && dai->driver->ops->mute_stream) ret = dai->driver->ops->mute_stream(dai, mute, direction); - else if (direction == SNDRV_PCM_STREAM_PLAYBACK && - dai->driver->ops && - dai->driver->ops->digital_mute) - ret = dai->driver->ops->digital_mute(dai, mute); return soc_dai_ret(dai, ret); }