Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp644075pxb; Mon, 25 Oct 2021 15:42:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYNA3metf4NSwEpF7re7Tel1w7WuNsat2yzQqDZgUkUde//bNUCpRcnwZXDci+fTb11ZZC X-Received: by 2002:a05:6a00:244e:b0:47b:7dbf:e23d with SMTP id d14-20020a056a00244e00b0047b7dbfe23dmr21581115pfj.34.1635201767819; Mon, 25 Oct 2021 15:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635201767; cv=none; d=google.com; s=arc-20160816; b=ZydCgVYKNeZOeKqLirtXxPO/DsGgd97+Pii6J8WWSnhtx2jivUtDHRi9Kr6on4FkL2 iXVReBBhQw1lgruazMtE5mZUEcjMInICLmRntxON7WmOOmzy0rqi4BqlM3GjDYhR9dRO rBppkjEFXKKUbtTy9TwbAk15/XADkOvCRrNbkstuz5pHd0UNrM6Qf8TL1bpkTmx39VeD Un777UNl3PO1fzU8NO2NSfcldmJY8PpmnTVtabPwMfx5Wq77mp+YOoXpsEyhZc2NwF73 elHkELGXZsm2mO2i5iwyM+uM0Du4UigerR1Kz7BW3BceoDddLOrjeORGOk8vGc/yhwdp ugpA== 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=TzFLzsml2oo7mcHKcEdlkjTB4VDUZJTbYmtKwD9mKPY=; b=z71xQ1YIOVZsGSuIIboM2OH0xiusCoTvo2gzwwTmhWk9aGMXc9jg5pIvuVnIcRems4 uSizkkW+TMqK2Pdr1/di3wLMxVU+BbUMQTgkMuzEDooT3Oxv4IuASofZSHoAosOxYCuO yuvBuLtqCwYiHTC8UdYf8BdwmuB2GtRQZ9n00R3crPTUUtXPfjzLbVd2u04in3x7Jj90 2kyKnD+Bn17KiJKoXy5wXij5tM+qaTlxtahBUNNeOXXUJkhSTmbq5DEV3APV1pLZ+LzL OUqilTnMlRxjrOPECMQ04c8eVEkRg9+yOTHiER9qDloaK8w1N/uj6IvxfGaDMQyvdX9f 5mww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tzqVF8Xv; 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 j5si6710102plk.143.2021.10.25.15.42.35; Mon, 25 Oct 2021 15:42:47 -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=tzqVF8Xv; 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 S233534AbhJYT2H (ORCPT + 99 others); Mon, 25 Oct 2021 15:28:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:41026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235226AbhJYTZP (ORCPT ); Mon, 25 Oct 2021 15:25:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 23F0A60F70; Mon, 25 Oct 2021 19:22:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189747; bh=5eom8NlZLabZLJh/uza/J8ZttkYQ4oSOl0sUK6XhPQI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tzqVF8Xv117uu54ZFXUAYy5OaRiHsPfng4lYScEFmqnJKikTmMu2C+d+VbUZQoonE c6IjNY3QfbjW5qt5g8aLvRc/CYmDm5Piaj1EXI2+dFkIWjVTv/0o3p7aO4WwMxdhFW WTpjC0ipOFP3Q5HdonaY4ro6NlOyMkGDC7dle1qA= 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.14 16/30] ASoC: DAPM: Fix missing kctl change notifications Date: Mon, 25 Oct 2021 21:14:36 +0200 Message-Id: <20211025190926.890741543@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190922.089277904@linuxfoundation.org> References: <20211025190922.089277904@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 @@ -2495,6 +2495,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); @@ -2507,13 +2508,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; } /** @@ -3441,14 +3443,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); @@ -3824,7 +3827,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,