Skip to content

Commit 87b2652

Browse files
Piotr Maziarzbroonie
authored andcommitted
ASoC: Intel: Skylake: Select proper format for NHLT blob
Use actual pipeline format, not PCM format for blob selection. Otherwise selected blobs are not correct in pipelines with format conversion e.g.: SRC module. Signed-off-by: Piotr Maziarz <[email protected]> Signed-off-by: Lewandowski, Gustaw <[email protected]> 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 126b342 commit 87b2652

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

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

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,14 +1821,16 @@ static u8 skl_tplg_be_link_type(int dev_type)
18211821
* Fill the BE gateway parameters
18221822
* The BE gateway expects a blob of parameters which are kept in the ACPI
18231823
* NHLT blob, so query the blob for interface type (i2s/pdm) and instance.
1824-
* The port can have multiple settings so pick based on the PCM
1824+
* The port can have multiple settings so pick based on the pipeline
18251825
* parameters
18261826
*/
18271827
static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,
18281828
struct skl_module_cfg *mconfig,
18291829
struct skl_pipe_params *params)
18301830
{
18311831
struct nhlt_specific_cfg *cfg;
1832+
struct skl_pipe *pipe = mconfig->pipe;
1833+
struct skl_pipe_fmt *pipe_fmt;
18321834
struct skl_dev *skl = get_skl_ctx(dai->dev);
18331835
int link_type = skl_tplg_be_link_type(mconfig->dev_type);
18341836
u8 dev_type = skl_tplg_be_dev_type(mconfig->dev_type);
@@ -1838,20 +1840,23 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai,
18381840
if (link_type == NHLT_LINK_HDA)
18391841
return 0;
18401842

1843+
if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK)
1844+
pipe_fmt = &pipe->configs[pipe->pipe_config_idx].out_fmt;
1845+
else
1846+
pipe_fmt = &pipe->configs[pipe->pipe_config_idx].in_fmt;
1847+
18411848
/* update the blob based on virtual bus_id*/
18421849
cfg = skl_get_ep_blob(skl, mconfig->vbus_id, link_type,
1843-
params->s_fmt, params->ch,
1844-
params->s_freq, params->stream,
1850+
pipe_fmt->bps, pipe_fmt->channels,
1851+
pipe_fmt->freq, pipe->direction,
18451852
dev_type);
18461853
if (cfg) {
18471854
mconfig->formats_config.caps_size = cfg->size;
18481855
mconfig->formats_config.caps = (u32 *) &cfg->caps;
18491856
} else {
1850-
dev_err(dai->dev, "Blob NULL for id %x type %d dirn %d\n",
1851-
mconfig->vbus_id, link_type,
1852-
params->stream);
1853-
dev_err(dai->dev, "PCM: ch %d, freq %d, fmt %d\n",
1854-
params->ch, params->s_freq, params->s_fmt);
1857+
dev_err(dai->dev, "Blob NULL for id:%d type:%d dirn:%d ch:%d, freq:%d, fmt:%d\n",
1858+
mconfig->vbus_id, link_type, params->stream,
1859+
params->ch, params->s_freq, params->s_fmt);
18551860
return -EINVAL;
18561861
}
18571862

0 commit comments

Comments
 (0)