From patchwork Wed Oct 19 08:28:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp213744wrs; Wed, 19 Oct 2022 02:10:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PxC81xQxilNSi3DIAZx1Ajgl/YOB7YNbDWUZIxHxdvg8PBE/GjJsorMMzY1fV2rzUh0c/ X-Received: by 2002:a05:6402:14ce:b0:45c:2c81:e144 with SMTP id f14-20020a05640214ce00b0045c2c81e144mr6394109edx.90.1666170659572; Wed, 19 Oct 2022 02:10:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170659; cv=none; d=google.com; s=arc-20160816; b=VUUoLaAswYNhMQ3HFWBTpLAV2nQTlnjyQKUGytnpb41PPH2iU0z3yp9TaG51EcUcZL 2qsqBTbSsLGe8NZT38QFIA8uoaXGaOMgpJZd+qJdzyyJRe3/OrpW6JRJKAP+2eYp5XRA Y4OId5S/jV1sZUtIZGs22QW7k1PUr2VmvExgwk6794DnPIfzLXWTbB8Iuyp9hyODwW6V Vx4j01SayaVOil6wcFjc/8I0kdf+xIO5aOJiCabVN5slRrwy4qpaPuHABpu2Yhm7Wpdc xsg9CFTQ0isLtsmNi2hTDYYqMuOrriF7QKkghbZEr4+yIjJWYOjuC6YqHuIrjm523iez +M0A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a50cc87000000b00457594320f5si14419500edi.107.2022.10.19.02.10.33; Wed, 19 Oct 2022 02:10:59 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747106565310137787?= X-GMAIL-MSGID: =?utf-8?q?1747106565310137787?= 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,