Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp609139pxb; Mon, 25 Oct 2021 14:54:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8kp6Ls6jIuRsjD/CbbsN4dyW/0ZqLNyyh1xB/Ky0q0ge2WwyMwWUL3DLny/+K6Se5sag9 X-Received: by 2002:a17:90a:764e:: with SMTP id s14mr8716079pjl.221.1635198868370; Mon, 25 Oct 2021 14:54:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635198868; cv=none; d=google.com; s=arc-20160816; b=KPNvudXxuO+A1yyneqctT8gSCI3awWHP42OR9iaAA9DMRocBSw9pqVAoHVr7+ayVqa rOntebGTJ+fdl/CiTvBoq3YJnsMIby7IIqwj8YW2YYB1nQpImAAJ/nvrVlQuaMc+6NhI pH4EVMZKGcyUMBAN+0d0uULYyU2aAF6rtEL6sZ0tsP8Di2bOcsPHLVv/+v5IDzey1TaW 995q+3sODmLyU3B1T0kyCmzJUX7WHysnT8XmPjheCtOrSM/LP9mdTkfEqe9vcqeeAC4m 20kQwcZpqSnd8nwgidvSu9f1PzI6ZvMbPyMVt7uLSgHjcrBvOIDFmD+STySD1YJY8CIg 3thg== 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=8caJnjW/ExE+2e1TjSWGo9a38UP3s2oH4ruUPy5uBO4=; b=HqqpSRRHWwW0nof/1t++BaKhituR5fHudTuh28dEp3ulxMkRvkKZTenoYi0VxfmrGB kDFqzPBb1SHTh/DEua12XUguIqks2nbN5hd3zJkhN0OEa9cF9Ys3W5IJvoQ8Rs+SNN1w SKaqIuN6f0u3tOk5rnY8zJU8gJ7TmeTeMrvIlfbb7bwLeJGPEGlZ47xqbyN/JBHH/UC2 F8kXGgjGqFushyOOXBfdYRvPBIPvdJPnMI5hG7ulAZER3C1ZV55WTdXmZJSiSFkie1/P 5LgCPuTvTxTIxiw+YqNutUtUpq1FaRG06dkyHUbZqQvR0a1ZJ93wgYmNnpMY2KGU0r6K 5ZfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=w2zw8SX1; 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 h8si33680572pjq.2.2021.10.25.14.54.16; Mon, 25 Oct 2021 14:54:28 -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=w2zw8SX1; 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 S234422AbhJYTTI (ORCPT + 99 others); Mon, 25 Oct 2021 15:19:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:36400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234559AbhJYTSk (ORCPT ); Mon, 25 Oct 2021 15:18:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7BE2E61090; Mon, 25 Oct 2021 19:16:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189378; bh=3nzARtnUIwmZ7Ln1TUgyXOZPqMLx4g/YocxRcSV56RE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w2zw8SX1zZwyN5uCq/B8VSlMjbBZjAL8A6lCo8XLTIzGgraOAsC8CHVBhaokCLO32 Q39uqX7Y0rAWCvd/nkQXklfReA+/GBVPiTRuxLGVZziQWI3+NykK831ciDzQYs9al+ Is7f+Q5vvU14glT3PBo73TDPqBRRBQphgWJBGHCQ= 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.4 32/44] ASoC: DAPM: Fix missing kctl change notifications Date: Mon, 25 Oct 2021 21:14:13 +0200 Message-Id: <20211025190935.238114232@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190928.054676643@linuxfoundation.org> References: <20211025190928.054676643@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 @@ -2377,6 +2377,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); @@ -2389,13 +2390,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; } /** @@ -3290,14 +3292,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); @@ -3657,7 +3660,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,