From patchwork Sun Oct 29 16:57:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13439832 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 630C5C4332F for ; Sun, 29 Oct 2023 16:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229529AbjJ2Q6E (ORCPT ); Sun, 29 Oct 2023 12:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbjJ2Q6C (ORCPT ); Sun, 29 Oct 2023 12:58:02 -0400 Received: from srv01.abscue.de (abscue.de [IPv6:2a03:4000:63:bf5:4817:8eff:feeb:8ac7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AABEC2 for ; Sun, 29 Oct 2023 09:57:54 -0700 (PDT) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 9CE301C258E; Sun, 29 Oct 2023 17:57:51 +0100 (CET) Received: from fluffy-mammal.fritz.box (dslb-088-078-198-137.088.078.pools.vodafone-ip.de [88.78.198.137]) by srv01.abscue.de (Postfix) with ESMTPSA id 3E6821C2590; Sun, 29 Oct 2023 17:57:51 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: linux-arm-msm@vger.kernel.org Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , linux-sound@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Otto_Pfl=C3=BCger?= Subject: [PATCH v2 1/4] ASoC: qcom: q6core: expose ADSP core firmware version Date: Sun, 29 Oct 2023 17:57:13 +0100 Message-Id: <20231029165716.69878-2-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231029165716.69878-1-otto.pflueger@abscue.de> References: <20231029165716.69878-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add a q6core_get_adsp_version() function that returns the version of the ADSP firmware (2.6, 2.7 or 2.8), also known as the AVS version (see [1] in downstream kernel). Some APIs differ between these versions, e.g. the AFE clock APIs. [1]: https://github.com/msm8916-mainline/linux-downstream/blob/LA.BR.1.2.9.1_rb1.5/sound/soc/msm/qdsp6v2/q6core.c#L193 Signed-off-by: Otto Pflüger --- sound/soc/qcom/qdsp6/q6core.c | 65 +++++++++++++++++++++++++++++++++++ sound/soc/qcom/qdsp6/q6core.h | 9 +++++ 2 files changed, 74 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6core.c b/sound/soc/qcom/qdsp6/q6core.c index 49cfb32cd209..855ab4ff1e59 100644 --- a/sound/soc/qcom/qdsp6/q6core.c +++ b/sound/soc/qcom/qdsp6/q6core.c @@ -20,6 +20,9 @@ #define AVCS_CMDRSP_ADSP_EVENT_GET_STATE 0x0001290D #define AVCS_GET_VERSIONS 0x00012905 #define AVCS_GET_VERSIONS_RSP 0x00012906 +#define AVCS_CMDRSP_Q6_ID_2_6 0x00040000 +#define AVCS_CMDRSP_Q6_ID_2_7 0x00040001 +#define AVCS_CMDRSP_Q6_ID_2_8 0x00040002 #define AVCS_CMD_GET_FWK_VERSION 0x001292c #define AVCS_CMDRSP_GET_FWK_VERSION 0x001292d @@ -63,6 +66,7 @@ struct q6core { bool get_state_supported; bool get_version_supported; bool is_version_requested; + enum q6core_version adsp_version; }; static struct q6core *g_core; @@ -108,6 +112,14 @@ static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data) if (!core->fwk_version) return -ENOMEM; + /* + * Since GET_VERSIONS is not called when GET_FWK_VERSION + * is successful and these commands may return completely + * different versions, assume that the version is 2.8 here. + * Older versions do not support GET_FWK_VERSION and we do + * not care if the version is newer than 2.8. + */ + core->adsp_version = Q6_ADSP_VERSION_2_8; core->fwk_version_supported = true; core->resp_received = true; @@ -115,6 +127,7 @@ static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data) } case AVCS_GET_VERSIONS_RSP: { struct avcs_cmdrsp_get_version *v; + int i; v = data->payload; @@ -125,6 +138,32 @@ static int q6core_callback(struct apr_device *adev, struct apr_resp_pkt *data) if (!core->svc_version) return -ENOMEM; + for (i = 0; i < g_core->svc_version->num_services; i++) { + struct avcs_svc_info *info; + + info = &g_core->svc_version->svc_api_info[i]; + if (info->service_id != APR_SVC_ADSP_CORE) + continue; + + switch (info->version) { + case AVCS_CMDRSP_Q6_ID_2_6: + core->adsp_version = Q6_ADSP_VERSION_2_6; + break; + case AVCS_CMDRSP_Q6_ID_2_7: + core->adsp_version = Q6_ADSP_VERSION_2_7; + break; + case AVCS_CMDRSP_Q6_ID_2_8: + core->adsp_version = Q6_ADSP_VERSION_2_8; + break; + default: + dev_err(&adev->dev, "Unknown AVS version 0x%08x\n", + info->version); + break; + } + + break; + } + core->get_version_supported = true; core->resp_received = true; @@ -293,6 +332,31 @@ int q6core_get_svc_api_info(int svc_id, struct q6core_svc_api_info *ainfo) } EXPORT_SYMBOL_GPL(q6core_get_svc_api_info); +/** + * q6core_get_adsp_version() - Get the core version number. + * + * Return: version code or Q6_ADSP_VERSION_UNKNOWN on failure + */ +enum q6core_version q6core_get_adsp_version(void) +{ + int ret; + + if (!g_core) + return Q6_ADSP_VERSION_UNKNOWN; + + mutex_lock(&g_core->lock); + if (!g_core->is_version_requested) { + if (q6core_get_fwk_versions(g_core) == -ENOTSUPP) + q6core_get_svc_versions(g_core); + g_core->is_version_requested = true; + } + ret = g_core->adsp_version; + mutex_unlock(&g_core->lock); + + return ret; +} +EXPORT_SYMBOL_GPL(q6core_get_adsp_version); + /** * q6core_is_adsp_ready() - Get status of adsp * @@ -334,6 +398,7 @@ static int q6core_probe(struct apr_device *adev) dev_set_drvdata(&adev->dev, g_core); mutex_init(&g_core->lock); + g_core->adsp_version = Q6_ADSP_VERSION_UNKNOWN; g_core->adev = adev; init_waitqueue_head(&g_core->wait); return 0; diff --git a/sound/soc/qcom/qdsp6/q6core.h b/sound/soc/qcom/qdsp6/q6core.h index 4105b1d730be..472e06bf8efc 100644 --- a/sound/soc/qcom/qdsp6/q6core.h +++ b/sound/soc/qcom/qdsp6/q6core.h @@ -9,7 +9,16 @@ struct q6core_svc_api_info { uint32_t api_branch_version; }; +/* Versions must be in order! */ +enum q6core_version { + Q6_ADSP_VERSION_UNKNOWN, + Q6_ADSP_VERSION_2_6, + Q6_ADSP_VERSION_2_7, + Q6_ADSP_VERSION_2_8, +}; + bool q6core_is_adsp_ready(void); +enum q6core_version q6core_get_adsp_version(void); int q6core_get_svc_api_info(int svc_id, struct q6core_svc_api_info *ainfo); #endif /* __Q6CORE_H__ */ From patchwork Sun Oct 29 16:57:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13439833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFE55C001B0 for ; Sun, 29 Oct 2023 16:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbjJ2Q6F (ORCPT ); Sun, 29 Oct 2023 12:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229795AbjJ2Q6C (ORCPT ); Sun, 29 Oct 2023 12:58:02 -0400 Received: from srv01.abscue.de (abscue.de [IPv6:2a03:4000:63:bf5:4817:8eff:feeb:8ac7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7EBCC1 for ; Sun, 29 Oct 2023 09:57:54 -0700 (PDT) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 9F2C01C2591; Sun, 29 Oct 2023 17:57:52 +0100 (CET) Received: from fluffy-mammal.fritz.box (dslb-088-078-198-137.088.078.pools.vodafone-ip.de [88.78.198.137]) by srv01.abscue.de (Postfix) with ESMTPSA id 524F61C2590; Sun, 29 Oct 2023 17:57:52 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: linux-arm-msm@vger.kernel.org Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , linux-sound@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Otto_Pfl=C3=BCger?= Subject: [PATCH v2 2/4] ASoC: qcom: q6afe: provide fallback for digital codec clock Date: Sun, 29 Oct 2023 17:57:14 +0100 Message-Id: <20231029165716.69878-3-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231029165716.69878-1-otto.pflueger@abscue.de> References: <20231029165716.69878-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org When q6afe is used as a clock provider through q6afe-clocks.c, it uses an interface for setting clocks that is not present in older firmware versions. However, using Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE as the codec MCLK in the device tree can be useful on older platforms too. Provide a fallback that sets this clock using the old method when an old firmware version is detected. MSM8916 did not need this because of a workaround that controls this clock directly through the GCC driver, but newer SoCs do not have this clock in their GCC drivers because it is meant to be controlled by the DSP. Signed-off-by: Otto Pflüger --- sound/soc/qcom/qdsp6/q6afe.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index 91d39f6ad0bd..f14d3b366aa4 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -1111,6 +1111,32 @@ int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri, struct q6afe *afe = dev_get_drvdata(dev->parent); struct afe_clk_set cset = {0,}; + /* + * v2 clocks specified in the device tree may not be supported by the + * firmware. If this is the digital codec core clock, fall back to the + * old method for setting it. + */ + if (q6core_get_adsp_version() < Q6_ADSP_VERSION_2_7) { + struct q6afe_port *port; + struct afe_digital_clk_cfg dcfg = {0,}; + int ret; + + if (clk_id != Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE) + return -EINVAL; + + port = q6afe_port_get_from_id(dev, PRIMARY_MI2S_RX); + if (IS_ERR(port)) + return PTR_ERR(port); + + dcfg.i2s_cfg_minor_version = AFE_API_VERSION_I2S_CONFIG; + dcfg.clk_val = freq; + dcfg.clk_root = 5; + ret = q6afe_set_digital_codec_core_clock(port, &dcfg); + + q6afe_port_put(port); + return ret; + } + cset.clk_set_minor_version = AFE_API_VERSION_CLOCK_SET; cset.clk_id = clk_id; cset.clk_freq_in_hz = freq; From patchwork Sun Oct 29 16:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13439831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD403C4167D for ; Sun, 29 Oct 2023 16:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229689AbjJ2Q6E (ORCPT ); Sun, 29 Oct 2023 12:58:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjJ2Q6C (ORCPT ); Sun, 29 Oct 2023 12:58:02 -0400 Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99576C5 for ; Sun, 29 Oct 2023 09:57:55 -0700 (PDT) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id 9A6FF1C2592; Sun, 29 Oct 2023 17:57:53 +0100 (CET) Received: from fluffy-mammal.fritz.box (dslb-088-078-198-137.088.078.pools.vodafone-ip.de [88.78.198.137]) by srv01.abscue.de (Postfix) with ESMTPSA id 40CA91C2590; Sun, 29 Oct 2023 17:57:53 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: linux-arm-msm@vger.kernel.org Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , linux-sound@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Otto_Pfl=C3=BCger?= Subject: [PATCH v2 3/4] ASoC: qcom: q6afe-dai: check ADSP version when setting sysclk Date: Sun, 29 Oct 2023 17:57:15 +0100 Message-Id: <20231029165716.69878-4-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231029165716.69878-1-otto.pflueger@abscue.de> References: <20231029165716.69878-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Some older DSP firmware versions only provide AFE_PARAM_ID_*_CLK_CONFIG requests for setting clocks, while newer ones only provide the incompatible AFE_PARAM_ID_CLOCK_SET. The q6afe driver implements both, but requires different clock IDs for the different firmware versions. Implement the LPAIF_*_CLK clocks using newer clock IDs when the DSP firmware does not support the old clocks so that users don't have to care about the firmware version when setting clocks. Signed-off-by: Otto Pflüger --- sound/soc/qcom/qdsp6/q6afe-dai.c | 98 +++++++++++++++++++++++++++----- 1 file changed, 84 insertions(+), 14 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c index a9c4f896a7df..c66f8ab41d5e 100644 --- a/sound/soc/qcom/qdsp6/q6afe-dai.c +++ b/sound/soc/qcom/qdsp6/q6afe-dai.c @@ -14,6 +14,7 @@ #include #include "q6dsp-lpass-ports.h" #include "q6dsp-common.h" +#include "q6core.h" #include "q6afe.h" @@ -443,36 +444,105 @@ static int q6slim_set_channel_map(struct snd_soc_dai *dai, return 0; } +static int q6afe_get_bit_clk_id(unsigned int dai_id) +{ + switch (dai_id) { + case PRIMARY_MI2S_RX: + case PRIMARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT; + case SECONDARY_MI2S_RX: + case SECONDARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_SEC_MI2S_IBIT; + case TERTIARY_MI2S_RX: + case TERTIARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT; + case QUATERNARY_MI2S_RX: + case QUATERNARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_TER_MI2S_IBIT; + case QUINARY_MI2S_RX: + case QUINARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_QUI_MI2S_IBIT; + + case PRIMARY_TDM_RX_0 ... PRIMARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT; + case SECONDARY_TDM_RX_0 ... SECONDARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_SEC_TDM_IBIT; + case TERTIARY_TDM_RX_0 ... TERTIARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_TER_TDM_IBIT; + case QUATERNARY_TDM_RX_0 ... QUATERNARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_QUAD_TDM_IBIT; + case QUINARY_TDM_RX_0 ... QUINARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_QUIN_TDM_IBIT; + + default: + return -EINVAL; + } +} + +static int q6afe_get_osr_clk_id(unsigned int dai_id) +{ + switch (dai_id) { + case QUINARY_MI2S_RX: + case QUINARY_MI2S_TX: + return Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR; + + case QUINARY_TDM_RX_0 ... QUINARY_TDM_TX_7: + return Q6AFE_LPASS_CLK_ID_QUIN_TDM_OSR; + + default: + return -EINVAL; + } +} + static int q6afe_mi2s_set_sysclk(struct snd_soc_dai *dai, int clk_id, unsigned int freq, int dir) { struct q6afe_dai_data *dai_data = dev_get_drvdata(dai->dev); struct q6afe_port *port = dai_data->port[dai->id]; + int clk_src; + int clk_root; + bool use_new_clks = q6core_get_adsp_version() >= Q6_ADSP_VERSION_2_7; switch (clk_id) { case LPAIF_DIG_CLK: - return q6afe_port_set_sysclk(port, clk_id, 0, 5, freq, dir); + if (use_new_clks) { + clk_src = Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO; + clk_root = Q6AFE_LPASS_CLK_ROOT_DEFAULT; + clk_id = Q6AFE_LPASS_CLK_ID_INTERNAL_DIGITAL_CODEC_CORE; + } else { + clk_src = 0; + clk_root = 5; + } + break; case LPAIF_BIT_CLK: case LPAIF_OSR_CLK: - return q6afe_port_set_sysclk(port, clk_id, - Q6AFE_LPASS_CLK_SRC_INTERNAL, - Q6AFE_LPASS_CLK_ROOT_DEFAULT, - freq, dir); + if (use_new_clks) { + clk_src = Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO; + clk_root = Q6AFE_LPASS_CLK_ROOT_DEFAULT; + if (clk_id == LPAIF_OSR_CLK) + clk_id = q6afe_get_osr_clk_id(dai->id); + else + clk_id = q6afe_get_bit_clk_id(dai->id); + } else { + clk_src = Q6AFE_LPASS_CLK_SRC_INTERNAL; + clk_root = Q6AFE_LPASS_CLK_ROOT_DEFAULT; + } + break; case Q6AFE_LPASS_CLK_ID_PRI_MI2S_IBIT ... Q6AFE_LPASS_CLK_ID_QUI_MI2S_OSR: case Q6AFE_LPASS_CLK_ID_MCLK_1 ... Q6AFE_LPASS_CLK_ID_INT_MCLK_1: case Q6AFE_LPASS_CLK_ID_WSA_CORE_MCLK ... Q6AFE_LPASS_CLK_ID_VA_CORE_2X_MCLK: - return q6afe_port_set_sysclk(port, clk_id, - Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO, - Q6AFE_LPASS_CLK_ROOT_DEFAULT, - freq, dir); + clk_src = Q6AFE_LPASS_CLK_ATTRIBUTE_COUPLE_NO; + clk_root = Q6AFE_LPASS_CLK_ROOT_DEFAULT; + break; case Q6AFE_LPASS_CLK_ID_PRI_TDM_IBIT ... Q6AFE_LPASS_CLK_ID_QUIN_TDM_EBIT: - return q6afe_port_set_sysclk(port, clk_id, - Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO, - Q6AFE_LPASS_CLK_ROOT_DEFAULT, - freq, dir); + clk_src = Q6AFE_LPASS_CLK_ATTRIBUTE_INVERT_COUPLE_NO; + clk_root = Q6AFE_LPASS_CLK_ROOT_DEFAULT; + break; + default: + return 0; } - return 0; + return q6afe_port_set_sysclk(port, clk_id, clk_src, clk_root, freq, dir); } static const struct snd_soc_dapm_route q6afe_dapm_routes[] = { From patchwork Sun Oct 29 16:57:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Otto_Pfl=C3=BCger?= X-Patchwork-Id: 13439830 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73F2EC4167B for ; Sun, 29 Oct 2023 16:58:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbjJ2Q6D (ORCPT ); Sun, 29 Oct 2023 12:58:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbjJ2Q6C (ORCPT ); Sun, 29 Oct 2023 12:58:02 -0400 Received: from srv01.abscue.de (abscue.de [89.58.28.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F558C6 for ; Sun, 29 Oct 2023 09:57:56 -0700 (PDT) Received: from srv01.abscue.de (localhost [127.0.0.1]) by spamfilter.srv.local (Postfix) with ESMTP id AAEF91C2593; Sun, 29 Oct 2023 17:57:54 +0100 (CET) Received: from fluffy-mammal.fritz.box (dslb-088-078-198-137.088.078.pools.vodafone-ip.de [88.78.198.137]) by srv01.abscue.de (Postfix) with ESMTPSA id 5E8641C2590; Sun, 29 Oct 2023 17:57:54 +0100 (CET) From: =?utf-8?q?Otto_Pfl=C3=BCger?= To: linux-arm-msm@vger.kernel.org Cc: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , linux-sound@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, =?utf-8?q?Otto_Pfl=C3=BCger?= Subject: [PATCH v2 4/4] ASoC: qcom: q6afe: remove "port already open" error Date: Sun, 29 Oct 2023 17:57:16 +0100 Message-Id: <20231029165716.69878-5-otto.pflueger@abscue.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231029165716.69878-1-otto.pflueger@abscue.de> References: <20231029165716.69878-1-otto.pflueger@abscue.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The clock fallback for older firmware versions now represents a use case for having multiple references to a port. Stop logging an error when a port is requested more than once because this does not indicate a problem anymore and causes unnecessary spam in dmesg. Signed-off-by: Otto Pflüger --- sound/soc/qcom/qdsp6/q6afe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c index f14d3b366aa4..56b1407c30bb 100644 --- a/sound/soc/qcom/qdsp6/q6afe.c +++ b/sound/soc/qcom/qdsp6/q6afe.c @@ -1592,10 +1592,8 @@ struct q6afe_port *q6afe_port_get_from_id(struct device *dev, int id) /* if port is multiple times bind/unbind before callback finishes */ port = q6afe_find_port(afe, id); - if (port) { - dev_err(dev, "AFE Port already open\n"); + if (port) return port; - } port_id = port_maps[id].port_id;