Skip to content

Commit 9a068c4

Browse files
committed
ASoC: SOF: ipc4-topology: fixes for 'exotic' format
Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>: The introduction of 8bit and FLOAT formats missed to cover the new corner cases they cause when the NHLT blobs are looked up. The two patch in this series fixes the 8bit and FLOAT format caused cases to be able to find the correct blob from NHLT.
2 parents e3b8865 + 816f291 commit 9a068c4

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,11 +1752,9 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
17521752
channel_count = params_channels(params);
17531753
sample_rate = params_rate(params);
17541754
bit_depth = params_width(params);
1755-
/*
1756-
* Look for 32-bit blob first instead of 16-bit if copier
1757-
* supports multiple formats
1758-
*/
1759-
if (bit_depth == 16 && !single_bitdepth) {
1755+
1756+
/* Prefer 32-bit blob if copier supports multiple formats */
1757+
if (bit_depth <= 16 && !single_bitdepth) {
17601758
dev_dbg(sdev->dev, "Looking for 32-bit blob first for DMIC\n");
17611759
format_change = true;
17621760
bit_depth = 32;
@@ -1799,10 +1797,18 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
17991797
if (format_change) {
18001798
/*
18011799
* The 32-bit blob was not found in NHLT table, try to
1802-
* look for one based on the params
1800+
* look for 16-bit for DMIC or based on the params for
1801+
* SSP
18031802
*/
1804-
bit_depth = params_width(params);
1805-
format_change = false;
1803+
if (linktype == SOF_DAI_INTEL_DMIC) {
1804+
bit_depth = 16;
1805+
if (params_width(params) == 16)
1806+
format_change = false;
1807+
} else {
1808+
bit_depth = params_width(params);
1809+
format_change = false;
1810+
}
1811+
18061812
get_new_blob = true;
18071813
} else if (linktype == SOF_DAI_INTEL_DMIC && !single_bitdepth) {
18081814
/*
@@ -1837,7 +1843,7 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
18371843
*len = cfg->size >> 2;
18381844
*dst = (u32 *)cfg->caps;
18391845

1840-
if (format_change) {
1846+
if (format_change || params_format(params) == SNDRV_PCM_FORMAT_FLOAT_LE) {
18411847
/*
18421848
* Update the params to reflect that different blob was loaded
18431849
* instead of the requested bit depth (16 -> 32 or 32 -> 16).

0 commit comments

Comments
 (0)