Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3202904pxb; Mon, 9 Nov 2020 05:30:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJwecu9NqkP6blWzS9iPvKa2Z6G/Rx8g1LW/T7w28sAtckAiB6U3pmxYysQw+PYLqe2zj6At X-Received: by 2002:a17:906:9902:: with SMTP id zl2mr14659732ejb.510.1604928649308; Mon, 09 Nov 2020 05:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604928649; cv=none; d=google.com; s=arc-20160816; b=tYrVJzFCCLMJdJLRcB4J4S0UbIh/VAnRDs8P4/I0bk3Sm5pNLUzW8kD8QbKZIASUAr oy4owlR8eY1it/MY2ffqpWxdTuEue7+iSiLONjRh/Rax1Odv/0CGtbMoIVYKBrsfkXop BOE8SzVrMzD6XeeduGl1o2tU+lubx0oJPuxyQGB3wBFTyd8rMqtRuCeMWxnfPy1L67kP W7tEE9kTsAWh/gaAJKBxvyhq54KCj2yDEP3qwfegwg1rEw4Sb3aK1TDJ/n0SSP/rMLvL 7VIO1MXwo2XjwpkDiEZdafn6NtmzQjoiFbVuJi5D/NUseY0IB04LDAUC+rQ+Ttz9hUZt fsVQ== 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=74x7hEJpKJxxHjVz3DVD5GVL3Wz++mwrFbOawDq7YpQ=; b=q9R/plojW5St1rW2s+2dOD41UxuhH6ywAmmavCjRfhC7FhvRwy0EZZk+cH92BEZFV1 az1THwloP9837axynyz5gKoVZ//eADkQytDt8s3h9JYFVeXn3B3iXohRCpIkJpTmnt6i g4DufqMxVvRRLv6TUfhX6DUH1VfcO9FNcAisrVtEjY/b4VHZ1Ct8n4qq0ufc9ttO8UAb LCzU8SNPxXsKaAFKnKyHTK+O+RZyVGjE3mExiFYoEfmSzQ1SFKhFxSpawgqCEvAr9F/3 q5iV6Qo066pyYTwjSeTIU44iE9lvKpfsC1982lixpnMZq2w8g1/fHmZ7uUHUUjDN3SBD n97Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mCa5bVgK; 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=fail (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 b1si7324105ejb.290.2020.11.09.05.30.25; Mon, 09 Nov 2020 05:30:49 -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=@kernel.org header.s=default header.b=mCa5bVgK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732941AbgKIN3F (ORCPT + 99 others); Mon, 9 Nov 2020 08:29:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:38260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732692AbgKINMh (ORCPT ); Mon, 9 Nov 2020 08:12:37 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5862D20789; Mon, 9 Nov 2020 13:12:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927557; bh=JxC5bddqapCCWZTkXed8pvD3gk2KGlQJJha3wVJqFRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mCa5bVgK2qGD5TYisqiviUKI3m/dkKbu7uYM1XVnVnQkXxJd6gzjcGWfz4D5YeH3R P08cs6PtpY/pslzUOWR4/aJ4DMIDwcFILLUCdkTPqIAefwmRo/uBmB0rNIPEJPdcHZ VvvtA1WmpceY2e1ImZhSE54TFYZ54Vh5g5NdmICU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mateusz Gorski , Cezary Rojewski , Pierre-Louis Bossart , Mark Brown Subject: [PATCH 5.4 04/85] ASoC: Intel: Skylake: Add alternative topology binary name Date: Mon, 9 Nov 2020 13:55:01 +0100 Message-Id: <20201109125022.832734852@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@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: Mateusz Gorski commit 1b290ef023b3eeb4f4688b582fecb773915ef937 upstream. Add alternative topology binary file name based on used machine driver and fallback to use this name after failed attempt to load topology file with name based on NHLT. This change addresses multiple issues with current mechanism, for example - there are devices without NHLT table, and that currently results in tplg_name being empty. Signed-off-by: Mateusz Gorski Reviewed-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200427132727.24942-2-mateusz.gorski@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/intel/skylake/skl-topology.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -3565,8 +3566,20 @@ int skl_tplg_init(struct snd_soc_compone ret = request_firmware(&fw, skl->tplg_name, bus->dev); if (ret < 0) { - dev_info(bus->dev, "tplg fw %s load failed with %d, falling back to dfw_sst.bin", - skl->tplg_name, ret); + char alt_tplg_name[64]; + + snprintf(alt_tplg_name, sizeof(alt_tplg_name), "%s-tplg.bin", + skl->mach->drv_name); + dev_info(bus->dev, "tplg fw %s load failed with %d, trying alternative tplg name %s", + skl->tplg_name, ret, alt_tplg_name); + + ret = request_firmware(&fw, alt_tplg_name, bus->dev); + if (!ret) + goto component_load; + + dev_info(bus->dev, "tplg %s failed with %d, falling back to dfw_sst.bin", + alt_tplg_name, ret); + ret = request_firmware(&fw, "dfw_sst.bin", bus->dev); if (ret < 0) { dev_err(bus->dev, "Fallback tplg fw %s load failed with %d\n", @@ -3575,6 +3588,8 @@ int skl_tplg_init(struct snd_soc_compone } } +component_load: + /* * The complete tplg for SKL is loaded as index 0, we don't use * any other index