From mboxrd@z Thu Jan 1 00:00:00 1970 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 EB31AC433EF for ; Thu, 14 Jul 2022 04:35:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 21516191C; Thu, 14 Jul 2022 06:34:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 21516191C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1657773338; bh=uJxQ5zkiSZVte2k7O6ftC2Aguzs3PGSDlpQSoHM8pms=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RMT6A2oau5yhKzKqZwO3vk+ijWAK7SX/NPUxNiHZbztjoiYM1EEbIEJkKu8Ii+neX JsOtAEheSC/5dParvahO2kieYThLkcPttJY6ps4lAFKuxIRx4lAomrPIX+UCAvaUoX i4C37JBh8dCOdrft4OfGjaWiFoxONXyFLTF4EMtg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 67316F805B2; Thu, 14 Jul 2022 06:25:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 524C3F80674; Thu, 14 Jul 2022 06:25:22 +0200 (CEST) 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 8D98BF8063B for ; Thu, 14 Jul 2022 06:25:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8D98BF8063B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BNfKT/U+" 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 4E59061EB7; Thu, 14 Jul 2022 04:25:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDC09C36AE2; Thu, 14 Jul 2022 04:25:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657772712; bh=uJxQ5zkiSZVte2k7O6ftC2Aguzs3PGSDlpQSoHM8pms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BNfKT/U+3U8ebJOXZCFWv2rIFfsYbzTu1ZOFhk2bM0YtyZP4XOjmGicPKwbLGugDv 4cf1ZGSAQ6c/yWy/QI/lStn6TyW2jR0Xd7dP8n9d5i9QhvKejfOJPdIMZm7E9imjb8 Lb0O47NBphv2aYXN83sX8EPNPI0TbtapXOlIzIgeE09RE75zWzQyf7FZWP8H3MFtfq K4qDYU3kNeMSmV+d2tdCR7Qc3y3JhLq5gatQaVUk/Eil2fGrJi/+YQdLz3yaa38CTP 9ohZuovdrppevRz7v2fOmN4WbZP9o6HLt737jMlnPfdcs2mB90FGATFlbx7nVh7v4p E04Ie+4pHhSMA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 18/28] ASoC: madera: Fix event generation for rate controls Date: Thu, 14 Jul 2022 00:24:19 -0400 Message-Id: <20220714042429.281816-18-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220714042429.281816-1-sashal@kernel.org> References: <20220714042429.281816-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Cc: Sasha Levin , alsa-devel@alsa-project.org, Charles Keepax , patches@opensource.cirrus.com, tiwai@suse.com, lgirdwood@gmail.com, rf@opensource.cirrus.com, Mark Brown 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: Charles Keepax [ Upstream commit 980555e95f7cabdc9c80a07107622b097ba23703 ] madera_adsp_rate_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/madera.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index d3e7a591b5a8..fd4fa1d5d2d1 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; const int adsp_num = e->shift_l; const unsigned int item = ucontrol->value.enumerated.item[0]; - int ret; + int ret = 0; if (item >= e->items) return -EINVAL; @@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, "Cannot change '%s' while in use by active audio paths\n", kcontrol->id.name); ret = -EBUSY; - } else { + } else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) { /* Volatile register so defer until the codec is powered up */ priv->adsp_rate_cache[adsp_num] = e->values[item]; - ret = 0; + ret = 1; } mutex_unlock(&priv->rate_lock); -- 2.35.1