Skip to content

Commit 26e4550

Browse files
ujfalusibroonie
authored andcommitted
ASoC: SOF: ipc4-topology: Prefer 32-bit DMIC blobs for 8-bit formats as well
With the introduction of 8-bit formats the DMIC blob lookup also needs to be modified to prefer the 32-bit blob when 8-bit format is used on FE. At the same time we also need to make sure that in case 8-bit format is used, but only 16-bit blob is available for DMIC then we will not try to look for 8-bit blob (which is invalid) as fallback, but for a 16-bit one. Fixes: c04c2e8 ("ASoC: SOF: ipc4-topology: Add support for 8-bit formats") Cc: stable@vger.kernel.org Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://patch.msgid.link/20251215120648.4827-2-peter.ujfalusi@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 8f0b4cc commit 26e4550

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

sound/soc/sof/ipc4-topology.c

Lines changed: 14 additions & 8 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
/*

0 commit comments

Comments
 (0)