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 v6] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation
Date: Tue, 22 Oct 2013 14:06:08 +0200 [thread overview]
Message-ID: <52666A30.7030102@metafoo.de> (raw)
In-Reply-To: <1382410849-11906-1-git-send-email-b42378@freescale.com>
On 10/22/2013 05:00 AM, Nicolin Chen wrote:
[...]
> +/**
> + * snd_free_dev_iram - free allocated specific memory from on-chip internal memory
> + * @dev: DMA device pointer
> + * @size: size in bytes of memory to free
> + * @ptr: cpu-view address returned from snd_malloc_dev_iram
> + *
> + * This function requires iram phandle provided via of_node
> + */
> +void snd_free_dev_iram(struct device *dev, size_t size, void *ptr)
> +{
> + struct gen_pool *pool = NULL;
> +
> + if (!dev->of_node)
> + return;
> +
> + pool = of_get_named_gen_pool(dev->of_node, "iram", 0);
> + if (!pool)
> + return;
I've had a closer look at the other SNDRV_DMA_TYPE implementations and I
think a better way to handle this is to assign the pool to the
snd_dma_buffer's private_data field and then use it here instead of looking
the pool up again. This will also make it easier to use a non-OF lookup scheme.
> +
> + gen_pool_free(pool, (unsigned long)ptr, size);
> +}
> #endif /* CONFIG_HAS_DMA */
>
> /*
next prev parent reply other threads:[~2013-10-22 12:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-22 3:00 [PATCH v6] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation Nicolin Chen
2013-10-22 12:06 ` Lars-Peter Clausen [this message]
2013-10-22 12:49 ` Nicole Otsuka
2013-10-22 13:24 ` Takashi Iwai
2013-10-22 16:28 ` Nicole Otsuka
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=52666A30.7030102@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.