From patchwork Mon Nov 9 12:55:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 322662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 125F0C56202 for ; Mon, 9 Nov 2020 13:29:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B7B5721D7F for ; Mon, 9 Nov 2020 13:29:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604928542; bh=JxC5bddqapCCWZTkXed8pvD3gk2KGlQJJha3wVJqFRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=G8X/vo35e7FJQ+Fw6rmgoZHx54JQrumr7VKipaDEYwT+FTlBSXNZXhpJs4VQSxx1P E/EsQ3tJ3B5cPUx9U6iW8MWkR1EPUv9PGjpNRg2E7mNbqfhC5BFfIaYNpqBN/uorM/ GlTQgm2RaGrjdp7fCQQ/Z4J7Y6Whl/r+n9uqIwAg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731865AbgKIN3B (ORCPT ); Mon, 9 Nov 2020 08:29:01 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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