@@ -1821,14 +1821,16 @@ static u8 skl_tplg_be_link_type(int dev_type)
1821
1821
* Fill the BE gateway parameters
1822
1822
* The BE gateway expects a blob of parameters which are kept in the ACPI
1823
1823
* 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
1825
1825
* parameters
1826
1826
*/
1827
1827
static int skl_tplg_be_fill_pipe_params (struct snd_soc_dai * dai ,
1828
1828
struct skl_module_cfg * mconfig ,
1829
1829
struct skl_pipe_params * params )
1830
1830
{
1831
1831
struct nhlt_specific_cfg * cfg ;
1832
+ struct skl_pipe * pipe = mconfig -> pipe ;
1833
+ struct skl_pipe_fmt * pipe_fmt ;
1832
1834
struct skl_dev * skl = get_skl_ctx (dai -> dev );
1833
1835
int link_type = skl_tplg_be_link_type (mconfig -> dev_type );
1834
1836
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,
1838
1840
if (link_type == NHLT_LINK_HDA )
1839
1841
return 0 ;
1840
1842
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
+
1841
1848
/* update the blob based on virtual bus_id*/
1842
1849
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 ,
1845
1852
dev_type );
1846
1853
if (cfg ) {
1847
1854
mconfig -> formats_config .caps_size = cfg -> size ;
1848
1855
mconfig -> formats_config .caps = (u32 * ) & cfg -> caps ;
1849
1856
} 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 );
1855
1860
return - EINVAL ;
1856
1861
}
1857
1862
0 commit comments