clear-pkgs-linux-iot-lts2018/0165-Load-nhlt-from-firmwar...

67 lines
2.0 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Guneshwor Singh <guneshwor.o.singh@intel.com>
Date: Thu, 14 Apr 2016 12:02:14 +0530
Subject: [PATCH] Load nhlt from firmware instead of debugfs
Change-Id: I316804db785699f28359b35455790c95cccacd10
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
Reviewed-on:
Reviewed-by: Shah, Hardik T <hardik.t.shah@intel.com>
Tested-by: Shah, Hardik T <hardik.t.shah@intel.com>
Signed-off-by: Guneshwor Singh <guneshwor.o.singh@intel.com>
---
sound/soc/intel/skylake/skl.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
2020-10-27 02:14:06 +08:00
index 50f16a0f6535..e2b9c7ce2a75 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -886,6 +886,7 @@ static int skl_probe(struct pci_dev *pci,
{
struct skl *skl;
struct hdac_bus *bus = NULL;
+ const struct firmware __maybe_unused *nhlt_fw = NULL;
int err;
/* we use ext core ops, so provide NULL for ops here */
@@ -903,6 +904,8 @@ static int skl_probe(struct pci_dev *pci,
device_disable_async_suspend(bus->dev);
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_CNL_FPGA)
+ skl->nhlt_version = skl_get_nhlt_version(bus->dev);
skl->nhlt = skl_nhlt_init(bus->dev);
if (skl->nhlt == NULL) {
@@ -916,7 +919,25 @@ static int skl_probe(struct pci_dev *pci,
skl_nhlt_update_topology_bin(skl);
- pci_set_drvdata(skl->pci, bus);
+#else
+ if (request_firmware(&nhlt_fw, "intel/nhlt_blob.bin", bus->dev)) {
+ dev_err(bus->dev, "Request nhlt fw failed, continuing..\n");
+ goto nhlt_continue;
+ }
+
+ skl->nhlt = devm_kzalloc(&pci->dev, nhlt_fw->size, GFP_KERNEL);
+ if (skl->nhlt == NULL)
+ return -ENOMEM;
+ memcpy(skl->nhlt, nhlt_fw->data, nhlt_fw->size);
+ release_firmware(nhlt_fw);
+
+nhlt_continue:
+#endif
+ pci_set_drvdata(skl->pci, ebus);
+
+#if !IS_ENABLED(CONFIG_SND_SOC_INTEL_CNL_FPGA)
+ skl_dmic_data.dmic_num = skl_get_dmic_geo(skl);
+#endif
/* check if dsp is there */
if (bus->ppcap) {
--
https://clearlinux.org