From: Lars-Peter Clausen <lars@metafoo.de>
To: Nicolin Chen <b42378@freescale.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org,
lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: generic-dmaengine-pcm: Add an interface to override its functions
Date: Tue, 15 Oct 2013 11:02:44 +0200 [thread overview]
Message-ID: <525D04B4.3050606@metafoo.de> (raw)
In-Reply-To: <20131015082229.GA18714@MrMyself>
On 10/15/2013 10:22 AM, Nicolin Chen wrote:
> Hi Lars,
>
> On Tue, Oct 15, 2013 at 10:08:52AM +0200, Lars-Peter Clausen wrote:
>> On 10/15/2013 09:49 AM, Nicolin Chen wrote:
>>> Each implementation of gerneric pcm dmaengine has been naturally
>>> limited by the pre-defined gerneric functions. Thus add an extra
>>> interface for user to create a backdoor so that they can override
>>> those fixed functions for some uncommon requirements: using on-chip
>>> memory for DMA buffers and accordingly different mmap function for
>>> example, while at the meantime, they can continue to benifit from
>>> the concise and wise generic pcm dmaengine.
>>>
>>> Signed-off-by: Nicolin Chen <b42378@freescale.com>
>>
>> We do have the dmaengine pcm helper functions (sound/core/pcm_dmaengine.c)
>> and the generic dmaengine pcm ASoC driver
>> (sound/soc/soc-generic-dmaengine-pcm.c). The generic dmaengine pcm ASoC
>> driver uses the dmaengine pcm helper functions, but it is not the only user
>> of them. So your patch breaks all other users of the helper functions.
>>
>> The helper functions are designed in a way that you can either wrap them in
>> your own pcm driver driver or not use them at all. E.g. take a look at
>> sound/soc/omap/omap-pcm.c on how to overwrite specific functions.
>>
>> - Lars
>
> If this modification to sound/core/pcm_dmaengine.c is not fair,
> what about moving the modification to soc-gerneric-dmaengine-pcm.c?
>
> For example, instead of using snd_dmaengine_pcm_trigger() directly
> in gerneric soc dmaengine driver, we create a new one inside gerneric
> soc dmaengine driver and check the override:
>
> static int snd_soc_dmaengine_pcm_trigger(substream, cmd) {
> if (config->driver->ops->trigger)
> return config->driver->ops->trigger(substream, cmd);
>
> return snd_dmaengine_pcm_trigger(substream, cmd);
> }
>
> Since it happens inside generic dmaengine pcm ASoC driver, it won't break
> those helper functions.
>
> I'm trying this just because I hope generic dmaengine can be more flexible
> Admittedly, using helper functions might be more plausible way in current
> ASoC structure. However, there might be so much change for an generic soc
> dmaengine implementation even if it just wants to override one single func.
Well the idea of the generic dmaengine driver is to be generic and not
require SoC specific hacks since those should not be necessary if things are
done right. What exactly do you want to implement in the overwritten ops?
- Lars
next prev parent reply other threads:[~2013-10-15 9:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-15 7:49 [PATCH] ASoC: generic-dmaengine-pcm: Add an interface to override its functions Nicolin Chen
2013-10-15 8:08 ` Lars-Peter Clausen
2013-10-15 8:22 ` Nicolin Chen
2013-10-15 9:02 ` Lars-Peter Clausen [this message]
2013-10-15 9:23 ` Nicolin Chen
2013-10-15 9:40 ` Lars-Peter Clausen
2013-10-15 9:37 ` Nicolin Chen
2013-10-15 12:49 ` Mark Brown
2013-10-15 11:05 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=525D04B4.3050606@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=b42378@freescale.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.