[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b57b8fbe-c558-8d5d-5fb3-7540d2fa83ae@metafoo.de>
Date: Thu, 16 Feb 2023 05:53:34 -0800
From: Lars-Peter Clausen <lars@...afoo.de>
To: Claudiu.Beznea@...rochip.com, broonie@...nel.org
Cc: lgirdwood@...il.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, perex@...ex.cz, tiwai@...e.com,
Nicolas.Ferre@...rochip.com, alexandre.belloni@...tlin.com,
alsa-devel@...a-project.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/3] ASoC: soc-generic-dmaengine-pcm: add option to start
DMA after DAI
On 2/16/23 01:49, Claudiu.Beznea@...rochip.com wrote:
> On 14.02.2023 23:26, Mark Brown wrote:
>> On Tue, Feb 14, 2023 at 10:14:28AM -0800, Lars-Peter Clausen wrote:
>>> On 2/14/23 08:14, Claudiu Beznea wrote:
>>>> @@ -450,6 +450,8 @@ int snd_dmaengine_pcm_register(struct device *dev,
>>>> else
>>>> driver = &dmaengine_pcm_component;
>>>> + driver->start_dma_last = config->start_dma_last;
>>> This will break if you have multiple sound cards in the system.
>>> dmaengine_pcm_component must stay const.
>> Right, if we need to modify it we either need to select which of
>> multiple const structs to register or to take a copy and modify
>> that. I've not looked at the actual changes yet.
> OK, I will try that and return with a new patch.
>
> On the other hand do you think the other solution presented in cover letter
> would be better? From the cover letter:
>
> "The other solution that was identified for this was to extend the already
> existing mechanism around struct snd_soc_dai_link::stop_dma_first. The downside
> of this was that a potential struct snd_soc_dai_link::start_dma_last
> would have to be populated on sound card driver thus, had to be taken
> into account in all sound card drivers. At the moment, the mchp-pdmc is
> used only with simple-audio-card. In case of simple-audio-card a new DT
> binding would had to be introduced to specify this action on dai-link
> descriptions (as of my investigation)."
>
Can't you just set `start_dma_last` on the `mchp_pdmc_dai_component`? In
your code you iterate over all the components of the link and if any of
them has it set the DMA is started last.
Powered by blists - more mailing lists