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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D685C433EF for ; Tue, 14 Jun 2022 02:10:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352631AbiFNCK3 (ORCPT ); Mon, 13 Jun 2022 22:10:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352608AbiFNCJQ (ORCPT ); Mon, 13 Jun 2022 22:09:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3399C3668A; Mon, 13 Jun 2022 19:06:31 -0700 (PDT) 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 42DB7B816A9; Tue, 14 Jun 2022 02:06:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31EF2C341C5; Tue, 14 Jun 2022 02:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655172389; bh=XOI0c77YmpwmB73ozt+1WFSrwCF5nxhWw69Zwe/maM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bXWmK99x/rHDsLxHKDZke0ys1sImNwzLu0g1gUzFThMUzyV1gQYxaAMoI5U8cpcQG PoZA6FbRPKmexbpr9uj/HiAcPhQUhVSPN0Dx9FsRmn3G9oCtLKqhgAKe6k/KIsAcXL vSKwz2VUa9R7R7JsKcdRGO7L3TILzhUdDHWdxyv8XRd4DqXfb19gqGU7BhUqPxAwsP 10yD4DKgBIhKTk6/0Yufsrk6X+s/9F6lc+ZAt/EB/aE6/2MqKYQDQm3jMVc3vxUZeA Iz87kNs5/k2Ux8GhwQDLqjxLwrXPkCTUH1+sJ31yDpnYBm5QOHTAGYgSqOZOCIVeHI S1hjYaQbNpNoA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mark Brown , Sasha Levin , lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.17 17/43] ASoC: es8328: Fix event generation for deemphasis control Date: Mon, 13 Jun 2022 22:05:36 -0400 Message-Id: <20220614020602.1098943-17-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220614020602.1098943-1-sashal@kernel.org> References: <20220614020602.1098943-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Brown [ Upstream commit 8259610c2ec01c5cbfb61882ae176aabacac9c19 ] Currently the put() method for the deemphasis control returns 0 when a new value is written to the control even if the value changed, meaning events are not generated. Fix this, skip the work of updating the value when it is unchanged and then return 1 after having done so. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20220603123937.4013603-1-broonie@kernel.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/es8328.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index 9632afc2d4d6..ca3b1c00fa78 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -161,13 +161,16 @@ static int es8328_put_deemph(struct snd_kcontrol *kcontrol, if (deemph > 1) return -EINVAL; + if (es8328->deemph == deemph) + return 0; + ret = es8328_set_deemph(component); if (ret < 0) return ret; es8328->deemph = deemph; - return 0; + return 1; } -- 2.35.1