Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp304029pxx; Wed, 28 Oct 2020 05:28:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypOAz1/zi769L/QY0na+RZzMujI+dW/h66uckAJIzlcb+hWv9HhGu3fww5dBHIFBj59i4q X-Received: by 2002:a50:e61a:: with SMTP id y26mr7631353edm.71.1603888082670; Wed, 28 Oct 2020 05:28:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603888082; cv=none; d=google.com; s=arc-20160816; b=N6mdO+mZxnCvZbAsL78M00LRiNB+XPy0BMnUyl1mEpGEXOaXUx/ageq/S7TKvoSrLp zkYtcCI3yBdH/iFxUjSJRpz7hC/huJHUhtJzLV4t4iwREyuZB88y0YaO/6gC4OT09bTH RfQ78rsK19Jv/Tfo6zl35VFa6u66xp67zelNsuRCKTtS56UgPtYZ8fYv+puKg336c9WD a6SfBH4OpASkhp+B9o7kXIgJWTEegaDT7J9l6BKMYDPAt6n4JD+06QRy2Zr8siRkMBO8 xpR536q8LRqWTsCfzsIiEdWyun1MzvYYeQFP7jlbPMtUDlpvpX66PJoABrkVIFW1j8E0 5aOg== 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=CkgLxVgo6s5fYyealBxXNFxPniF3/hOpyWe7BPF4zSw=; b=qCsKfwFoEH4lv6qRLpY452WEKTmtyFQ5EMXYrLC9jWbkiIl3ba2tQuUJ6M7DI97fgT COmPe/Pp4GIhOwTtrbUbsdhrqZmsCfUE3EiE9miRAjku/32VyVW+CtksTqdy3/sTvCYC Lpr30S+y2kFXK1HmUE3ZAKq+NR4++a0kF/ZJmP71KLfbO7ZLcri1wdqAOyfVmhk45uyw kQnEFW+IisAFgVICB5es7VJ56O60CO/jVCZwMa4OnsEJ+fZ0846fh2UqoWhRPs0RXv+1 tFEzCKKh/TeNUQFTnKuZxpAJMF7/h8Qp2JMX441tzjzuwIe0zMGGUZyRFC9sr3VEbDUD 2LGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="pNP//BiF"; 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 l12si2820211edk.163.2020.10.28.05.27.40; Wed, 28 Oct 2020 05:28:02 -0700 (PDT) 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="pNP//BiF"; 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 S1796974AbgJ0PUy (ORCPT + 99 others); Tue, 27 Oct 2020 11:20:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:55050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796351AbgJ0PRj (ORCPT ); Tue, 27 Oct 2020 11:17:39 -0400 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 1F79D2064B; Tue, 27 Oct 2020 15:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811857; bh=P53ED4BShvDlilS5vert2xbkgwQD01dU3Jv7kDeWyIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pNP//BiFagG3QLLNn6ZOLgLBGfVRgR/OVfw/9MwgT98FBq3JuyQmfHeEkywVorAdI NT2RxFfbSqsIJN15zQQjBDLr0dCPOxW8VGwFjsJhHmCIu2wpRDXE9uc4cKa4T4z+SV dmXw2O3yRYpDWalpsZ6ha0TQgEsq8UjVi1S1HkqA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guennadi Liakhovetski , Sathyanarayana Nujella , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 5.8 614/633] ASoC: SOF: Add topology filename override based on dmi data match Date: Tue, 27 Oct 2020 14:55:57 +0100 Message-Id: <20201027135551.630275536@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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: Sathyanarayana Nujella [ Upstream commit 5253a73d567dcd75e62834ff5f502ea9470e5722 ] Add topology filename override based on system DMI data matching, typically to account for a different hardware layout. In ACPI based systems, the tplg_filename is pre-defined in an ACPI machine table. When a DMI quirk is detected, the sof_pdata->tplg_filename is not set with the hard-coded ACPI value, and instead is set with the DMI-specific filename. Reviewed-by: Guennadi Liakhovetski Signed-off-by: Sathyanarayana Nujella Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200821195603.215535-14-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/sof/intel/hda.c | 8 +++++++- sound/soc/sof/sof-pci-dev.c | 24 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 63ca920c8e6e0..7152e6d1cf673 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -1179,7 +1179,13 @@ void hda_machine_select(struct snd_sof_dev *sdev) mach = snd_soc_acpi_find_machine(desc->machines); if (mach) { - sof_pdata->tplg_filename = mach->sof_tplg_filename; + /* + * If tplg file name is overridden, use it instead of + * the one set in mach table + */ + if (!sof_pdata->tplg_filename) + sof_pdata->tplg_filename = mach->sof_tplg_filename; + sof_pdata->machine = mach; if (mach->link_mask) { diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index aa3532ba14349..f3a8140773db5 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -35,8 +35,28 @@ static int sof_pci_debug; module_param_named(sof_pci_debug, sof_pci_debug, int, 0444); MODULE_PARM_DESC(sof_pci_debug, "SOF PCI debug options (0x0 all off)"); +static const char *sof_override_tplg_name; + #define SOF_PCI_DISABLE_PM_RUNTIME BIT(0) +static int sof_tplg_cb(const struct dmi_system_id *id) +{ + sof_override_tplg_name = id->driver_data; + return 1; +} + +static const struct dmi_system_id sof_tplg_table[] = { + { + .callback = sof_tplg_cb, + .matches = { + DMI_MATCH(DMI_PRODUCT_FAMILY, "Google_Volteer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Terrador"), + }, + .driver_data = "sof-tgl-rt5682-ssp0-max98373-ssp2.tplg", + }, + {} +}; + static const struct dmi_system_id community_key_platforms[] = { { .ident = "Up Squared", @@ -347,6 +367,10 @@ static int sof_pci_probe(struct pci_dev *pci, sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path; + dmi_check_system(sof_tplg_table); + if (sof_override_tplg_name) + sof_pdata->tplg_filename = sof_override_tplg_name; + #if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE) /* set callback to enable runtime_pm */ sof_pdata->sof_probe_complete = sof_pci_probe_complete; -- 2.25.1