summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>2025-12-15 15:06:47 +0300
committerMark Brown <broonie@kernel.org>2025-12-15 17:07:21 +0300
commit26e455064983e00013c0a63ffe0eed9e9ec2fa89 (patch)
treea072c0a7dd15706a0385fec6be1ec30aababe08e
parent8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff)
downloadlinux-26e455064983e00013c0a63ffe0eed9e9ec2fa89.tar.xz
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: c04c2e829649 ("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>
-rw-r--r--sound/soc/sof/ipc4-topology.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 221e9d4052b8..47959f182f4b 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -1752,11 +1752,9 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
channel_count = params_channels(params);
sample_rate = params_rate(params);
bit_depth = params_width(params);
- /*
- * Look for 32-bit blob first instead of 16-bit if copier
- * supports multiple formats
- */
- if (bit_depth == 16 && !single_bitdepth) {
+
+ /* Prefer 32-bit blob if copier supports multiple formats */
+ if (bit_depth <= 16 && !single_bitdepth) {
dev_dbg(sdev->dev, "Looking for 32-bit blob first for DMIC\n");
format_change = true;
bit_depth = 32;
@@ -1799,10 +1797,18 @@ snd_sof_get_nhlt_endpoint_data(struct snd_sof_dev *sdev, struct snd_sof_dai *dai
if (format_change) {
/*
* The 32-bit blob was not found in NHLT table, try to
- * look for one based on the params
+ * look for 16-bit for DMIC or based on the params for
+ * SSP
*/
- bit_depth = params_width(params);
- format_change = false;
+ if (linktype == SOF_DAI_INTEL_DMIC) {
+ bit_depth = 16;
+ if (params_width(params) == 16)
+ format_change = false;
+ } else {
+ bit_depth = params_width(params);
+ format_change = false;
+ }
+
get_new_blob = true;
} else if (linktype == SOF_DAI_INTEL_DMIC && !single_bitdepth) {
/*