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 1E73333CEA2; Wed, 20 May 2026 18:35:04 +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=1779302105; cv=none; b=BEsT5g0aVu0EzG+SDk8Hkczy4Kn7TejHI4m9/iGbQE8Wp+ziFzmRw9EhDmeSCumrgQKoPpgDKbVS4JNaqK5bC3ZPDy0XYwTA6XObNJl5PEQOzORJNeqznXkg/hBBpmaI90Wi7dqiTajGosEyPsbQJjRKNCvFIpSspL7gQTRqbTY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302105; c=relaxed/simple; bh=PzvkxtAF3TL42Au/urxL4T9z0lyUh6rzeLCEgyF8My4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j/ikj5JqrsnB+Z1i8mL9oJgSeQDkZQH236JSzfQKh89r4yWfh4BcFlNgh4BdSJN9SbXLdslMNmjZ6bnZ/BSVCVA8yhhXRVv7uPvC7gJw2vbijBnBGhHPXNFMV5Ydmq55SG+zmeM7Sd1Vwbo/OUcbDVwsu/RaB3toAHnBmVIvUtM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WXgPngki; 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="WXgPngki" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 828811F00898; Wed, 20 May 2026 18:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779302104; bh=J2zfQqCj/ByDUxrFL13KVWQc/AZd1EfiubY8zoQNM6k=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WXgPngki/mdy6MBe40seBG69k9rEUN/Z2uhGQlqK8szEDOXNSklj/vebXxgumos69 tLizbxwSD82W9reYQvjDZa9gpcEJ0lU1IBN4gPAWPFheoSUAu9IqmZZ4LqjNxnM0fk IBTr+PyMluFZtKFKWsapv6ur62ebfSMyJZ35kYUM= 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.6 140/508] ASoC: fsl_micfil: Fix event generation in micfil_quality_set() Date: Wed, 20 May 2026 18:19:23 +0200 Message-ID: <20260520162101.664367656@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162058.573354582@linuxfoundation.org> References: <20260520162058.573354582@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.6-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 32ee7093c8110..189f65989fcfe 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