Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp669614pxb; Mon, 25 Oct 2021 16:17:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3tJaWEGHMRJIDvFNlCFnNeW1Dqu1+DomDZ4zAPZy9oUqvP+CxISwrMCUxBxdP1xn9d6ZU X-Received: by 2002:a50:e142:: with SMTP id i2mr19700260edl.159.1635203859641; Mon, 25 Oct 2021 16:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635203859; cv=none; d=google.com; s=arc-20160816; b=r7o67LPTOK6J9EFXVkeZhYaZbcx5z7zty5xXuculslEi2g9iwZH9VddZGw+Onr2DQT n1oyNTpdOzIJbOsO2NdfJgYENVy3fJSky5oaC82rNmKmgVuUexHPq/U0aszTvwxJyf8G yn2V9OEegEqhZ2ijmHrxUcsbar0IzQDZu2ugDGnJd3SqhixNEZcZhpEytLctPh4YCD1P Jyg6+NhLBdi2yDN8O457qQMJ8kMiTEyIX4ph/4CRjPfpo+dbirL5CfTglbXqN9icaIeD 7kMvICSSiXfsFbItqr8zMvxjc9lHUDndOP5AjSLi2LjBvdajC1VzLoPBhUsnXIf9S+MA 6psg== 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=1s2lMaAnUYbJCt1sm9eJYCvywdDywt8J8sg78gR6zqU=; b=a4HgYYqPeFsbwxloJgRxIJ4KQb59kpRkECqZVwCrYI3dLN3kj6lS2JMgC34cbGkl4i q6t/QYbv4Bbra/pV4seKi+Xnr0qXzEraSWXGvQ1VXDw8yeOaICPAvb/5lY4C47+fh4zT bjd1mouCtxG3U0fvKSgdKN5uMmWuO9HVSMNTr2ibn0GXOlr2o2r+OO38KZA8LBvg21it 8TISPk39r0hqvLamtP8a8v5oqQD1G0mbhsXZ56/EmzEp7jBywA+ZIZOLfKXtU3jr9ZXK 57pyT1BVxq/UXhzfw7R3nIFU9SypNCGu+AysZKnVufQRF3h3Rs2TdGjNxkf4d//fzuf8 9KjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gdWpd39x; 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 t19si19545726edt.563.2021.10.25.16.17.13; Mon, 25 Oct 2021 16:17: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=gdWpd39x; 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 S232091AbhJYTYA (ORCPT + 99 others); Mon, 25 Oct 2021 15:24:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:40718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233693AbhJYTWE (ORCPT ); Mon, 25 Oct 2021 15:22:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B3B4861078; Mon, 25 Oct 2021 19:19:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189582; bh=yPnI18qngDXNZlB95vqBC3qE+n8BE0dzrAezjQCXLM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gdWpd39xGOW8+dwc08QzritIcUADqYLGzMT3eSwzxKezx3R0KhDtoULhn5qsOLSup xoVGGtxPyCfYk1kAAmxOFlkgHphA3NEmYb6nRPzsuf1tcs4kFUCO2f55Oi4xYtg8Hw tqhGZgvl2RWMDdzS6AL1iaZ4XANbY8Liapaq5ifE= 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 4.9 39/50] ASoC: DAPM: Fix missing kctl change notifications Date: Mon, 25 Oct 2021 21:14:26 +0200 Message-Id: <20211025190939.880322576@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190932.542632625@linuxfoundation.org> References: <20211025190932.542632625@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 @@ -2410,6 +2410,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); @@ -2422,13 +2423,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; } /** @@ -3323,14 +3325,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); @@ -3706,7 +3709,7 @@ static int snd_soc_dapm_dai_link_put(str w->params_select = ucontrol->value.enumerated.item[0]; - return 0; + return 1; } int snd_soc_dapm_new_pcm(struct snd_soc_card *card,