Re: [PATCH 4/4] ASoC: SDCA: class_function: clear sconfig.bps on PDM data-port terminals

From: Charles Keepax

Date: Tue Oct 20 2026 - 06:22:37 EST


On Mon, Oct 19, 2026 at 06:19:10PM +0200, Pierre-Louis Bossart wrote:
>
> >> static int class_function_sdw_add_peripheral(struct snd_pcm_substream *substream,
> >> struct snd_pcm_hw_params *params,
> >> struct snd_soc_dai *dai)
> >> @@ -133,6 +144,7 @@ static int class_function_sdw_add_peripheral(struct snd_pcm_substream *substream
> >> struct class_function_drv *drv = snd_soc_component_get_drvdata(dai->component);
> >> struct sdw_stream_runtime *sdw_stream = snd_soc_dai_get_dma_data(dai, substream);
> >> struct sdw_slave *sdw = dev_to_sdw_dev(drv->dev->parent);
> >> + struct sdca_entity *entity = &drv->function->entities[dai->id];
> >> struct sdw_stream_config sconfig = {0};
> >> struct sdw_port_config pconfig = {0};
> >> int ret;
> >> @@ -152,6 +164,9 @@ static int class_function_sdw_add_peripheral(struct snd_pcm_substream *substream
> >>
> >> pconfig.num = ret;
> >>
> >> + if (class_function_terminal_is_pdm(entity->iot.type))
> >> + sconfig.bps = 0;
> >
> > I think this is fine, as you say bps makes no sense for a PDM
> > stream but I might need to spend a little more time working out
> > how this all propagates through the core. I guess my concern is
> > if other drivers don't handle PDM in the same way.
>
> It's a bit odd to rely on bps when we already have a type for the stream
> in struct sdw_stream_config:
>
> @type: Stream type PCM, PDM or BPT

Thanks Pierre, I had a feeling I was missing something here :-)

Thanks,
Charles