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

From: Srinivas Kandagatla

Date: Tue Oct 20 2026 - 03:25:18 EST


On 10/19/26 5:19 PM, 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:
its the stream.c which checks bps without type check, i have now updated
stream.c to use type check in this code path.

--srini
>
> @type: Stream type PCM, PDM or BPT
>
>
>