diff options
-rw-r--r-- | sound/soc/intel/skylake/skl-nhlt.c | 34 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl-topology.c | 11 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.c | 4 | ||||
-rw-r--r-- | sound/soc/intel/skylake/skl.h | 3 |
4 files changed, 49 insertions, 3 deletions
diff --git a/sound/soc/intel/skylake/skl-nhlt.c b/sound/soc/intel/skylake/skl-nhlt.c index 6e4b21cdb1bd..14d1916ea9f8 100644 --- a/sound/soc/intel/skylake/skl-nhlt.c +++ b/sound/soc/intel/skylake/skl-nhlt.c | |||
@@ -145,3 +145,37 @@ struct nhlt_specific_cfg | |||
145 | 145 | ||
146 | return NULL; | 146 | return NULL; |
147 | } | 147 | } |
148 | |||
149 | static void skl_nhlt_trim_space(struct skl *skl) | ||
150 | { | ||
151 | char *s = skl->tplg_name; | ||
152 | int cnt; | ||
153 | int i; | ||
154 | |||
155 | cnt = 0; | ||
156 | for (i = 0; s[i]; i++) { | ||
157 | if (!isspace(s[i])) | ||
158 | s[cnt++] = s[i]; | ||
159 | } | ||
160 | |||
161 | s[cnt] = '\0'; | ||
162 | } | ||
163 | |||
164 | int skl_nhlt_update_topology_bin(struct skl *skl) | ||
165 | { | ||
166 | struct nhlt_acpi_table *nhlt = (struct nhlt_acpi_table *)skl->nhlt; | ||
167 | struct hdac_bus *bus = ebus_to_hbus(&skl->ebus); | ||
168 | struct device *dev = bus->dev; | ||
169 | |||
170 | dev_dbg(dev, "oem_id %.6s, oem_table_id %8s oem_revision %d\n", | ||
171 | nhlt->header.oem_id, nhlt->header.oem_table_id, | ||
172 | nhlt->header.oem_revision); | ||
173 | |||
174 | snprintf(skl->tplg_name, sizeof(skl->tplg_name), "%x-%.6s-%.8s-%d%s", | ||
175 | skl->pci_id, nhlt->header.oem_id, nhlt->header.oem_table_id, | ||
176 | nhlt->header.oem_revision, "-tplg.bin"); | ||
177 | |||
178 | skl_nhlt_trim_space(skl); | ||
179 | |||
180 | return 0; | ||
181 | } | ||
diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 216d7a8e5680..ba0d02d1613e 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c | |||
@@ -1716,11 +1716,16 @@ int skl_tplg_init(struct snd_soc_platform *platform, struct hdac_ext_bus *ebus) | |||
1716 | struct hdac_bus *bus = ebus_to_hbus(ebus); | 1716 | struct hdac_bus *bus = ebus_to_hbus(ebus); |
1717 | struct skl *skl = ebus_to_skl(ebus); | 1717 | struct skl *skl = ebus_to_skl(ebus); |
1718 | 1718 | ||
1719 | ret = request_firmware(&fw, "dfw_sst.bin", bus->dev); | 1719 | ret = request_firmware(&fw, skl->tplg_name, bus->dev); |
1720 | if (ret < 0) { | 1720 | if (ret < 0) { |
1721 | dev_err(bus->dev, "tplg fw %s load failed with %d\n", | 1721 | dev_err(bus->dev, "tplg fw %s load failed with %d\n", |
1722 | "dfw_sst.bin", ret); | 1722 | skl->tplg_name, ret); |
1723 | return ret; | 1723 | ret = request_firmware(&fw, "dfw_sst.bin", bus->dev); |
1724 | if (ret < 0) { | ||
1725 | dev_err(bus->dev, "Fallback tplg fw %s load failed with %d\n", | ||
1726 | "dfw_sst.bin", ret); | ||
1727 | return ret; | ||
1728 | } | ||
1724 | } | 1729 | } |
1725 | 1730 | ||
1726 | /* | 1731 | /* |
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c index 06f4b2c13423..f89abb179efe 100644 --- a/sound/soc/intel/skylake/skl.c +++ b/sound/soc/intel/skylake/skl.c | |||
@@ -573,11 +573,15 @@ static int skl_probe(struct pci_dev *pci, | |||
573 | if (err < 0) | 573 | if (err < 0) |
574 | goto out_free; | 574 | goto out_free; |
575 | 575 | ||
576 | skl->pci_id = pci->device; | ||
577 | |||
576 | skl->nhlt = skl_nhlt_init(bus->dev); | 578 | skl->nhlt = skl_nhlt_init(bus->dev); |
577 | 579 | ||
578 | if (skl->nhlt == NULL) | 580 | if (skl->nhlt == NULL) |
579 | goto out_free; | 581 | goto out_free; |
580 | 582 | ||
583 | skl_nhlt_update_topology_bin(skl); | ||
584 | |||
581 | pci_set_drvdata(skl->pci, ebus); | 585 | pci_set_drvdata(skl->pci, ebus); |
582 | 586 | ||
583 | /* check if dsp is there */ | 587 | /* check if dsp is there */ |
diff --git a/sound/soc/intel/skylake/skl.h b/sound/soc/intel/skylake/skl.h index 4d18293b5537..1ca1911f1587 100644 --- a/sound/soc/intel/skylake/skl.h +++ b/sound/soc/intel/skylake/skl.h | |||
@@ -73,6 +73,8 @@ struct skl { | |||
73 | struct list_head ppl_list; | 73 | struct list_head ppl_list; |
74 | 74 | ||
75 | const char *fw_name; | 75 | const char *fw_name; |
76 | char tplg_name[64]; | ||
77 | unsigned short pci_id; | ||
76 | const struct firmware *tplg; | 78 | const struct firmware *tplg; |
77 | 79 | ||
78 | int supend_active; | 80 | int supend_active; |
@@ -96,6 +98,7 @@ void skl_nhlt_free(void *addr); | |||
96 | struct nhlt_specific_cfg *skl_get_ep_blob(struct skl *skl, u32 instance, | 98 | struct nhlt_specific_cfg *skl_get_ep_blob(struct skl *skl, u32 instance, |
97 | u8 link_type, u8 s_fmt, u8 no_ch, u32 s_rate, u8 dirn); | 99 | u8 link_type, u8 s_fmt, u8 no_ch, u32 s_rate, u8 dirn); |
98 | 100 | ||
101 | int skl_nhlt_update_topology_bin(struct skl *skl); | ||
99 | int skl_init_dsp(struct skl *skl); | 102 | int skl_init_dsp(struct skl *skl); |
100 | void skl_free_dsp(struct skl *skl); | 103 | void skl_free_dsp(struct skl *skl); |
101 | int skl_suspend_dsp(struct skl *skl); | 104 | int skl_suspend_dsp(struct skl *skl); |