Skip to content

Commit 72d9a54

Browse files
crojewsk-intelbroonie
authored andcommitted
ASoC: Intel: Skylake: Update pipe_config_idx before filling BE params
Without updating the index before BE copier config is filled with hardware parameters, outdated parameters are used instead. Signed-off-by: Cezary Rojewski <[email protected]> Tested-by: Lukasz Majczak <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 8e378ea commit 72d9a54

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

sound/soc/intel/skylake/skl-topology.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,16 +1837,24 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,
18371837
{
18381838
struct nhlt_specific_cfg *cfg;
18391839
struct skl_pipe *pipe = mconfig->pipe;
1840+
struct skl_pipe_params save = *pipe->p_params;
18401841
struct skl_pipe_fmt *pipe_fmt;
18411842
struct skl_dev *skl = get_skl_ctx(dai->dev);
18421843
int link_type = skl_tplg_be_link_type(mconfig->dev_type);
18431844
u8 dev_type = skl_tplg_be_dev_type(mconfig->dev_type);
1845+
int ret;
18441846

18451847
skl_tplg_fill_dma_id(mconfig, params);
18461848

18471849
if (link_type == NHLT_LINK_HDA)
18481850
return 0;
18491851

1852+
*pipe->p_params = *params;
1853+
ret = skl_tplg_get_pipe_config(skl, mconfig);
1854+
if (ret)
1855+
goto err;
1856+
1857+
dev_dbg(skl->dev, "%s using pipe config: %d\n", __func__, pipe->pipe_config_idx);
18501858
if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK)
18511859
pipe_fmt = &pipe->configs[pipe->pipe_config_idx].out_fmt;
18521860
else
@@ -1865,10 +1873,15 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,
18651873
dev_err(dai->dev, "Blob NULL for id:%d type:%d dirn:%d ch:%d, freq:%d, fmt:%d\n",
18661874
mconfig->vbus_id, link_type, params->stream,
18671875
params->ch, params->s_freq, params->s_fmt);
1868-
return -EINVAL;
1876+
ret = -EINVAL;
1877+
goto err;
18691878
}
18701879

18711880
return 0;
1881+
1882+
err:
1883+
*pipe->p_params = save;
1884+
return ret;
18721885
}
18731886

18741887
static int skl_tplg_be_set_src_pipe_params(struct snd_soc_dai *dai,

0 commit comments

Comments
 (0)