Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2276750pxb; Thu, 11 Feb 2021 08:28:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJy42lq0GiwdKxOAWWFqyTEFVpVdv04P3SusmfiwG+li1ZABUWjWGV/K4GqmUaO7hlS8eZCe X-Received: by 2002:a17:906:3484:: with SMTP id g4mr9167683ejb.38.1613060925868; Thu, 11 Feb 2021 08:28:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613060925; cv=none; d=google.com; s=arc-20160816; b=pWJ4NuyVisXb0ZCAmKlMcl8KKfFPrsURV8E2Tk3PBph0aPMhh+hK0itRJunOv9SQYy G1rj7Bju3GShbCvGMrTA/zWc5dNjhbQZn8fJivNV13qbebyawzPcicNUcb7qpKGnZTVU 3AzX9aSpFp7QX5r3Mk78eQfZgS6Pqa3e5u9irO4pMgjvj0foc8ZJKvDgMUyi3el8hKqX 0X6EPHBjQXPt85zvWSleLTp+IaIyXQ/eaZqzwe3aMaj+GyFAlYlEGRd3UMsmDOyJmd3j +YoMeVr65uPi23hHvdYua0XBsDIoV8KVSKNrllD738LVPV7MrS0nyd2o+sHcHaCfQ/9O mBnw== 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=0hrU240YeWyEDiT/2NhNB4TW/L6W8blQkmA4Woq68+g=; b=is9kaPaFeSfhelvleUl6jyp011hz3cdxUYBH2juZTw/PXcM8BLo38i5xSq5hd0+32d PkA6rIYyyTST/L/mqe4KjdVbIl1LVi92r5qWMghPbBmN/Mo7w702ZrHguk22Kli5+3KF QIJFKQUf9AjhELip7IKD35ZIpamGS8razzWABnnwp2DtlPKueZF6Kzsf21hM1we0PJm1 xOXZ606r5hxcj6j2/gspG/HffV7NV/sJ9inhAOI3I1m+0QHYKPaQM8l3HD1Be1VAALLR upmsYMyeYt5gBVfLwaNgsi8UpMq7spsLlj9LHjCxesKif4bwyxrshZjtpZB7jdGtR0Dq IccQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mlZAjbqZ; 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 4si4928551edc.221.2021.02.11.08.28.22; Thu, 11 Feb 2021 08:28:45 -0800 (PST) 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=mlZAjbqZ; 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 S230147AbhBKQYj (ORCPT + 99 others); Thu, 11 Feb 2021 11:24:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:53538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230525AbhBKPYz (ORCPT ); Thu, 11 Feb 2021 10:24:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9F1D64ECA; Thu, 11 Feb 2021 15:03:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613055826; bh=chsoQVgOMFMKf0kMZfwuHu6gkK472skam4SXRssOxjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mlZAjbqZ1fISw3FPNpwzPjvjVcjYZR2sZ6na8MZAmfmesFM7T1CKIlj9cz+9wacXh J4rzGk5RcV/p/e5Qz0o+Ngnp2bAwjzzTvzFlVJso62EXhc11JcjvTJItW1wYru45ta sxQ7WOb/AH+efMSTWjQ1IjuDYZrUxFplOG1C+2hg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Schulman , Charles Keepax , Mark Brown , Sasha Levin Subject: [PATCH 5.10 21/54] ASoC: wm_adsp: Fix control name parsing for multi-fw Date: Thu, 11 Feb 2021 16:02:05 +0100 Message-Id: <20210211150153.806525427@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210211150152.885701259@linuxfoundation.org> References: <20210211150152.885701259@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: James Schulman [ Upstream commit a8939f2e138e418c2b059056ff5b501eaf2eae54 ] When switching between firmware types, the wrong control can be selected when requesting control in kernel API. Use the currently selected DSP firwmare type to select the proper mixer control. Signed-off-by: James Schulman Acked-by: Charles Keepax Link: https://lore.kernel.org/r/20210115201105.14075-1-james.schulman@cirrus.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/wm_adsp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index dec8716aa8ef5..985b2dcecf138 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -2031,11 +2031,14 @@ static struct wm_coeff_ctl *wm_adsp_get_ctl(struct wm_adsp *dsp, unsigned int alg) { struct wm_coeff_ctl *pos, *rslt = NULL; + const char *fw_txt = wm_adsp_fw_text[dsp->fw]; list_for_each_entry(pos, &dsp->ctl_list, list) { if (!pos->subname) continue; if (strncmp(pos->subname, name, pos->subname_len) == 0 && + strncmp(pos->fw_name, fw_txt, + SNDRV_CTL_ELEM_ID_NAME_MAXLEN) == 0 && pos->alg_region.alg == alg && pos->alg_region.type == type) { rslt = pos; -- 2.27.0