From patchwork Fri Feb 24 14:03:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13151296 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D8376C61DA4 for ; Fri, 24 Feb 2023 14:09:31 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8387A829; Fri, 24 Feb 2023 15:08:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8387A829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677247769; bh=1KhcJKnYBuXVB3sSo3IhCFYBjgAmMojaWkGnR3yIJN0=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=OzBbvzCrF4S7Y8ArFuDGtlMHebAqlcZ0zIG57/gVim50Hqzo2KWNm3eRQM0IkJ2Y6 8SQPlC0nnHngX7qKDZxTrsqY3AfpA0sW0uJXIEt9oLEUr3WIHzohwN+FybuCoM0Kf2 xS6+g03hoBHflysgEwywySevDQOoZw2SmLoiCaLc= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 7D269F80534; Fri, 24 Feb 2023 15:07:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2CBE8F80236; Fri, 24 Feb 2023 15:07:49 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 038F3F800C7 for ; Fri, 24 Feb 2023 15:07:39 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 038F3F800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=BCG5euaP Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D41DB618EA; Fri, 24 Feb 2023 14:07:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 304BDC433D2; Fri, 24 Feb 2023 14:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677247657; bh=1KhcJKnYBuXVB3sSo3IhCFYBjgAmMojaWkGnR3yIJN0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BCG5euaPHPwa5bU6SIZwPSyv+JGLosuVrAXoh0T1j/2kSzF9nwfPE3+zNbOgR4ssl FslqXUUv9FNLAIjljixbWGUkb94Hf44RgVCzuQTjk2wdXkmyBNZoKUH4CGZEZu4ree 2Ii8rJUH6h6TiyJwLZCcP6YliTZqrB7rQnNdHQVx4ME1NYAbWT37PSfWwnDXzPyhdV QKGaUuESYAlepZcRkaNp+fk7bPcNy2aGTw+MY+P2DrH5QhZxdV7ZVm1RqGvafAg7JW aSITRMmazaCe11oPNvutQ3Tihd6kvn96cPT8MXqPp94bd1SgDNist44/+5QPiaWUbZ NqhAseQPBpU2g== From: Mark Brown Date: Fri, 24 Feb 2023 14:03:55 +0000 Subject: [PATCH 1/4] ASoC: mt8192: Remove spammy log messages MIME-Version: 1.0 Message-Id: <20230223-asoc-mt8192-quick-fixes-v1-1-9a85f90368e1@kernel.org> References: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> In-Reply-To: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> To: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4465; i=broonie@kernel.org; h=from:subject:message-id; bh=1KhcJKnYBuXVB3sSo3IhCFYBjgAmMojaWkGnR3yIJN0=; b=owGbwMvMwMWocq27KDak/QLjabUkhuQfRxYuTfByVTXWm1M3+WWct/Ysd5ZUbt+yjYp7NlTP40lw 7TDtZDRmYWDkYpAVU2RZ+yxjVXq4xNb5j+a/ghnEygQyhYGLUwAm0sLL/lc44lTFmnsna6OOPz7DOP O+kWyd6aftfsaVezT+7fnOm2X4a3X15bVPuk+ucp7x9nIZH+O7fdNDDosl5GTqn85/0zPxgS5bSKtt yvzc419FSiYomde2LKq4lsufWcC31TCh6IxwpJiux6WFhVKupdd17yU32qjK3Htgc6F2T84G2Z0rAj PXdBrqvo5UdQn59OhOafNz2ae/r5VMyX+meXdf+fm8N1Z/WsNDdAV3mOjJCS9LlWrJ8ErtEz6gy8Tz bUHKullmzl3HDG78COsL6r5VLfbapfbU4+PcKV3ZL8x2ixvYlnTXvOkN0y1d17eYqTvX8fXJdHm/f9 M3XDAwE2bXDzh7vyR4dtYes9/xAA== X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Message-ID-Hash: 3Y226BMP7YVCDFOIGKMHHY4BEZVGZZET X-Message-ID-Hash: 3Y226BMP7YVCDFOIGKMHHY4BEZVGZZET X-MailFrom: broonie@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: There are a lot of info level log messages in the mt8192 ADDA driver which are trivially triggerable from userspace, many in normal operation. Remove these to avoid spamming the console. Signed-off-by: Mark Brown Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 33 ----------------------------- 1 file changed, 33 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c index f8c73e8624df..bc8753f1001c 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c @@ -303,9 +303,6 @@ static int mtk_adda_ul_event(struct snd_soc_dapm_widget *w, struct mt8192_afe_private *afe_priv = afe->platform_priv; int mtkaif_dmic = afe_priv->mtkaif_dmic; - dev_info(afe->dev, "%s(), name %s, event 0x%x, mtkaif_dmic %d\n", - __func__, w->name, event, mtkaif_dmic); - switch (event) { case SND_SOC_DAPM_PRE_PMU: mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 1); @@ -345,10 +342,6 @@ static int mtk_adda_ch34_ul_event(struct snd_soc_dapm_widget *w, int mtkaif_dmic = afe_priv->mtkaif_dmic_ch34; int mtkaif_adda6_only = afe_priv->mtkaif_adda6_only; - dev_info(afe->dev, - "%s(), name %s, event 0x%x, mtkaif_dmic %d, mtkaif_adda6_only %d\n", - __func__, w->name, event, mtkaif_dmic, mtkaif_adda6_only); - switch (event) { case SND_SOC_DAPM_PRE_PMU: mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, @@ -538,9 +531,6 @@ static int mtk_adda_dl_event(struct snd_soc_dapm_widget *w, struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); - dev_info(afe->dev, "%s(), name %s, event 0x%x\n", - __func__, w->name, event); - switch (event) { case SND_SOC_DAPM_PRE_PMU: mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA, 0); @@ -564,9 +554,6 @@ static int mtk_adda_ch34_dl_event(struct snd_soc_dapm_widget *w, struct snd_soc_component *cmpnt = snd_soc_dapm_to_component(w->dapm); struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); - dev_info(afe->dev, "%s(), name %s, event 0x%x\n", - __func__, w->name, event); - switch (event) { case SND_SOC_DAPM_PRE_PMU: mt8192_afe_gpio_request(afe->dev, true, MT8192_DAI_ADDA_CH34, @@ -612,9 +599,6 @@ static int stf_positive_gain_set(struct snd_kcontrol *kcontrol, AFE_SIDETONE_GAIN, POSITIVE_GAIN_MASK_SFT, (gain_db / 6) << POSITIVE_GAIN_SFT); - } else { - dev_warn(afe->dev, "%s(), gain_db %d invalid\n", - __func__, gain_db); } return 0; } @@ -640,9 +624,6 @@ static int mt8192_adda_dmic_set(struct snd_kcontrol *kcontrol, dmic_on = ucontrol->value.integer.value[0]; - dev_info(afe->dev, "%s(), kcontrol name %s, dmic_on %d\n", - __func__, kcontrol->id.name, dmic_on); - afe_priv->mtkaif_dmic = dmic_on; afe_priv->mtkaif_dmic_ch34 = dmic_on; return 0; @@ -669,9 +650,6 @@ static int mt8192_adda6_only_set(struct snd_kcontrol *kcontrol, mtkaif_adda6_only = ucontrol->value.integer.value[0]; - dev_info(afe->dev, "%s(), kcontrol name %s, mtkaif_adda6_only %d\n", - __func__, kcontrol->id.name, mtkaif_adda6_only); - afe_priv->mtkaif_adda6_only = mtkaif_adda6_only; return 0; } @@ -750,9 +728,6 @@ static int mtk_stf_event(struct snd_soc_dapm_widget *w, regmap_read(afe->regmap, AFE_SIDETONE_CON1, ®_value); - dev_info(afe->dev, "%s(), name %s, event 0x%x, ul_rate 0x%x, AFE_SIDETONE_CON1 0x%x\n", - __func__, w->name, event, ul_rate, reg_value); - switch (event) { case SND_SOC_DAPM_PRE_PMU: /* set side tone gain = 0 */ @@ -1163,12 +1138,6 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, unsigned int rate = params_rate(params); int id = dai->id; - dev_info(afe->dev, "%s(), id %d, stream %d, rate %d\n", - __func__, - id, - substream->stream, - rate); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { unsigned int dl_src2_con0 = 0; unsigned int dl_src2_con1 = 0; @@ -1441,8 +1410,6 @@ int mt8192_dai_adda_register(struct mtk_base_afe *afe) struct mtk_base_afe_dai *dai; struct mt8192_afe_private *afe_priv = afe->platform_priv; - dev_info(afe->dev, "%s()\n", __func__); - dai = devm_kzalloc(afe->dev, sizeof(*dai), GFP_KERNEL); if (!dai) return -ENOMEM; From patchwork Fri Feb 24 14:03:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13151298 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A10EAC61DA3 for ; Fri, 24 Feb 2023 14:09:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 569D2203; Fri, 24 Feb 2023 15:09:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 569D2203 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677247790; bh=rybO/20a98fdHKZtAB7oYS7Qk4A/VAIx86q+e/5lOVk=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=FsayqSer5tMuEYSS1tFJUjNYBEp/37XlYebkO7bzH2Go4Xl1ABQYnXSo9u7l8oMBt sZLH1s7qa6sQ4xQ+Qymg1vK0kyDVfQgw2dZsG3gbKhtvY8WJHMY7tg0wPujMld5zWR jEc6rFi7/InCdlHxk+CZrdnYB5ZLzVKDoHP5DLjo= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EA7F3F80551; Fri, 24 Feb 2023 15:07:57 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24765F800DF; Fri, 24 Feb 2023 15:07:53 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5B2A7F800DF for ; Fri, 24 Feb 2023 15:07:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5B2A7F800DF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=OmTs//tH Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 349B7B81C96; Fri, 24 Feb 2023 14:07:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B08BFC433EF; Fri, 24 Feb 2023 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677247659; bh=rybO/20a98fdHKZtAB7oYS7Qk4A/VAIx86q+e/5lOVk=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=OmTs//tHgMOqlO4pBkuI4QNT+r3RvoMDvdw6thVQrGkpocB8Sbjw0sf0o8vq/PDCc 1NrGOdY32Yy1zieCRxbHRtcTTwguX5Z3xNyM54a0t6kiBUCnOSEpGmaQNBlQJCKAVn jeNUxHqKEfDgZIVNxTdkxsT+MhaMA20dUZP4p3qfCX/OPzDLkm4V2SaBuEKPRyuqq0 tc/9hNdSjA6NQH38QetCmZggKlxxXR0S+M1f/UinzPSFPIiWXdhakdRdgwWyJH1fg2 MKUWaOJK2u9ZygQbyifTdd5m86m1a8n3tvtOXQ0O3f2cZI3UQ8ShV55MURfxZ8OEyp 6zrH74kutPU5Q== From: Mark Brown Date: Fri, 24 Feb 2023 14:03:56 +0000 Subject: [PATCH 2/4] ASoC: mt8192: Fix event generation for controls MIME-Version: 1.0 Message-Id: <20230223-asoc-mt8192-quick-fixes-v1-2-9a85f90368e1@kernel.org> References: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> In-Reply-To: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> To: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2499; i=broonie@kernel.org; h=from:subject:message-id; bh=rybO/20a98fdHKZtAB7oYS7Qk4A/VAIx86q+e/5lOVk=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBj+MSi4fcXZN3SX4ycFjonmo5T8TgNsx4vC5u7yU/9 bTHy3wOJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY/jEogAKCRAk1otyXVSH0D3vB/ 9ia/xAkAhL29HBF3oLJN4EAHzoTo9/U803oY9OmuCnbFYIyZfbExiJ6KEEtVehzMd2/QmsbP52SuSh lmofPFSTpP/RTnKEIIYTwtci+Zbs00fBAswcmXXZka9HvxLx+9Clo17BXibbr/LfXDvEFmew3hT8wj FETIwQi7SE4Z16st+sJz/+9U2vexecqNTjz8FpBvo9mU4iOOsJCoacyPafifC9MmIYca+0RzvJkL8h 6IYxu5L6Smkv6Pl0sqhhmI5SIQKzHu5Rvg7bFKut8PPA88GBms825FDxn4rAjObpCVhaPXdVDEXK5Y dl0sdV86a6hAyiIxp4EWsqi2ZErFF7 X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Message-ID-Hash: XQR6UETNBMZK5EGQET34UII7SEPVKFN7 X-Message-ID-Hash: XQR6UETNBMZK5EGQET34UII7SEPVKFN7 X-MailFrom: broonie@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: ALSA controls put() operations should return 1 if the value changed and 0 if it remains the same, fix the mt8192 driver to do so. Signed-off-by: Mark Brown Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c index bc8753f1001c..a33d1ce33349 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c @@ -591,16 +591,19 @@ static int stf_positive_gain_set(struct snd_kcontrol *kcontrol, struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8192_afe_private *afe_priv = afe->platform_priv; int gain_db = ucontrol->value.integer.value[0]; + bool change = false; afe_priv->stf_positive_gain_db = gain_db; if (gain_db >= 0 && gain_db <= 24) { - regmap_update_bits(afe->regmap, - AFE_SIDETONE_GAIN, - POSITIVE_GAIN_MASK_SFT, - (gain_db / 6) << POSITIVE_GAIN_SFT); + regmap_update_bits_check(afe->regmap, + AFE_SIDETONE_GAIN, + POSITIVE_GAIN_MASK_SFT, + (gain_db / 6) << POSITIVE_GAIN_SFT, + &change); } - return 0; + + return change; } static int mt8192_adda_dmic_get(struct snd_kcontrol *kcontrol, @@ -621,12 +624,17 @@ static int mt8192_adda_dmic_set(struct snd_kcontrol *kcontrol, struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8192_afe_private *afe_priv = afe->platform_priv; int dmic_on; + bool change; dmic_on = ucontrol->value.integer.value[0]; + change = (afe_priv->mtkaif_dmic != dmic_on) || + (afe_priv->mtkaif_dmic_ch34 != dmic_on); + afe_priv->mtkaif_dmic = dmic_on; afe_priv->mtkaif_dmic_ch34 = dmic_on; - return 0; + + return change; } static int mt8192_adda6_only_get(struct snd_kcontrol *kcontrol, @@ -647,11 +655,14 @@ static int mt8192_adda6_only_set(struct snd_kcontrol *kcontrol, struct mtk_base_afe *afe = snd_soc_component_get_drvdata(cmpnt); struct mt8192_afe_private *afe_priv = afe->platform_priv; int mtkaif_adda6_only; + bool change; mtkaif_adda6_only = ucontrol->value.integer.value[0]; + change = afe_priv->mtkaif_adda6_only != mtkaif_adda6_only; afe_priv->mtkaif_adda6_only = mtkaif_adda6_only; - return 0; + + return change; } static const struct snd_kcontrol_new mtk_adda_controls[] = { From patchwork Fri Feb 24 14:03:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13151297 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 3DF63C678DB for ; Fri, 24 Feb 2023 14:09:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 469E283A; Fri, 24 Feb 2023 15:08:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 469E283A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677247771; bh=Oq2cgGTNFolGMp2hlVeWgvvLAmgRBdfsEVQSk6MsZsY=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=HNHMDQdsGTDbCoqSAIEWPe0yfuUmSAB45jPc+ChqWeslvFwVuuNFEq5BlFjzN7srw 3aG2HtN22bQiRhfUR+jz6VqqYTXfcWlaxqBxg/UMXiUBEssRLBriFoV9qoLGCzsX2A DIwDLdyb9XcJ42QYezhkGEA0xk4YTc/4ctpiIyL0= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 41F1FF80542; Fri, 24 Feb 2023 15:07:56 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 08756F80527; Fri, 24 Feb 2023 15:07:51 +0100 (CET) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8AB6CF80125 for ; Fri, 24 Feb 2023 15:07:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8AB6CF80125 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=uKKPbBrV Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B42F2B81BEE; Fri, 24 Feb 2023 14:07:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4736AC433D2; Fri, 24 Feb 2023 14:07:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677247662; bh=Oq2cgGTNFolGMp2hlVeWgvvLAmgRBdfsEVQSk6MsZsY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uKKPbBrVYPXVtVtVuluQ0hZNDzeo41eFFiaJBZlmJc0FJjaH5Mrk83kF1sYILsIbw 1n03r2XCb1ES0nFnDrMH7Lv0rlDun+8sy9T3o+oJnFzJXNl36xzzZwjp1NWWV42+Gn TTxeMwvLe23VtiqM2ydtEazfr3UbzOB4qYLxYUxo5S9nDBEUHtEiY259LNGL4Pixnf BRJ9aUj4dKoGSGZzt5s1qHoavhf15xRRGNKbH1Np+Jo45pMHXFNsEqiSUQs/HQ9GZG bwyCevc5py6Ezl7afx4i97+D6NZ4nZAkouQM5rvGSFNFQv9lcoFw5rTfnr7WWJIb8J AoEF5mr50w6hA== From: Mark Brown Date: Fri, 24 Feb 2023 14:03:57 +0000 Subject: [PATCH 3/4] ASoC: mt8192: Report an error if when an invalid sidetone gain is written MIME-Version: 1.0 Message-Id: <20230223-asoc-mt8192-quick-fixes-v1-3-9a85f90368e1@kernel.org> References: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> In-Reply-To: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> To: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=729; i=broonie@kernel.org; h=from:subject:message-id; bh=Oq2cgGTNFolGMp2hlVeWgvvLAmgRBdfsEVQSk6MsZsY=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBj+MSiKI/9K+DYjuaCW6GBP9SMdFxb8sNVK2hWQSGR k0Ewe1eJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY/jEogAKCRAk1otyXVSH0KVdB/ sHYybcK4VnCEic3yC/2mq3YLv2JzZZtTdDOrDDzw1GALc/ous7F1BMbn4ZjyfaFgQrkmagi+4gmNmA burLXblBiKahWsvJsLmUjtZx7SMrkZgvon5LWoX7U4aFw6NewfZdKnyaGE8dn/0yO5wmoV16UmlI7Y jWlfvomJnD5oombhkBTGCqZmH3Gbgf2ILKZ918qUxPlzYnj/EWMaoqoEryj4usxbo7nHRxacdcjpDh 3fWFVmC7mUQ/RI4hVKSRaYmIaA1Gyah+ink0ob8Yosc4fIKT9YV6WJxGghrYft6TeGK55u/1PKvbYa SgOkeN91Mr5CQ1HwDbxsR3G32zJLGq X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Message-ID-Hash: IKNJ2BUGFZUOBHYGLFF5UDXCGMBGPMPD X-Message-ID-Hash: IKNJ2BUGFZUOBHYGLFF5UDXCGMBGPMPD X-MailFrom: broonie@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Reporting an error on invalid values is optional but helpful to userspace so do so. Signed-off-by: Mark Brown Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c index a33d1ce33349..a02a297c0450 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c @@ -601,6 +601,8 @@ static int stf_positive_gain_set(struct snd_kcontrol *kcontrol, POSITIVE_GAIN_MASK_SFT, (gain_db / 6) << POSITIVE_GAIN_SFT, &change); + } else { + return -EINVAL; } return change; From patchwork Fri Feb 24 14:03:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13151299 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EFF9EC61DA4 for ; Fri, 24 Feb 2023 14:10:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2E20F1EA; Fri, 24 Feb 2023 15:09:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2E20F1EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1677247819; bh=tJW69WWMKlprOa5Xp3MSQu9gJosO9MCtIHdxPOTSeTM=; h=From:Date:Subject:References:In-Reply-To:To:CC:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=aHqs/gYDZnhrL0Xo9RcgYgBZDdnGsbNqsuhbm3v3oOJQonx3WT3UXm7p1ckI12D3B rMP/oDukpFAyBRRpypFayPzU1hqIUlevwiyxKpjb0BoTUuXomaVFw7UU89qfCpH4n3 Pwq4102/OAZjIp41eYjg6L1T2MGxAhGxxuENw7OQ= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 88CE7F80558; Fri, 24 Feb 2023 15:08:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3BD12F80542; Fri, 24 Feb 2023 15:07:55 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D9B2AF80116 for ; Fri, 24 Feb 2023 15:07:46 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D9B2AF80116 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=exI1HPiq Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 88A2B618E8; Fri, 24 Feb 2023 14:07:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2061C4339C; Fri, 24 Feb 2023 14:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677247665; bh=tJW69WWMKlprOa5Xp3MSQu9gJosO9MCtIHdxPOTSeTM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=exI1HPiqonADtQ3JbWxYrA0MvmrGUJ5sDDyhhgai0FWcxboCZRDuUIN9TGWCn8104 qHhSyUlgIZ5Oj3w6WRbc0L7gbUXFwRUemlpsSKCMj+W/i0+/Xew9NlBvV2FhT32G7G bVSBawb2n7XVXx01Pnun+OBBDIFvTcYq+Y4DyHwDDTh651L6T6s3FjaFUWvxHGAyZm QZXSbIcms4hzEkVPkuYb3Fk7EJoeNHlql3GBQCK7CnwVOjMR6dL6s6ZOb3hsKvG426 dPuzGVEYhgx+fVPBl00LjM7RGxPcjNwRVNeRZUS5IrE8uckiZrDjYMpXfd0JxgUtI7 oBdQkL2SN6uiw== From: Mark Brown Date: Fri, 24 Feb 2023 14:03:58 +0000 Subject: [PATCH 4/4] ASoC: mt8192: Fix range for sidetone positive gain MIME-Version: 1.0 Message-Id: <20230223-asoc-mt8192-quick-fixes-v1-4-9a85f90368e1@kernel.org> References: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> In-Reply-To: <20230223-asoc-mt8192-quick-fixes-v1-0-9a85f90368e1@kernel.org> To: Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Matthias Brugger , AngeloGioacchino Del Regno X-Mailer: b4 0.12.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1290; i=broonie@kernel.org; h=from:subject:message-id; bh=tJW69WWMKlprOa5Xp3MSQu9gJosO9MCtIHdxPOTSeTM=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBj+MSj76AsGbh8BaFvHgyLdCRoaexzbW9BgLDoOgOC J6TdUxqJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCY/jEowAKCRAk1otyXVSH0EaCB/ 9Hy8hUSJ7pct+oUw+uwv5aFtd39IiXzilcaerZgNl786hX0BWJ6gN4wMCsKSctPepdVVMzytQkF9cu gs5Rw3oo8vWL3QcSNuF/4kP/E1edK/fCedSR80cTmL9cxDyXXO+P8pbNcRMVeKsflgIUCNky5hlNzH vxcEJeKM3g9AP7axDa0k+dQGySwQZkE6SK6dFfoh0Bt2X9PgXB9HO6yul6rgkqC1sz8LmD/jAi1Rik ymG5hWRm1oOZ1/jcZT90v2D8WH7+5LeH+yhqlEjVKEOXE5Zs2M6bZs+6RuVOiX+q5gN9Mz+L+3+pCn 1t2qHuh3soPr5qc6RDZ9JcSi6cwmvQ X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB Message-ID-Hash: H5VPWVFSZS3TPWOKVO2AOSMUIC6ZK4VC X-Message-ID-Hash: H5VPWVFSZS3TPWOKVO2AOSMUIC6ZK4VC X-MailFrom: broonie@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Brown X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The Sidetone_Positive_Gain_dB control reports a range of 0..100 as valid but the put() function rejects anything larger than 24. Fix this. There are numerous other problems with this control, the name is very non idiomatic and it should be a TLV, but it's ABI so probably we should leave those alone. Signed-off-by: Mark Brown Reviewed-by: Nícolas F. R. A. Prado Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c index a02a297c0450..4919535e2759 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c @@ -670,7 +670,7 @@ static int mt8192_adda6_only_set(struct snd_kcontrol *kcontrol, static const struct snd_kcontrol_new mtk_adda_controls[] = { SOC_SINGLE("Sidetone_Gain", AFE_SIDETONE_GAIN, SIDE_TONE_GAIN_SFT, SIDE_TONE_GAIN_MASK, 0), - SOC_SINGLE_EXT("Sidetone_Positive_Gain_dB", SND_SOC_NOPM, 0, 100, 0, + SOC_SINGLE_EXT("Sidetone_Positive_Gain_dB", SND_SOC_NOPM, 0, 24, 0, stf_positive_gain_get, stf_positive_gain_set), SOC_SINGLE("ADDA_DL_GAIN", AFE_ADDA_DL_SRC2_CON1, DL_2_GAIN_CTL_PRE_SFT, DL_2_GAIN_CTL_PRE_MASK, 0),