Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp536929pxb; Tue, 3 Nov 2020 06:14:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwWexYoY5gc30WIDDqWskLNfSbX6dvlMFsZRSiVb60C8nlwTf7QLDAwk7z0VHKg8OMQzw+9 X-Received: by 2002:a17:906:3fc1:: with SMTP id k1mr2946575ejj.287.1604412879597; Tue, 03 Nov 2020 06:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604412879; cv=none; d=google.com; s=arc-20160816; b=VL9yzi9gwtbs22szO4IPREHi0uAWMFpoAVMc+m5re0dDrYDXFn/yw5virgQn1dTTt6 iyiHWS3sgN8Dl54AhouDwdseMBD6CkSacpzz5t3w54x0ndXWlzW6bKwLM7Gs2DYzyYyW bLZolfdhKuuvEGU0M2LCS508L+MrFIVMk2s/xfMscButy8qjqyDqAU2bpNyet1UOKLRs uVk5AA+ODAnKCGc8Ow2MDMC7WCkheHyM0f+lfpIjXAEwEWTcv3ofOIbYXFoEvLRTr7Zq zoi7sz23/mAWopZOQbjPjSGi7FHpxeQ/aPheuBriF1C3DRWpEnFSq6053QM20azB3RFL e3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=VPvu5rXVacLiBJTgZhNJZGY9MPEl/h9V7XwvNs7+QBk=; b=Y8z1gKgSQ/3v0++Z+4BnyhTq43C0L9kIHbMsS4qQxtgK1lI9MzuFum3Vk28kHaMNSZ wK0TMZVRILIoGGEYiDZFpHUsQnVyJihAGvpbmH/VQIrbd2XKh0r1s1HviMFOsOqNPLRD UhoCuS/55uw7jnN9ZiR00AfzCybtknP6EggNE66oywSjXaV8ms1uPXHpVPs3u6sSVHey ypHjbj8yOObuiLnIe187/+KipUXxBxrv8M+dWOpX8aaaaqvbsfWBwP2TRzqG0wTWyRmQ bUWcTyCKNhixotpnR8UQTNBa5ifIfOld9oPyuQZLtof1gYoUoSf8B9d9Z55B5VUtMiJT PVtA== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si12645577edn.68.2020.11.03.06.14.16; Tue, 03 Nov 2020 06:14:39 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729542AbgKCOKo (ORCPT + 99 others); Tue, 3 Nov 2020 09:10:44 -0500 Received: from mga09.intel.com ([134.134.136.24]:30605 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729420AbgKCOKo (ORCPT ); Tue, 3 Nov 2020 09:10:44 -0500 IronPort-SDR: QmN8ODtTQpfUF+S60lFBbSF8uqmuDNPhR6L5xd4tv8g3ZWy4xNJBPzFHX7U4lGk4w8pH9peu+x pXYfEt93NIBw== X-IronPort-AV: E=McAfee;i="6000,8403,9793"; a="169188549" X-IronPort-AV: E=Sophos;i="5.77,448,1596524400"; d="scan'208";a="169188549" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Nov 2020 06:10:42 -0800 IronPort-SDR: DEX41euAnkeSL9SsYWN8Zce+RWVd0TZ5gp13rj38px2ouN2Yq7jnhiRelUXZybFR1O5MbNN+Z9 TmiXObdr/ZBw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,448,1596524400"; d="scan'208";a="336530104" Received: from mgorski-all-series.igk.intel.com ([10.237.149.201]) by orsmga002.jf.intel.com with ESMTP; 03 Nov 2020 06:10:41 -0800 From: Mateusz Gorski To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: alsa-devel@alsa-project.org, cezary.rojewski@intel.com, Mateusz Gorski , Mark Brown Subject: [PATCH] ASoC: Intel: Skylake: Add alternative topology binary name Date: Tue, 3 Nov 2020 15:10:47 +0100 Message-Id: <20201103141047.15053-1-mateusz.gorski@linux.intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 1b290ef023b3eeb4f4688b582fecb773915ef937 ] 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 --- This functionality is merged on upstream kernel and widely used. Merging it to LTS kernel would improve the user experience and resolve some of the problems regarding topology naming that the users are facing. sound/soc/intel/skylake/skl-topology.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 69cd7a81bf2a..4b114ece58c6 100644 --- 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_component *component, struct hdac_bus *bus) 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_component *component, struct hdac_bus *bus) } } +component_load: + /* * The complete tplg for SKL is loaded as index 0, we don't use * any other index -- 2.17.1