Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp816332rwi; Wed, 19 Oct 2022 03:24:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Lv6PR728MQqVjf0fSE1zY0qGyfgllBQe88c1OJbDqIClw5r0IA6l1Yl3uMqd3dsXLexHU X-Received: by 2002:a17:902:9049:b0:180:7922:ce36 with SMTP id w9-20020a170902904900b001807922ce36mr7960959plz.30.1666175051067; Wed, 19 Oct 2022 03:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175051; cv=none; d=google.com; s=arc-20160816; b=lNcSpaZmNxde9Cz8lWXMXGtvprok5s0zCgS1OI1YDIhwwYFF2ltP/F9VGBoy1pfdya OWAtRJKCwc6VOPR85T/xTOPrOXc/RigXOe5SlXnQzDddaH9MA34DXVEAI5SxVz9XZYVj 6kNBMRJTKzssa9nUvEGtlvHKe8O/zQHT2e6QhsJFV6MW6J5/GbwSDvjr/a63vkl0KW0D +S+jWZyVJOFURx0T6F7KXCFVMprY+wHknJZtgNqbAECfXRt2GiIQFnhSWS0QdWIEzYk5 AjLRzVKusUVgERik1yjrmDEOMZ2Xfv3W8axSPZdGpTVupxn+7AT0YHN3DpW8Y8YYmxAq tFRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ehuRqQuKzxhFY64W3JO9dYQ512+WDi9UkwTt2cPdiAo=; b=j+Wz7CaNiT22z7BRwpJ+3KoIq9d87fWFzs0S6OqZdExPB2f1d4twnHZjLtxnTXASuB tsfhPvGaRpKiMaZkg2cnjhtrRFLX0LEy3c1TucM/V8DIWNUmfeqS7H4cnx92U8hy4vEz 8qnG0vSJ9jLM0u8bIqazplanUCR4M4A0rzb/BmlUDw4OCv2D3gMBNRfbKqD/xt/meqH0 XZ9Dd9xcEHczrSBa8NNQx3X8yb3NLA93/MFYXith5q2wtVFyIlvTBvRSY8GzVfSkoBOr LSUJFe/3AAavv2mZngC0PauBi6ihu4EMgeVe3v2/DVGgS9Sb+QovfwwqVZ3vfy761fVI fGuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QfD59p59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b00439fbc1b5absi16981267pgd.797.2022.10.19.03.23.55; Wed, 19 Oct 2022 03:24:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QfD59p59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232409AbiJSJGG (ORCPT + 99 others); Wed, 19 Oct 2022 05:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232499AbiJSJEY (ORCPT ); Wed, 19 Oct 2022 05:04:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65AB49D528; Wed, 19 Oct 2022 01:57:40 -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 dfw.source.kernel.org (Postfix) with ESMTPS id BB47261867; Wed, 19 Oct 2022 08:56:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEEE5C433C1; Wed, 19 Oct 2022 08:56:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169769; bh=/KXZ6TtpDb4MRpdGoI3eHmCgdlt22zSQ2OvKcABdU/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QfD59p59AfhoJSwUW4XT3tCcA4y6K3wb9k8KnRQGGjwLHblvDPaRGdCPIp/7Otanz yyNvXfgZ0yapSVqsMpPC9S+Bpn0InhccIBTHvSR069E67CPNXJmZWWnGeaDOdikeNG ZEFhFqWRJGk7bIOFjYxqMVkJ4hK6URMoHd0Z2ghc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Mark Brown , Sasha Levin Subject: [PATCH 6.0 401/862] ASoC: codecs: tx-macro: fix kcontrol put Date: Wed, 19 Oct 2022 10:28:08 +0200 Message-Id: <20221019083307.651568697@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit c1057a08af438e0cf5450c1d977a3011198ed2f8 ] tx_macro_tx_mixer_put() and tx_macro_dec_mode_put() currently returns zero eventhough it changes the value. Fix this, so that change notifications are sent correctly. Fixes: d207bdea0ca9 ("ASoC: codecs: lpass-tx-macro: add dapm widgets and route") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20220906170112.1984-6-srinivas.kandagatla@linaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/lpass-tx-macro.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/lpass-tx-macro.c b/sound/soc/codecs/lpass-tx-macro.c index 55503ba480bb..e162a08d9945 100644 --- a/sound/soc/codecs/lpass-tx-macro.c +++ b/sound/soc/codecs/lpass-tx-macro.c @@ -823,17 +823,23 @@ static int tx_macro_tx_mixer_put(struct snd_kcontrol *kcontrol, struct tx_macro *tx = snd_soc_component_get_drvdata(component); if (enable) { + if (tx->active_decimator[dai_id] == dec_id) + return 0; + set_bit(dec_id, &tx->active_ch_mask[dai_id]); tx->active_ch_cnt[dai_id]++; tx->active_decimator[dai_id] = dec_id; } else { + if (tx->active_decimator[dai_id] == -1) + return 0; + tx->active_ch_cnt[dai_id]--; clear_bit(dec_id, &tx->active_ch_mask[dai_id]); tx->active_decimator[dai_id] = -1; } snd_soc_dapm_mixer_update_power(widget->dapm, kcontrol, enable, update); - return 0; + return 1; } static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, @@ -1019,9 +1025,12 @@ static int tx_macro_dec_mode_put(struct snd_kcontrol *kcontrol, int path = e->shift_l; struct tx_macro *tx = snd_soc_component_get_drvdata(component); + if (tx->dec_mode[path] == value) + return 0; + tx->dec_mode[path] = value; - return 0; + return 1; } static int tx_macro_get_bcs(struct snd_kcontrol *kcontrol, -- 2.35.1