summaryrefslogtreecommitdiff
path: root/sound/soc/sof
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-04-09 19:39:32 +0100
committerMark Brown <broonie@kernel.org>2026-04-09 19:39:32 +0100
commitc822e308c32588a9b52edc2394303d14f675330c (patch)
tree5199ed8336a6fe76ce4daf5bea6877d41a26d1d6 /sound/soc/sof
parentf4ee8a882a560308c390cf45ffa616c59f60a731 (diff)
parent87ceac0a98e92f4efd031b5b9ab49ab5645d1c7e (diff)
ASoC: Yet another round of SDCA fixes
Charles Keepax <ckeepax@opensource.cirrus.com> says: Another round of SDCA fixes a couple of fix to the IRQ cleanup from Richard, and a minor tweak to the IRQ handling from me.
Diffstat (limited to 'sound/soc/sof')
-rw-r--r--sound/soc/sof/intel/hda-pcm.c14
-rw-r--r--sound/soc/sof/intel/hda.c10
2 files changed, 16 insertions, 8 deletions
diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c
index da6c1e7263cd..16a364072821 100644
--- a/sound/soc/sof/intel/hda-pcm.c
+++ b/sound/soc/sof/intel/hda-pcm.c
@@ -219,6 +219,7 @@ EXPORT_SYMBOL_NS(hda_dsp_pcm_pointer, "SND_SOC_SOF_INTEL_HDA_COMMON");
int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
struct snd_pcm_substream *substream)
{
+ const struct sof_intel_dsp_desc *chip_info = get_chip_info(sdev->pdata);
struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_soc_component *scomp = sdev->component;
@@ -268,8 +269,17 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev,
return -ENODEV;
}
- /* minimum as per HDA spec */
- snd_pcm_hw_constraint_step(substream->runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
+ /*
+ * Set period size constraint to ensure BDLE buffer length and
+ * start address alignment requirements are met. Align to 128
+ * bytes for newer Intel platforms, with older ones using 4 byte alignment.
+ */
+ if (chip_info->hw_ip_version >= SOF_INTEL_ACE_4_0)
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 128);
+ else
+ snd_pcm_hw_constraint_step(substream->runtime, 0,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 4);
/* avoid circular buffer wrap in middle of period */
snd_pcm_hw_constraint_integer(substream->runtime,
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index edb80c2fa770..b3d61d973ce4 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -1133,8 +1133,7 @@ static void hda_generic_machine_select(struct snd_sof_dev *sdev,
#if IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
-static bool is_endpoint_present(struct sdw_slave *sdw_device,
- struct asoc_sdw_codec_info *dai_info, int dai_type)
+static bool is_endpoint_present(struct sdw_slave *sdw_device, int dai_type)
{
int i;
@@ -1145,7 +1144,7 @@ static bool is_endpoint_present(struct sdw_slave *sdw_device,
}
for (i = 0; i < sdw_device->sdca_data.num_functions; i++) {
- if (dai_type == dai_info->dais[i].dai_type)
+ if (dai_type == asoc_sdw_get_dai_type(sdw_device->sdca_data.function[i].type))
return true;
}
dev_dbg(&sdw_device->dev, "Endpoint DAI type %d not found\n", dai_type);
@@ -1202,11 +1201,10 @@ static struct snd_soc_acpi_adr_device *find_acpi_adr_device(struct device *dev,
}
for (j = 0; j < codec_info_list[i].dai_num; j++) {
/* Check if the endpoint is present by the SDCA DisCo table */
- if (!is_endpoint_present(sdw_device, &codec_info_list[i],
- codec_info_list[i].dais[j].dai_type))
+ if (!is_endpoint_present(sdw_device, codec_info_list[i].dais[j].dai_type))
continue;
- endpoints[ep_index].num = ep_index;
+ endpoints[ep_index].num = j;
if (codec_info_list[i].dais[j].dai_type == SOC_SDW_DAI_TYPE_AMP) {
/* Assume all amp are aggregated */
endpoints[ep_index].aggregated = 1;