Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4375158imw; Tue, 19 Jul 2022 05:36:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uAm+rp0VCJzmxJAcNdMzJfOfdMdclGRMMOCz+73xCMuNueIJaBdb2O/diaK7Gx5CbeEKIQ X-Received: by 2002:a05:6402:40d6:b0:43a:cc69:1db9 with SMTP id z22-20020a05640240d600b0043acc691db9mr43905012edb.380.1658234184489; Tue, 19 Jul 2022 05:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658234184; cv=none; d=google.com; s=arc-20160816; b=NQxQ5OjmFfBZJKW8gc1UfdR1nScjWX/6nCcH10EO26xmg8Fb6LLNXCewiTTleIZYgJ Y8YpJZuWfNEFlIigKsyiC58f7RSfhDyDB0LslVkYkQG8/1ipQtfxtkA3UUof8qtZAqO0 /dHUnnWL5uo3plX9G0L05/+55riEkIpo5zOPSW3v+qxcRrnoIYA6ni4bkAO+LK3vevjQ 9rflaYRGjc1F1K83XE9ELOw/g7xNvOlucgUHjT1/PXh0XyC3NKjXo5d1skq5qZmBKUjJ OnpXyPUqkJJ/xolxq42g73WjtAjj2ok6FeTwXUXFUtv/i1WsEt2o/lWUxp4xvsh5jGRL GZUA== 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=FSPQw3EHtYbJcgSpN5cy5tt/HCAnHNY33qxGq2uNxIk=; b=wudu+4Hg4RBQjc/WTynqYzXen3XfIcEZM1Tw5n22ID5WQj1ki31pPJ1kp8RsQpGWKc /4g6x2pUPLe2Fj0Wb+kSFIMglF2DORBF2X9mhyVkNtsanUhYPl2DpoD2sbXqO7e87F0+ aTGsl3XV5Xi7gJhttHA2bwjZX9xzPlEUgjktPL/A8ughuRHK3BBMZXWI7BlTKssQhzua oGaJIszVqUrT+sO8S+L1jkVPuqC584R8iM/DRX64qLVVWWwXjcU58ar942AwKgwTyZO/ EzPA69y3d42RdviQjGpmZBLIkCqjFNjwQktNyRQl09tQYXvsKsB3ViIxeOpYab511pJ7 4gsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JCsvbZeX; 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 y17-20020aa7ce91000000b0043ad95b6b0bsi17063523edv.239.2022.07.19.05.35.58; Tue, 19 Jul 2022 05:36:24 -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=JCsvbZeX; 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 S240154AbiGSM1j (ORCPT + 99 others); Tue, 19 Jul 2022 08:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239735AbiGSM0M (ORCPT ); Tue, 19 Jul 2022 08:26:12 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE367A6; Tue, 19 Jul 2022 05:10:04 -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 sin.source.kernel.org (Postfix) with ESMTPS id 64643CE1BE2; Tue, 19 Jul 2022 12:10:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6EA1EC341C6; Tue, 19 Jul 2022 12:10:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232601; bh=iEp1GRXpnlwQEzZb52vi8VX+UqoaJVU/P2fR+9/aONo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JCsvbZeXWtezCgNVKRS2GU5+GVC4GSW4yc6hhHkHdXgxqcYp8itJg0e9MG7fuI+w/ cZy19WnIo65OkZeeyiwu1xikJYCqskc7+UyJJlxDpu6MpFRE/2ISHmAvlpGJAyKZLd 4zM887UfrpX0PUtN9kIQxvc40LgKINnwa9WkvGxg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.10 095/112] ASoC: madera: Fix event generation for rate controls Date: Tue, 19 Jul 2022 13:54:28 +0200 Message-Id: <20220719114635.986355549@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114626.156073229@linuxfoundation.org> References: <20220719114626.156073229@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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: Charles Keepax [ Upstream commit 980555e95f7cabdc9c80a07107622b097ba23703 ] madera_adsp_rate_put always returns zero regardless of if the control value was updated. This results in missing notifications to user-space of the control change. Update the handling to return 1 when the value is changed. Signed-off-by: Charles Keepax Link: https://lore.kernel.org/r/20220623105120.1981154-5-ckeepax@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/madera.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c index a74c9b28368b..bbab4bc1f6b5 100644 --- a/sound/soc/codecs/madera.c +++ b/sound/soc/codecs/madera.c @@ -899,7 +899,7 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; const int adsp_num = e->shift_l; const unsigned int item = ucontrol->value.enumerated.item[0]; - int ret; + int ret = 0; if (item >= e->items) return -EINVAL; @@ -916,10 +916,10 @@ static int madera_adsp_rate_put(struct snd_kcontrol *kcontrol, "Cannot change '%s' while in use by active audio paths\n", kcontrol->id.name); ret = -EBUSY; - } else { + } else if (priv->adsp_rate_cache[adsp_num] != e->values[item]) { /* Volatile register so defer until the codec is powered up */ priv->adsp_rate_cache[adsp_num] = e->values[item]; - ret = 0; + ret = 1; } mutex_unlock(&priv->rate_lock); -- 2.35.1