From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A2DC1331220; Wed, 20 May 2026 18:08:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300513; cv=none; b=NniPe/hv5Rz8RJrAcxJgH56qiWcFHbfngGCsnLhkBmtLdQsgLSUvX8jbYOseGIsR/bymnxXsxANskzfD8hqTth2OHnIM17vKKt064mGp1vb/y5r3IXX68HlsGA0c16aNefd/sNNYbkBsU3D5Hxj0mOCtLbvyCBMCpOeGdG6nyyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779300513; c=relaxed/simple; bh=NlpvYwlxQrd9tjL/8OgeROjkZ40giNa6oiBnqiEoAmg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OdzX14pKy4YX1pMsQWZNrCtw4DBhRpk8/VHft0M80mLsna/jDUDq7skIXwVygDjaaG0xXhxPi7veCm+Lwfn740VdWQs/1ErX2YG/nUQoMnyRiprAnQ1MIr3ZUryjz4pa4BUJ6QZsimHkFX29Z1aGZUSDcPcuLfoIlPrYWmSBTog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Uq3+Oo8G; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Uq3+Oo8G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB0C61F000E9; Wed, 20 May 2026 18:08:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779300512; bh=x0JsxLS7I6HwSsx/jXhmA8Zfu3vNvb/530ZRBvwubZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Uq3+Oo8GLJq/aieCaXd/HrKwXMhpnykq/q7rJajJLjmjUFnf5ajleoCKJurFod9bN DWgWAHQQuZSZ01Mwm/5Hq1GXik6pdWY6QoTtb4Nk4iW6luTl/qXHhAmlOjuQUM1HOD 1+RpHohzRpvJJJpuQ1FH2S2nG+DJrVq9KmKOqeoY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shengjiu Wang , Mark Brown , Sasha Levin Subject: [PATCH 6.12 202/666] ASoC: fsl_micfil: Fix event generation in micfil_quality_set() Date: Wed, 20 May 2026 18:16:53 +0200 Message-ID: <20260520162115.585225017@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shengjiu Wang [ Upstream commit e5785093b1b45af7ee57d18619b2854a8aed073a ] ALSA controls should return 1 if the value in the control changed but the control put operation micfil_quality_set() only returns 0 or a negative error code, causing ALSA to not generate any change events. Add a suitable check in the function before updating the quality variable. Also enable pm runtime before calling the function micfil_set_quality() to make the regmap cache data align with the value in hardware. Fixes: bea1d61d5892 ("ASoC: fsl_micfil: rework quality setting") Signed-off-by: Shengjiu Wang Link: https://patch.msgid.link/20260401094226.2900532-7-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/fsl/fsl_micfil.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index a04a17db80e43..6998d30af4c42 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -181,10 +181,34 @@ static int micfil_quality_set(struct snd_kcontrol *kcontrol, { struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); struct fsl_micfil *micfil = snd_soc_component_get_drvdata(cmpnt); + int val = ucontrol->value.integer.value[0]; + bool change = false; + int old_val; + int ret; + + if (val < QUALITY_HIGH || val > QUALITY_VLOW2) + return -EINVAL; + + if (micfil->quality != val) { + ret = pm_runtime_resume_and_get(cmpnt->dev); + if (ret) + return ret; + + old_val = micfil->quality; + micfil->quality = val; + ret = micfil_set_quality(micfil); - micfil->quality = ucontrol->value.integer.value[0]; + pm_runtime_put_autosuspend(cmpnt->dev); - return micfil_set_quality(micfil); + if (ret) { + micfil->quality = old_val; + return ret; + } + + change = true; + } + + return change; } static const char * const micfil_hwvad_enable[] = { -- 2.53.0