Commit 0db78532 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: doc: Drop snd_dma_continuous_data() usages

Update the documentation to follow the recent change of the memory
allocation helpers.  The macro snd_dma_continuous_data() is gone, and
the driver needs to set up the coherent dma mask for allocating in the
lower memory addresses, instead.

Link: https://lore.kernel.org/r/20220823115740.14123-6-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent dd164fbf
...@@ -3565,13 +3565,17 @@ given size. ...@@ -3565,13 +3565,17 @@ given size.
The second argument (type) and the third argument (device pointer) are The second argument (type) and the third argument (device pointer) are
dependent on the bus. For normal devices, pass the device pointer dependent on the bus. For normal devices, pass the device pointer
(typically identical as ``card->dev``) to the third argument with (typically identical as ``card->dev``) to the third argument with
``SNDRV_DMA_TYPE_DEV`` type. For the continuous buffer unrelated to the ``SNDRV_DMA_TYPE_DEV`` type.
For the continuous buffer unrelated to the
bus can be pre-allocated with ``SNDRV_DMA_TYPE_CONTINUOUS`` type. bus can be pre-allocated with ``SNDRV_DMA_TYPE_CONTINUOUS`` type.
You can pass NULL to the device pointer in that case, which is the You can pass NULL to the device pointer in that case, which is the
default mode implying to allocate with ``GFP_KERNEL`` flag. default mode implying to allocate with ``GFP_KERNEL`` flag.
If you need a different GFP flag, you can pass it by encoding the flag If you need a restricted (lower) address, set up the coherent DMA mask
into the device pointer via a special macro bits for the device, and pass the device pointer, like the normal
:c:func:`snd_dma_continuous_data()`. device memory allocations. For this type, it's still allowed to pass
NULL to the device pointer, too, if no address restriction is needed.
For the scatter-gather buffers, use ``SNDRV_DMA_TYPE_DEV_SG`` with the For the scatter-gather buffers, use ``SNDRV_DMA_TYPE_DEV_SG`` with the
device pointer (see the `Non-Contiguous Buffers`_ section). device pointer (see the `Non-Contiguous Buffers`_ section).
...@@ -3811,15 +3815,6 @@ arguments here. Since each vmalloc call should succeed at any time, ...@@ -3811,15 +3815,6 @@ arguments here. Since each vmalloc call should succeed at any time,
we don't need to pre-allocate the buffers like other continuous we don't need to pre-allocate the buffers like other continuous
pages. pages.
If you need the 32bit DMA allocation, pass the device pointer encoded
by :c:func:`snd_dma_continuous_data()` with ``GFP_KERNEL|__GFP_DMA32``
argument.
::
snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC,
snd_dma_continuous_data(GFP_KERNEL | __GFP_DMA32), 0, 0);
Proc Interface Proc Interface
============== ==============
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment