From patchwork Wed Mar 25 12:22:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gorski, Mateusz" X-Patchwork-Id: 11457667 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEDB41668 for ; Wed, 25 Mar 2020 12:26:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6699E20772 for ; Wed, 25 Mar 2020 12:26:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="jVhbz+AS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6699E20772 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A1B88166D; Wed, 25 Mar 2020 13:25:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A1B88166D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1585139182; bh=+JptXENJ2gohJ4c6qTXqfGzc7PC7D/UUS7yTnlvZaL4=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=jVhbz+ASTA3oGzumkApUxzRCrgsR1v2pYOdqPOHpU6zj69Vna53YWh7MUj68yXW+0 bVmR9RXyS2u6IJQs/whjRbotUpixogXS9so55sMhec8kykChk9U5w6pV+6C9luV5ME LiJKnEr/bkJ4+06+CjXCal75COPYcvMUB7Nwc3xE= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 64F9EF802E8; Wed, 25 Mar 2020 13:22:06 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A7216F802E9; Wed, 25 Mar 2020 13:22:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1991EF802E7 for ; Wed, 25 Mar 2020 13:22:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1991EF802E7 IronPort-SDR: Vk601eeKH+Vw/lWJWNO9gdv3t3qwzIAKyGet0PwrOHB1I1CYYo56slU3Q8rHMQFuyR/msVYUyd slL/sAE9yZfQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2020 05:21:58 -0700 IronPort-SDR: dZvpV2+b0UB76dNnLHczWebXpuD1TCQv0F1mTZybPhzF3oEK8cVnnUqVQ8tEWVvZ3ckKIItQDu 5eJEHN4+E03g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,304,1580803200"; d="scan'208";a="265498005" Received: from mgorski-all-series.igk.intel.com ([10.237.149.201]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2020 05:21:56 -0700 From: Mateusz Gorski To: alsa-devel@alsa-project.org Subject: [PATCH] ASoC: Intel: Skylake: Add alternative topology binary name Date: Wed, 25 Mar 2020 13:22:30 +0100 Message-Id: <20200325122230.12172-1-mateusz.gorski@linux.intel.com> X-Mailer: git-send-email 2.17.1 Cc: cezary.rojewski@intel.com, Mateusz Gorski , tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This commit adds 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. Signed-off-by: Mateusz Gorski --- 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..344b06df0e15 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -3565,8 +3565,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->i2s_dev->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 +3587,9 @@ 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