Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp704156pxb; Mon, 25 Oct 2021 17:02:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHigTxY/lXlM77qVCrckiEifuaAJUdA2jS/QXf25CFc2dpYNKU3qKfI2801lNThj1mxIxQ X-Received: by 2002:a17:906:338f:: with SMTP id v15mr26661661eja.252.1635206559962; Mon, 25 Oct 2021 17:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635206559; cv=none; d=google.com; s=arc-20160816; b=x8m+TVSkGf4L9RQNfJyGRcYUys+T3HhcUE7hV1pnfyWpiy+/z95ZDzE7pCUwyIdSe/ gLRCdfcMiyNiP386SyNB2X9evPe7wtLq0FYzYL+QM0xhOLvX4xuRIhbW4ewc7ZvwydHG 8NyBv4vUlySHrY/wFhdEROmkFvq19oaSLS4+ZuL5Ek27S4QGgjguUpDDKAZfDyFe2e8v CTgcwqmjjVvwQwTAUbNCQXk1JkX0prEB7YSSzqbbw6RGFDmuu2aLt6hzklHHZEM0w8Bo ELwCa8W0O0qDQJuJRNNf5s1X6eKmhJx6AM7nvA0FjnmRkDsI8xHKX2yEh1f1a1vS4GAa aOGA== 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=8lH3KXhH6ZIz4jQho9lHIegxfHmW061aM1f842GEcXw=; b=Rsn4mmhNWr2A4zcj9uzhZpcPp9+OIGDgDImcnEsWxO4XugoYaBZdMTsYub1qx9ur2i 26xVKfIyFVx2FvUX1Ay/mEFSw1pPBWq8hUVOpC6eThypth0+qjsYeLBKvmOsUd1rvSco UnCw0VWTuSUeJ5wXT/wETOP5wCNpWWq6iVJdSndsz6EjkSionBJZUS3r4HKJR+HzXufe SRO420AyDq8cXy4FckkA+AmI6fUGUReMhmsijliQFfgcl7WGF5tSVvKGELPF+HqOgFtj iolHXcLYsdILJTJKGMFxos0F7rhmDzv0htUyX+4x3e5VvSfAKcpX54LHJwKyXR8pW0vJ MktQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=opK6TTHE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si30979828ede.307.2021.10.25.17.02.08; Mon, 25 Oct 2021 17:02:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=opK6TTHE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S236826AbhJYTnJ (ORCPT + 99 others); Mon, 25 Oct 2021 15:43:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:48098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235577AbhJYTbx (ORCPT ); Mon, 25 Oct 2021 15:31:53 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7B8186112D; Mon, 25 Oct 2021 19:28:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635190099; bh=o56mM3vtnNfozBIeTbdveuDnEJMQQsMN9P88ld7H8tQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=opK6TTHESKbOkk0IriR2ePOy0lKkqv+PIZGM6PXAvfpi+KnI7uBI8U+VLllpgMb7e DhLOJpof0UQDZJBMgQ/Ls81Kw9F4DUmryMsGONYrl+MmbfKVvJA6bcqd1U2yQCQAtS G0AraPxxICmoXS7MECR6soo/mfFrB/2azyNjJuC0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Mark Brown , Hans de Goede Subject: [PATCH 5.4 33/58] ASoC: DAPM: Fix missing kctl change notifications Date: Mon, 25 Oct 2021 21:14:50 +0200 Message-Id: <20211025190943.023924057@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190937.555108060@linuxfoundation.org> References: <20211025190937.555108060@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 5af82c81b2c49cfb1cad84d9eb6eab0e3d1c4842 upstream. The put callback of a kcontrol is supposed to return 1 when the value is changed, and this will be notified to user-space. However, some DAPM kcontrols always return 0 (except for errors), hence the user-space misses the update of a control value. This patch corrects the behavior by properly returning 1 when the value gets updated. Reported-and-tested-by: Hans de Goede Cc: Signed-off-by: Takashi Iwai Link: https://lore.kernel.org/r/20211006141712.2439-1-tiwai@suse.de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/soc-dapm.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2546,6 +2546,7 @@ static int snd_soc_dapm_set_pin(struct s const char *pin, int status) { struct snd_soc_dapm_widget *w = dapm_find_widget(dapm, pin, true); + int ret = 0; dapm_assert_locked(dapm); @@ -2558,13 +2559,14 @@ static int snd_soc_dapm_set_pin(struct s dapm_mark_dirty(w, "pin configuration"); dapm_widget_invalidate_input_paths(w); dapm_widget_invalidate_output_paths(w); + ret = 1; } w->connected = status; if (status == 0) w->force = 0; - return 0; + return ret; } /** @@ -3580,14 +3582,15 @@ int snd_soc_dapm_put_pin_switch(struct s { struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); const char *pin = (const char *)kcontrol->private_value; + int ret; if (ucontrol->value.integer.value[0]) - snd_soc_dapm_enable_pin(&card->dapm, pin); + ret = snd_soc_dapm_enable_pin(&card->dapm, pin); else - snd_soc_dapm_disable_pin(&card->dapm, pin); + ret = snd_soc_dapm_disable_pin(&card->dapm, pin); snd_soc_dapm_sync(&card->dapm); - return 0; + return ret; } EXPORT_SYMBOL_GPL(snd_soc_dapm_put_pin_switch); @@ -4029,7 +4032,7 @@ static int snd_soc_dapm_dai_link_put(str rtd->params_select = ucontrol->value.enumerated.item[0]; - return 0; + return 1; } static void