Clean up memalloc callers
Subsystems (10)
cover Clean up memalloc callers
Hi,
this is a trivial cleanup series corresponding to the recent ALSA memalloc API enhancement[1].
Most of patches do simple and systematic changes: either convert to the new way of vmalloc buffer handling, replacing the superfluous snd_dma_continous_data() macro with NULL, or replacing the snd_dma_pci_data() with the direct device pointer assignment. Some have a slightly more changes but they are straightforward enough. Also, a few document updates are provided.
There are still a few reminders (noticeably ASoC), and I'll post the patches for them later. Once after all conversions done, we can drop the superfluous API functions and macros.
thanks,
Takashi
[1] https://lore.kernel.org/r/[email protected]
===
Takashi Iwai (24):
ALSA: drivers: Remove superfluous snd_dma_continuous_data()
ALSA: mips: Remove superfluous snd_dma_continuous_data()
ALSA: rme32: Remove superfluous snd_dma_continuous_data()
ALSA: sh: Remove superfluous snd_dma_continuous_data()
ALSA: sparc: Remove superfluous snd_dma_continuous_data()
ALSA: usb: Remove superfluous snd_dma_continuous_data()
ALSA: 6fire: Drop the dead code
ALSA: usb-audio: Convert to the common vmalloc memalloc
ALSA: aloop: Convert to the common vmalloc memalloc
ALSA: firewire: Convert to the common vmalloc memalloc
ALSA: 6fire: Convert to the common vmalloc memalloc
ALSA: caiaq: Convert to the common vmalloc memalloc
ALSA: hiface: Convert to the common vmalloc memalloc
ALSA: ua101: Convert to the common vmalloc memalloc
ALSA: vx: Convert to the common vmalloc memalloc
ALSA: pdaudiocf: Convert to the common vmalloc memalloc
ALSA: mips: Convert to the common vmalloc memalloc
ALSA: pci: Drop superfluous snd_pcm_sgbuf_ops_page
ALSA: aoa: Avoid non-standard macro usage
ALSA: echoaudio: Avoid non-standard macro usage
ALSA: es1968: Avoid non-standard macro usage
ALSA: rme: Avoid non-standard macro usage
ALSA: pci: Avoid non-standard macro usage
ALSA: docs: Remove snd_dma_pci_data() usage in documentation
.../sound/kernel-api/writing-an-alsa-driver.rst | 8 ++-- sound/aoa/soundbus/i2sbus/pcm.c | 2 +- sound/drivers/aloop.c | 8 ++-- sound/drivers/dummy.c | 2 +- sound/drivers/ml403-ac97cr.c | 2 +- sound/drivers/pcsp/pcsp_lib.c | 4 +- sound/drivers/vx/vx_pcm.c | 10 ++--- sound/firewire/bebob/bebob_pcm.c | 9 ++-- sound/firewire/dice/dice-pcm.c | 11 ++--- sound/firewire/digi00x/digi00x-pcm.c | 9 ++-- sound/firewire/fireface/ff-pcm.c | 9 ++-- sound/firewire/fireworks/fireworks_pcm.c | 9 ++-- sound/firewire/isight.c | 8 ++-- sound/firewire/motu/motu-pcm.c | 9 ++-- sound/firewire/oxfw/oxfw-pcm.c | 14 +++--- sound/firewire/tascam/tascam-pcm.c | 9 ++-- sound/mips/hal2.c | 3 +- sound/mips/sgio2audio.c | 12 +++--- sound/pci/ad1889.c | 6 +-- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 3 +- sound/pci/als4000.c | 3 +- sound/pci/asihpi/asihpi.c | 4 +- sound/pci/atiixp.c | 6 +-- sound/pci/atiixp_modem.c | 4 +- sound/pci/au88x0/au88x0_pcm.c | 3 +- sound/pci/aw2/aw2-alsa.c | 6 +-- sound/pci/azt3328.c | 8 ++-- sound/pci/bt87x.c | 5 +-- sound/pci/ca0106/ca0106_main.c | 6 +-- sound/pci/cmipci.c | 6 +-- sound/pci/cs4281.c | 3 +- sound/pci/cs46xx/cs46xx_lib.c | 16 ++++--- sound/pci/cs5535audio/cs5535audio_pcm.c | 6 +-- sound/pci/ctxfi/ctpcm.c | 5 +-- sound/pci/ctxfi/ctvmem.c | 2 +- sound/pci/echoaudio/echoaudio.c | 24 +++-------- sound/pci/emu10k1/emu10k1.c | 5 ++- sound/pci/emu10k1/emu10k1x.c | 6 +-- sound/pci/emu10k1/emufx.c | 2 +- sound/pci/emu10k1/emupcm.c | 12 +++--- sound/pci/emu10k1/memory.c | 4 +- sound/pci/emu10k1/p16v.c | 4 +- sound/pci/ens1370.c | 8 ++-- sound/pci/es1938.c | 3 +- sound/pci/es1968.c | 4 +- sound/pci/fm801.c | 2 +- sound/pci/hda/hda_controller.c | 1 - sound/pci/ice1712/ice1712.c | 9 ++-- sound/pci/ice1712/ice1724.c | 6 +-- sound/pci/intel8x0.c | 4 +- sound/pci/intel8x0m.c | 4 +- sound/pci/korg1212/korg1212.c | 8 ++-- sound/pci/lola/lola.c | 2 +- sound/pci/lola/lola_pcm.c | 5 +-- sound/pci/lx6464es/lx6464es.c | 2 +- sound/pci/maestro3.c | 3 +- sound/pci/mixart/mixart.c | 7 +-- sound/pci/oxygen/oxygen_pcm.c | 10 ++--- sound/pci/pcxhr/pcxhr.c | 4 +- sound/pci/riptide/riptide.c | 6 +-- sound/pci/rme32.c | 4 +- sound/pci/rme9652/hdsp.c | 7 +-- sound/pci/rme9652/hdspm.c | 3 +- sound/pci/rme9652/rme9652.c | 7 +-- sound/pci/sis7019.c | 3 +- sound/pci/sonicvibes.c | 3 +- sound/pci/trident/trident_main.c | 24 ++++++----- sound/pci/via82xx.c | 17 +++----- sound/pci/via82xx_modem.c | 6 +-- sound/pci/ymfpci/ymfpci_main.c | 16 ++++--- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 9 ++-- sound/sh/aica.c | 2 +- sound/sh/sh_dac_audio.c | 2 +- sound/sparc/amd7930.c | 2 +- sound/sparc/dbri.c | 2 +- sound/usb/6fire/pcm.c | 16 +++---- sound/usb/caiaq/audio.c | 8 ++-- sound/usb/hiface/pcm.c | 9 ++-- sound/usb/line6/pcm.c | 4 +- sound/usb/misc/ua101.c | 14 +++--- sound/usb/pcm.c | 50 ++++------------------ sound/usb/usx2y/usbusx2yaudio.c | 4 +- sound/usb/usx2y/usx2yhwdeppcm.c | 4 +- 84 files changed, 266 insertions(+), 327 deletions(-)
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/24 ALSA: drivers: Remove superfluous snd_dma_continuous_data()
The recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/drivers/dummy.c | 2 +- sound/drivers/ml403-ac97cr.c | 2 +- sound/drivers/pcsp/pcsp_lib.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
sound/drivers/dummy.c +1 -1
@@ -702,7 +702,7 @@ static int snd_card_dummy_pcm(struct snd_dummy *dummy, int device,if (!fake_buffer) {snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,0 ,64 *1024 ); }return 0 ;
sound/drivers/ml403-ac97cr.c +1 -1
@@ -1242,7 +1242,7 @@ snd_ml403_ac97cr_pcm(struct snd_ml403_ac97cr *ml403_ac97cr, int device) ml403_ac97cr->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,128 *1024 );return 0 ;
sound/drivers/pcsp/pcsp_lib.c +2 -2
@@ -352,8 +352,8 @@ int snd_pcsp_new_pcm(struct snd_pcsp *chip)snd_pcm_lib_preallocate_pages_for_all (chip->pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data - (GFP_KERNEL ),PCSP_BUFFER_SIZE , +NULL , +PCSP_BUFFER_SIZE ,PCSP_BUFFER_SIZE );return 0 ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/24 ALSA: mips: Remove superfluous snd_dma_continuous_data()
In reply to Takashi IwaiThe recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/mips/hal2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
sound/mips/hal2.c +1 -2
@@ -741,8 +741,7 @@ static int hal2_pcm_create(struct snd_hal2 *hal2)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &hal2_capture_ops);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), -0 ,1024 *1024 ); +NULL ,0 ,1024 *1024 );return 0 ; }
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 3/24 ALSA: rme32: Remove superfluous snd_dma_continuous_data()
In reply to Takashi IwaiThe recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/pci/rme32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/rme32.c +2 -2
@@ -1375,7 +1375,7 @@ static int snd_rme32_create(struct rme32 *rme32)snd_pcm_set_ops (rme32->spdif_pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_rme32_capture_spdif_fd_ops);snd_pcm_lib_preallocate_pages_for_all (rme32->spdif_pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,0 ,RME32_MID_BUFFER_SIZE ); rme32->spdif_pcm->info_flags =SNDRV_PCM_INFO_JOINT_DUPLEX ; }else {
@@ -1407,7 +1407,7 @@ static int snd_rme32_create(struct rme32 *rme32)snd_pcm_set_ops (rme32->adat_pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_rme32_capture_adat_fd_ops);snd_pcm_lib_preallocate_pages_for_all (rme32->adat_pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,0 ,RME32_MID_BUFFER_SIZE ); rme32->adat_pcm->info_flags =SNDRV_PCM_INFO_JOINT_DUPLEX ; }else {
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 4/24 ALSA: sh: Remove superfluous snd_dma_continuous_data()
In reply to Takashi IwaiThe recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/sh/aica.c | 2 +- sound/sh/sh_dac_audio.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/sh/aica.c +1 -1
@@ -443,7 +443,7 @@ static int __init snd_aicapcmchip(struct snd_card_aica/* Allocate the DMA buffers */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,AICA_BUFFER_SIZE ,AICA_BUFFER_SIZE );return 0 ;
sound/sh/sh_dac_audio.c +1 -1
@@ -268,7 +268,7 @@ static int snd_sh_dac_pcm(struct snd_sh_dac *chip, int device)/* buffer size=48K */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,48 *1024 ,48 *1024 );
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 5/24 ALSA: sparc: Remove superfluous snd_dma_continuous_data()
In reply to Takashi IwaiThe recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/sparc/amd7930.c | 2 +- sound/sparc/dbri.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/sparc/amd7930.c +1 -1
@@ -777,7 +777,7 @@ static int snd_amd7930_pcm(struct snd_amd7930 *amd) amd->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,64 *1024 );return 0 ;
sound/sparc/dbri.c +1 -1
@@ -2249,7 +2249,7 @@ static int snd_dbri_pcm(struct snd_card *card)strcpy (pcm->name, card->shortname);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,64 *1024 );return 0 ; }
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/24 ALSA: usb: Remove superfluous snd_dma_continuous_data()
In reply to Takashi IwaiThe recent change (commit b8a7d422280c: "ALSA: memalloc: Allow NULL device for SNDRV_DMA_TYPE_CONTINOUS type") made the PCM preallocation helper accepting NULL as the device pointer for the default usage. Drop the snd_dma_continuous_data() usage that became superfluous from the callers.
--- sound/usb/line6/pcm.c | 4 +--- sound/usb/usx2y/usbusx2yaudio.c | 4 ++-- sound/usb/usx2y/usx2yhwdeppcm.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-)
sound/usb/line6/pcm.c +1 -3
@@ -502,9 +502,7 @@ static int snd_line6_new_pcm(struct usb_line6 *line6, struct snd_pcm **pcm_ret)/* pre-allocation of buffers */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data - (GFP_KERNEL ),64 *1024 , -128 *1024 ); +NULL ,64 *1024 ,128 *1024 );return 0 ; }
sound/usb/usx2y/usbusx2yaudio.c +2 -2
@@ -970,13 +970,13 @@ static int usX2Y_audio_stream_new(struct snd_card *card, int playback_endpoint,if (playback_endpoint) {snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,128 *1024 ); }snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,128 *1024 );usX2Y (card)->pcm_devs++;
sound/usb/usx2y/usx2yhwdeppcm.c +2 -2
@@ -728,11 +728,11 @@ int usX2Y_hwdep_pcm_new(struct snd_card *card)sprintf (pcm->name,NAME_ALLCAPS " hwdep Audio" );snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,128 *1024 );snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream,SNDRV_DMA_TYPE_CONTINUOUS , -snd_dma_continuous_data (GFP_KERNEL ), +NULL ,64 *1024 ,128 *1024 );return 0 ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 7/24 ALSA: 6fire: Drop the dead code
In reply to Takashi IwaiA few error handling code was forgotten where it never reaches. Drop it.
--- sound/usb/6fire/pcm.c | 7 ------- 1 file changed, 7 deletions(-)
sound/usb/6fire/pcm.c +0 -7
@@ -660,13 +660,6 @@ int usb6fire_pcm_init(struct sfire_chip *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &pcm_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &pcm_ops); -if (ret) { -usb6fire_pcm_buffers_destroy (rt); -kfree (rt); -dev_err (&chip->dev->dev, -"error preallocating pcm buffers.\n" ); -return ret; - } rt->instance = pcm; chip->pcm = rt;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 8/24 ALSA: usb-audio: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
Also, since the SG-buffer-specific PCM ops becomes identical with the normal PCM ops, unify them again to the single ops, too.
--- sound/usb/pcm.c | 50 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 42 deletions(-)
sound/usb/pcm.c +8 -42
@@ -785,12 +785,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,if (ret)return ret; -if (snd_usb_use_vmalloc) - ret =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); -else - ret =snd_pcm_lib_malloc_pages (substream, -params_buffer_bytes (hw_params)); + ret =snd_pcm_lib_malloc_pages (substream, +params_buffer_bytes (hw_params));if (ret <0 ) goto stop_pipeline;
@@ -857,10 +853,7 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream)snd_usb_unlock_shutdown (subs->stream->chip); } -if (snd_usb_use_vmalloc) -return snd_pcm_lib_free_vmalloc_buffer (substream); -else -return snd_pcm_lib_free_pages (substream); +return snd_pcm_lib_free_pages (substream); }/*
@@ -1781,7 +1774,6 @@ static const struct snd_pcm_ops snd_usb_playback_ops = { .prepare = snd_usb_pcm_prepare, .trigger = snd_usb_substream_playback_trigger, .pointer = snd_usb_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops snd_usb_capture_ops = {
@@ -1793,43 +1785,14 @@ static const struct snd_pcm_ops snd_usb_capture_ops = { .prepare = snd_usb_pcm_prepare, .trigger = snd_usb_substream_capture_trigger, .pointer = snd_usb_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, -}; - -static const struct snd_pcm_ops snd_usb_playback_dev_ops = { - .open = snd_usb_pcm_open, - .close = snd_usb_pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = snd_usb_hw_params, - .hw_free = snd_usb_hw_free, - .prepare = snd_usb_pcm_prepare, - .trigger = snd_usb_substream_playback_trigger, - .pointer = snd_usb_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, -}; - -static const struct snd_pcm_ops snd_usb_capture_dev_ops = { - .open = snd_usb_pcm_open, - .close = snd_usb_pcm_close, - .ioctl = snd_pcm_lib_ioctl, - .hw_params = snd_usb_hw_params, - .hw_free = snd_usb_hw_free, - .prepare = snd_usb_pcm_prepare, - .trigger = snd_usb_substream_capture_trigger, - .pointer = snd_usb_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };void snd_usb_set_pcm_ops (struct snd_pcm *pcm,int stream) {const struct snd_pcm_ops *ops; -if (snd_usb_use_vmalloc) - ops = stream ==SNDRV_PCM_STREAM_PLAYBACK ? + ops = stream ==SNDRV_PCM_STREAM_PLAYBACK ? &snd_usb_playback_ops : &snd_usb_capture_ops; -else - ops = stream ==SNDRV_PCM_STREAM_PLAYBACK ? - &snd_usb_playback_dev_ops : &snd_usb_capture_dev_ops;snd_pcm_set_ops (pcm, stream, ops); }
@@ -1839,7 +1802,10 @@ void snd_usb_preallocate_buffer(struct snd_usb_substream *subs)struct snd_pcm_substream *s = pcm->streams[subs->direction].substream;struct device *dev = subs->dev->bus->controller; -if (!snd_usb_use_vmalloc) +if (snd_usb_use_vmalloc) +snd_pcm_lib_preallocate_pages (s,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); +else snd_pcm_lib_preallocate_pages (s,SNDRV_DMA_TYPE_DEV_SG , dev,64 *1024 ,512 *1024 ); }
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 9/24 ALSA: aloop: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/drivers/aloop.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/drivers/aloop.c +4 -4
@@ -576,8 +576,7 @@ static void loopback_runtime_free(struct snd_pcm_runtime *runtime)static int loopback_hw_params (struct snd_pcm_substream *substream,struct snd_pcm_hw_params *params) { -return snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (params)); +return snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (params)); }static int loopback_hw_free (struct snd_pcm_substream *substream)
@@ -589,7 +588,7 @@ static int loopback_hw_free(struct snd_pcm_substream *substream)mutex_lock (&dpcm->loopback->cable_lock); cable->valid &= ~(1 << substream->stream);mutex_unlock (&dpcm->loopback->cable_lock); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static unsigned int get_cable_index (struct snd_pcm_substream *substream)
@@ -765,7 +764,6 @@ static const struct snd_pcm_ops loopback_pcm_ops = { .prepare = loopback_prepare, .trigger = loopback_trigger, .pointer = loopback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, }; static int loopback_pcm_new(struct loopback *loopback,
@@ -780,6 +778,8 @@ static int loopback_pcm_new(struct loopback *loopback,return err;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &loopback_pcm_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &loopback_pcm_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); pcm->private_data = loopback; pcm->info_flags =0 ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 10/24 ALSA: firewire: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/firewire/bebob/bebob_pcm.c | 9 ++++----- sound/firewire/dice/dice-pcm.c | 11 ++++++----- sound/firewire/digi00x/digi00x-pcm.c | 9 ++++----- sound/firewire/fireface/ff-pcm.c | 9 ++++----- sound/firewire/fireworks/fireworks_pcm.c | 9 ++++----- sound/firewire/isight.c | 8 ++++---- sound/firewire/motu/motu-pcm.c | 9 ++++----- sound/firewire/oxfw/oxfw-pcm.c | 14 ++++++-------- sound/firewire/tascam/tascam-pcm.c | 9 ++++----- 9 files changed, 40 insertions(+), 47 deletions(-)
sound/firewire/bebob/bebob_pcm.c +4 -5
@@ -214,8 +214,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_bebob *bebob = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -248,7 +247,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&bebob->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); } static int
@@ -354,7 +353,6 @@ int snd_bebob_create_pcm_devices(struct snd_bebob *bebob) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -366,7 +364,6 @@ int snd_bebob_create_pcm_devices(struct snd_bebob *bebob) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -380,6 +377,8 @@ int snd_bebob_create_pcm_devices(struct snd_bebob *bebob) "%s PCM", bebob->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); end:return err; }
sound/firewire/dice/dice-pcm.c +6 -5
@@ -266,8 +266,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_dice *dice = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -305,7 +304,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&dice->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int capture_prepare (struct snd_pcm_substream *substream)
@@ -417,7 +416,6 @@ int snd_dice_create_pcm(struct snd_dice *dice) .trigger = capture_trigger, .pointer = capture_pointer, .ack = capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -429,7 +427,6 @@ int snd_dice_create_pcm(struct snd_dice *dice) .trigger = playback_trigger, .pointer = playback_pointer, .ack = playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;unsigned int capture, playback;
@@ -459,6 +456,10 @@ int snd_dice_create_pcm(struct snd_dice *dice)if (playback >0 )snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops); + +snd_pcm_lib_preallocate_pages_for_all (pcm, +SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); }return 0 ;
sound/firewire/digi00x/digi00x-pcm.c +4 -5
@@ -190,8 +190,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_dg00x *dg00x = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -224,7 +223,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&dg00x->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_capture_prepare (struct snd_pcm_substream *substream)
@@ -337,7 +336,6 @@ int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -349,7 +347,6 @@ int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -363,6 +360,8 @@ int snd_dg00x_create_pcm_devices(struct snd_dg00x *dg00x) "%s PCM", dg00x->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
sound/firewire/fireface/ff-pcm.c +4 -5
@@ -230,8 +230,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_ff *ff = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -264,7 +263,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&ff->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_capture_prepare (struct snd_pcm_substream *substream)
@@ -377,7 +376,6 @@ int snd_ff_create_pcm_devices(struct snd_ff *ff) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops pcm_playback_ops = { .open = pcm_open,
@@ -389,7 +387,6 @@ int snd_ff_create_pcm_devices(struct snd_ff *ff) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -403,6 +400,8 @@ int snd_ff_create_pcm_devices(struct snd_ff *ff) "%s PCM", ff->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &pcm_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &pcm_capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
sound/firewire/fireworks/fireworks_pcm.c +4 -5
@@ -250,8 +250,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_efw *efw = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -284,7 +283,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&efw->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_capture_prepare (struct snd_pcm_substream *substream)
@@ -384,7 +383,6 @@ int snd_efw_create_pcm_devices(struct snd_efw *efw) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -396,7 +394,6 @@ int snd_efw_create_pcm_devices(struct snd_efw *efw) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -409,6 +406,8 @@ int snd_efw_create_pcm_devices(struct snd_efw *efw)snprintf (pcm->name,sizeof (pcm->name),"%s PCM" , efw->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); end:return err; }
sound/firewire/isight.c +4 -4
@@ -288,8 +288,7 @@ static int isight_hw_params(struct snd_pcm_substream *substream,struct isight *isight = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -337,7 +336,7 @@ static int isight_hw_free(struct snd_pcm_substream *substream)isight_stop_streaming (isight);mutex_unlock (&isight->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int isight_start_streaming (struct isight *isight)
@@ -453,7 +452,6 @@ static int isight_create_pcm(struct isight *isight) .prepare = isight_prepare, .trigger = isight_trigger, .pointer = isight_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -465,6 +463,8 @@ static int isight_create_pcm(struct isight *isight)strcpy (pcm->name,"iSight" ); isight->pcm = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; isight->pcm->ops = &ops; +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
sound/firewire/motu/motu-pcm.c +4 -5
@@ -218,8 +218,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_motu *motu = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -252,7 +251,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&motu->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int capture_prepare (struct snd_pcm_substream *substream)
@@ -356,7 +355,6 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu) .trigger = capture_trigger, .pointer = capture_pointer, .ack = capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -368,7 +366,6 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu) .trigger = playback_trigger, .pointer = playback_pointer, .ack = playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -381,6 +378,8 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
sound/firewire/oxfw/oxfw-pcm.c +6 -8
@@ -239,8 +239,7 @@ static int pcm_capture_hw_params(struct snd_pcm_substream *substream,struct snd_oxfw *oxfw = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -267,8 +266,7 @@ static int pcm_playback_hw_params(struct snd_pcm_substream *substream,struct snd_oxfw *oxfw = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -303,7 +301,7 @@ static int pcm_capture_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&oxfw->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_playback_hw_free (struct snd_pcm_substream *substream) {
@@ -318,7 +316,7 @@ static int pcm_playback_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&oxfw->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_capture_prepare (struct snd_pcm_substream *substream)
@@ -428,7 +426,6 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -440,7 +437,6 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;unsigned int cap =0 ;
@@ -458,6 +454,8 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);if (cap >0 )snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
sound/firewire/tascam/tascam-pcm.c +4 -5
@@ -119,8 +119,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,struct snd_tscm *tscm = substream->private_data;int err; - err =snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); + err =snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params));if (err <0 )return err;
@@ -153,7 +152,7 @@ static int pcm_hw_free(struct snd_pcm_substream *substream)mutex_unlock (&tscm->mutex); -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int pcm_capture_prepare (struct snd_pcm_substream *substream)
@@ -266,7 +265,6 @@ int snd_tscm_create_pcm_devices(struct snd_tscm *tscm) .trigger = pcm_capture_trigger, .pointer = pcm_capture_pointer, .ack = pcm_capture_ack, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_ops = { .open = pcm_open,
@@ -278,7 +276,6 @@ int snd_tscm_create_pcm_devices(struct snd_tscm *tscm) .trigger = pcm_playback_trigger, .pointer = pcm_playback_pointer, .ack = pcm_playback_ack, - .page = snd_pcm_lib_get_vmalloc_page, };struct snd_pcm *pcm;int err;
@@ -292,6 +289,8 @@ int snd_tscm_create_pcm_devices(struct snd_tscm *tscm) "%s PCM", tscm->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 11/24 ALSA: 6fire: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/usb/6fire/pcm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/usb/6fire/pcm.c +5 -4
@@ -449,13 +449,13 @@ static int usb6fire_pcm_close(struct snd_pcm_substream *alsa_sub)static int usb6fire_pcm_hw_params (struct snd_pcm_substream *alsa_sub,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_buffer (alsa_sub, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (alsa_sub, +params_buffer_bytes (hw_params)); }static int usb6fire_pcm_hw_free (struct snd_pcm_substream *alsa_sub) { -return snd_pcm_lib_free_vmalloc_buffer (alsa_sub); +return snd_pcm_lib_free_pages (alsa_sub); }static int usb6fire_pcm_prepare (struct snd_pcm_substream *alsa_sub)
@@ -560,7 +560,6 @@ static const struct snd_pcm_ops pcm_ops = { .prepare = usb6fire_pcm_prepare, .trigger = usb6fire_pcm_trigger, .pointer = usb6fire_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, }; static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
@@ -659,6 +658,8 @@ int usb6fire_pcm_init(struct sfire_chip *chip)strcpy (pcm->name,"DMX 6Fire USB" );snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &pcm_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &pcm_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); rt->instance = pcm;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 12/24 ALSA: caiaq: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/usb/caiaq/audio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/usb/caiaq/audio.c +4 -4
@@ -170,15 +170,14 @@ static int snd_usb_caiaq_substream_close(struct snd_pcm_substream *substream)static int snd_usb_caiaq_pcm_hw_params (struct snd_pcm_substream *sub,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_buffer (sub, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (sub,params_buffer_bytes (hw_params)); }static int snd_usb_caiaq_pcm_hw_free (struct snd_pcm_substream *sub) {struct snd_usb_caiaqdev *cdev =snd_pcm_substream_chip (sub);deactivate_substream (cdev, sub); -return snd_pcm_lib_free_vmalloc_buffer (sub); +return snd_pcm_lib_free_pages (sub); }/* this should probably go upstream */
@@ -334,7 +333,6 @@ static const struct snd_pcm_ops snd_usb_caiaq_ops = { .prepare = snd_usb_caiaq_pcm_prepare, .trigger = snd_usb_caiaq_pcm_trigger, .pointer = snd_usb_caiaq_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, }; static void check_for_elapsed_periods(struct snd_usb_caiaqdev *cdev,
@@ -843,6 +841,8 @@ int snd_usb_caiaq_audio_init(struct snd_usb_caiaqdev *cdev) &snd_usb_caiaq_ops);snd_pcm_set_ops (cdev->pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_usb_caiaq_ops); +snd_pcm_lib_preallocate_pages_for_all (cdev->pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); cdev->data_cb_info = kmalloc_array(N_URBS, sizeof(struct snd_usb_caiaq_cb_info),
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 13/24 ALSA: hiface: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/usb/hiface/pcm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/usb/hiface/pcm.c +5 -4
@@ -418,13 +418,13 @@ static int hiface_pcm_close(struct snd_pcm_substream *alsa_sub)static int hiface_pcm_hw_params (struct snd_pcm_substream *alsa_sub,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_buffer (alsa_sub, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (alsa_sub, +params_buffer_bytes (hw_params)); }static int hiface_pcm_hw_free (struct snd_pcm_substream *alsa_sub) { -return snd_pcm_lib_free_vmalloc_buffer (alsa_sub); +return snd_pcm_lib_free_pages (alsa_sub); }static int hiface_pcm_prepare (struct snd_pcm_substream *alsa_sub)
@@ -518,7 +518,6 @@ static const struct snd_pcm_ops pcm_ops = { .prepare = hiface_pcm_prepare, .trigger = hiface_pcm_trigger, .pointer = hiface_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, }; static int hiface_pcm_init_urb(struct pcm_urb *urb,
@@ -614,6 +613,8 @@ int hiface_pcm_init(struct hiface_chip *chip, u8 extra_freq)strlcpy (pcm->name,"USB-SPDIF Audio" ,sizeof (pcm->name));snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &pcm_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); rt->instance = pcm;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 14/24 ALSA: ua101: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/usb/misc/ua101.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/usb/misc/ua101.c +7 -7
@@ -733,8 +733,8 @@ static int capture_pcm_hw_params(struct snd_pcm_substream *substream,if (err <0 )return err; -return snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (substream, +params_buffer_bytes (hw_params)); } static int playback_pcm_hw_params(struct snd_pcm_substream *substream,
@@ -751,13 +751,13 @@ static int playback_pcm_hw_params(struct snd_pcm_substream *substream,if (err <0 )return err; -return snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (substream, +params_buffer_bytes (hw_params)); }static int ua101_pcm_hw_free (struct snd_pcm_substream *substream) { -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }static int capture_pcm_prepare (struct snd_pcm_substream *substream)
@@ -889,7 +889,6 @@ static const struct snd_pcm_ops capture_pcm_ops = { .prepare = capture_pcm_prepare, .trigger = capture_pcm_trigger, .pointer = capture_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops playback_pcm_ops = {
@@ -901,7 +900,6 @@ static const struct snd_pcm_ops playback_pcm_ops = { .prepare = playback_pcm_prepare, .trigger = playback_pcm_trigger, .pointer = playback_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, }; static const struct uac_format_type_i_discrete_descriptor *
@@ -1296,6 +1294,8 @@ static int ua101_probe(struct usb_interface *interface,strcpy (ua->pcm->name, name);snd_pcm_set_ops (ua->pcm,SNDRV_PCM_STREAM_PLAYBACK , &playback_pcm_ops);snd_pcm_set_ops (ua->pcm,SNDRV_PCM_STREAM_CAPTURE , &capture_pcm_ops); +snd_pcm_lib_preallocate_pages_for_all (ua->pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 ); err =snd_usbmidi_create (card, ua->intf[INTF_MIDI ], &ua->midi_list, &midi_quirk);
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 15/24 ALSA: vx: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
Since the driver requires the DMA32 allocation, it passes the specially encoded device to snd_pcm_lib_preallocate_pages().
--- sound/drivers/vx/vx_pcm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
sound/drivers/vx/vx_pcm.c +5 -5
@@ -778,8 +778,7 @@ static snd_pcm_uframes_t vx_pcm_playback_pointer(struct snd_pcm_substream *subs)static int vx_pcm_hw_params (struct snd_pcm_substream *subs,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_32_buffer - (subs,params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (subs,params_buffer_bytes (hw_params)); }/*
@@ -787,7 +786,7 @@ static int vx_pcm_hw_params(struct snd_pcm_substream *subs,*/ static int vx_pcm_hw_free (struct snd_pcm_substream *subs) { -return snd_pcm_lib_free_vmalloc_buffer (subs); +return snd_pcm_lib_free_pages (subs); }/*
@@ -867,7 +866,6 @@ static const struct snd_pcm_ops vx_pcm_playback_ops = { .prepare = vx_pcm_prepare, .trigger = vx_pcm_trigger, .pointer = vx_pcm_playback_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };
@@ -1088,7 +1086,6 @@ static const struct snd_pcm_ops vx_pcm_capture_ops = { .prepare = vx_pcm_prepare, .trigger = vx_pcm_trigger, .pointer = vx_pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };
@@ -1233,6 +1230,9 @@ int snd_vx_pcm_new(struct vx_core *chip)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &vx_pcm_playback_ops);if (ins)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &vx_pcm_capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +snd_dma_continuous_data (GFP_KERNEL |GFP_DMA32 ), +0 ,0 ); pcm->private_data = chip; pcm->private_free = snd_vx_pcm_free;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 16/24 ALSA: pdaudiocf: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
Since the driver requires the DMA32 allocation, it passes the specially encoded device to snd_pcm_lib_preallocate_pages().
--- sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +5 -4
@@ -89,8 +89,7 @@ static int pdacf_pcm_trigger(struct snd_pcm_substream *subs, int cmd)static int pdacf_pcm_hw_params (struct snd_pcm_substream *subs,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_32_buffer - (subs,params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (subs,params_buffer_bytes (hw_params)); }/*
@@ -98,7 +97,7 @@ static int pdacf_pcm_hw_params(struct snd_pcm_substream *subs,*/ static int pdacf_pcm_hw_free (struct snd_pcm_substream *subs) { -return snd_pcm_lib_free_vmalloc_buffer (subs); +return snd_pcm_lib_free_pages (subs); }/*
@@ -262,7 +261,6 @@ static const struct snd_pcm_ops pdacf_pcm_capture_ops = { .prepare = pdacf_pcm_prepare, .trigger = pdacf_pcm_trigger, .pointer = pdacf_pcm_capture_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };
@@ -279,6 +277,9 @@ int snd_pdacf_pcm_new(struct snd_pdacf *chip)return err;snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &pdacf_pcm_capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +snd_dma_continuous_data (GFP_KERNEL |GFP_DMA32 ), +0 ,0 ); pcm->private_data = chip; pcm->info_flags =0 ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 17/24 ALSA: mips: Convert to the common vmalloc memalloc
In reply to Takashi IwaiThe recent change (*) in the ALSA memalloc core allows us to drop the special vmalloc-specific allocation and page handling. This patch coverts to the common code.
(*) df3fd6509421: ALSA: memalloc: Add vmalloc buffer allocation
support
6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/mips/sgio2audio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
sound/mips/sgio2audio.c +6 -6
@@ -582,14 +582,13 @@ static int snd_sgio2audio_pcm_close(struct snd_pcm_substream *substream)static int snd_sgio2audio_pcm_hw_params (struct snd_pcm_substream *substream,struct snd_pcm_hw_params *hw_params) { -return snd_pcm_lib_alloc_vmalloc_buffer (substream, -params_buffer_bytes (hw_params)); +return snd_pcm_lib_malloc_pages (substream,params_buffer_bytes (hw_params)); }/* hw_free callback */ static int snd_sgio2audio_pcm_hw_free (struct snd_pcm_substream *substream) { -return snd_pcm_lib_free_vmalloc_buffer (substream); +return snd_pcm_lib_free_pages (substream); }/* prepare callback */
@@ -670,7 +669,6 @@ static const struct snd_pcm_ops snd_sgio2audio_playback1_ops = { .prepare = snd_sgio2audio_pcm_prepare, .trigger = snd_sgio2audio_pcm_trigger, .pointer = snd_sgio2audio_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops snd_sgio2audio_playback2_ops = {
@@ -682,7 +680,6 @@ static const struct snd_pcm_ops snd_sgio2audio_playback2_ops = { .prepare = snd_sgio2audio_pcm_prepare, .trigger = snd_sgio2audio_pcm_trigger, .pointer = snd_sgio2audio_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };static const struct snd_pcm_ops snd_sgio2audio_capture_ops = {
@@ -694,7 +691,6 @@ static const struct snd_pcm_ops snd_sgio2audio_capture_ops = { .prepare = snd_sgio2audio_pcm_prepare, .trigger = snd_sgio2audio_pcm_trigger, .pointer = snd_sgio2audio_pcm_pointer, - .page = snd_pcm_lib_get_vmalloc_page, };/*
@@ -720,6 +716,8 @@ static int snd_sgio2audio_new_pcm(struct snd_sgio2audio *chip) &snd_sgio2audio_playback1_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_sgio2audio_capture_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );/* create second pcm device with one outputs and no input */ err =snd_pcm_new (chip->card,"SGI O2 Audio" ,1 ,1 ,0 , &pcm);
@@ -732,6 +730,8 @@ static int snd_sgio2audio_new_pcm(struct snd_sgio2audio *chip)/* set operators */ snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_sgio2audio_playback2_ops); +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_VMALLOC , +NULL ,0 ,0 );return 0 ; }
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 18/24 ALSA: pci: Drop superfluous snd_pcm_sgbuf_ops_page
In reply to Takashi Iwaisnd_pcm_sgbuf_ops_page is no longer needed to be set explicitly to PCM page ops since the recent change in the PCM core (*). Leaving it NULL should work as long as the preallocation has been done properly.
This patch drops the redundant lines.
(*) 6ef6be988f98: ALSA: pcm: Handle special page mapping in the
default mmap handler
--- sound/pci/au88x0/au88x0_pcm.c | 1 - sound/pci/bt87x.c | 1 - sound/pci/ctxfi/ctpcm.c | 2 -- sound/pci/echoaudio/echoaudio.c | 4 ---- sound/pci/emu10k1/emupcm.c | 2 -- sound/pci/hda/hda_controller.c | 1 - sound/pci/lola/lola_pcm.c | 1 - sound/pci/riptide/riptide.c | 2 -- sound/pci/rme9652/hdspm.c | 1 - sound/pci/trident/trident_main.c | 2 -- sound/pci/via82xx.c | 5 ----- sound/pci/via82xx_modem.c | 2 -- 12 files changed, 24 deletions(-)
sound/pci/au88x0/au88x0_pcm.c +0 -1
@@ -436,7 +436,6 @@ static const struct snd_pcm_ops snd_vortex_playback_ops = { .prepare = snd_vortex_pcm_prepare, .trigger = snd_vortex_pcm_trigger, .pointer = snd_vortex_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/*
sound/pci/bt87x.c +0 -1
@@ -545,7 +545,6 @@ static const struct snd_pcm_ops snd_bt87x_pcm_ops = { .prepare = snd_bt87x_prepare, .trigger = snd_bt87x_trigger, .pointer = snd_bt87x_pointer, - .page = snd_pcm_sgbuf_ops_page, }; static int snd_bt87x_capture_volume_info(struct snd_kcontrol *kcontrol,
sound/pci/ctxfi/ctpcm.c +0 -2
@@ -379,7 +379,6 @@ static const struct snd_pcm_ops ct_pcm_playback_ops = { .prepare = ct_pcm_playback_prepare, .trigger = ct_pcm_playback_trigger, .pointer = ct_pcm_playback_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* PCM operators for capture */
@@ -392,7 +391,6 @@ static const struct snd_pcm_ops ct_pcm_capture_ops = { .prepare = ct_pcm_capture_prepare, .trigger = ct_pcm_capture_trigger, .pointer = ct_pcm_capture_pointer, - .page = snd_pcm_sgbuf_ops_page, };static const struct snd_pcm_chmap_elem surround_map[] = {
sound/pci/echoaudio/echoaudio.c +0 -4
@@ -824,7 +824,6 @@ static const struct snd_pcm_ops analog_playback_ops = { .prepare = pcm_prepare, .trigger = pcm_trigger, .pointer = pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };static const struct snd_pcm_ops analog_capture_ops = { .open = pcm_analog_in_open,
@@ -835,7 +834,6 @@ static const struct snd_pcm_ops analog_capture_ops = { .prepare = pcm_prepare, .trigger = pcm_trigger, .pointer = pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };#ifdef ECHOCARD_HAS_DIGITAL_IO #ifndef ECHOCARD_HAS_VMIXER
@@ -848,7 +846,6 @@ static const struct snd_pcm_ops digital_playback_ops = { .prepare = pcm_prepare, .trigger = pcm_trigger, .pointer = pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };#endif /* !ECHOCARD_HAS_VMIXER */ static const struct snd_pcm_ops digital_capture_ops = {
@@ -860,7 +857,6 @@ static const struct snd_pcm_ops digital_capture_ops = { .prepare = pcm_prepare, .trigger = pcm_trigger, .pointer = pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };#endif /* ECHOCARD_HAS_DIGITAL_IO */
sound/pci/emu10k1/emupcm.c +0 -2
@@ -1366,7 +1366,6 @@ static const struct snd_pcm_ops snd_emu10k1_playback_ops = { .prepare = snd_emu10k1_playback_prepare, .trigger = snd_emu10k1_playback_trigger, .pointer = snd_emu10k1_playback_pointer, - .page = snd_pcm_sgbuf_ops_page, };static const struct snd_pcm_ops snd_emu10k1_capture_ops = {
@@ -1390,7 +1389,6 @@ static const struct snd_pcm_ops snd_emu10k1_efx_playback_ops = { .prepare = snd_emu10k1_efx_playback_prepare, .trigger = snd_emu10k1_efx_playback_trigger, .pointer = snd_emu10k1_efx_playback_pointer, - .page = snd_pcm_sgbuf_ops_page, };int snd_emu10k1_pcm (struct snd_emu10k1 *emu,int device)
sound/pci/hda/hda_controller.c +0 -1
@@ -701,7 +701,6 @@ static const struct snd_pcm_ops azx_pcm_ops = { .pointer = azx_pcm_pointer, .get_time_info = azx_get_time_info, .mmap = azx_pcm_mmap, - .page = snd_pcm_sgbuf_ops_page, };static void azx_pcm_free (struct snd_pcm *pcm)
sound/pci/lola/lola_pcm.c +0 -1
@@ -582,7 +582,6 @@ static const struct snd_pcm_ops lola_pcm_ops = { .prepare = lola_pcm_prepare, .trigger = lola_pcm_trigger, .pointer = lola_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };int lola_create_pcm (struct lola *chip)
sound/pci/riptide/riptide.c +0 -2
@@ -1661,7 +1661,6 @@ static const struct snd_pcm_ops snd_riptide_playback_ops = { .hw_params = snd_riptide_hw_params, .hw_free = snd_riptide_hw_free, .prepare = snd_riptide_prepare, - .page = snd_pcm_sgbuf_ops_page, .trigger = snd_riptide_trigger, .pointer = snd_riptide_pointer, };
@@ -1672,7 +1671,6 @@ static const struct snd_pcm_ops snd_riptide_capture_ops = { .hw_params = snd_riptide_hw_params, .hw_free = snd_riptide_hw_free, .prepare = snd_riptide_prepare, - .page = snd_pcm_sgbuf_ops_page, .trigger = snd_riptide_trigger, .pointer = snd_riptide_pointer, };
sound/pci/rme9652/hdspm.c +0 -1
@@ -6368,7 +6368,6 @@ static const struct snd_pcm_ops snd_hdspm_ops = { .prepare = snd_hdspm_prepare, .trigger = snd_hdspm_trigger, .pointer = snd_hdspm_hw_pointer, - .page = snd_pcm_sgbuf_ops_page, }; static int snd_hdspm_create_hwdep(struct snd_card *card,
sound/pci/trident/trident_main.c +0 -2
@@ -2076,7 +2076,6 @@ static const struct snd_pcm_ops snd_trident_nx_playback_ops = { .prepare = snd_trident_playback_prepare, .trigger = snd_trident_trigger, .pointer = snd_trident_playback_pointer, - .page = snd_pcm_sgbuf_ops_page, };static const struct snd_pcm_ops snd_trident_capture_ops = {
@@ -2121,7 +2120,6 @@ static const struct snd_pcm_ops snd_trident_nx_foldback_ops = { .prepare = snd_trident_foldback_prepare, .trigger = snd_trident_trigger, .pointer = snd_trident_playback_pointer, - .page = snd_pcm_sgbuf_ops_page, };static const struct snd_pcm_ops snd_trident_spdif_ops = {
sound/pci/via82xx.c +0 -5
@@ -1363,7 +1363,6 @@ static const struct snd_pcm_ops snd_via686_playback_ops = { .prepare = snd_via686_playback_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via686_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* via686 capture callbacks */
@@ -1376,7 +1375,6 @@ static const struct snd_pcm_ops snd_via686_capture_ops = { .prepare = snd_via686_capture_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via686_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* via823x DSX playback callbacks */
@@ -1389,7 +1387,6 @@ static const struct snd_pcm_ops snd_via8233_playback_ops = { .prepare = snd_via8233_playback_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via8233_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* via823x multi-channel playback callbacks */
@@ -1402,7 +1399,6 @@ static const struct snd_pcm_ops snd_via8233_multi_ops = { .prepare = snd_via8233_multi_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via8233_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* via823x capture callbacks */
@@ -1415,7 +1411,6 @@ static const struct snd_pcm_ops snd_via8233_capture_ops = { .prepare = snd_via8233_capture_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via8233_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };
sound/pci/via82xx_modem.c +0 -2
@@ -801,7 +801,6 @@ static const struct snd_pcm_ops snd_via686_playback_ops = { .prepare = snd_via82xx_pcm_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via686_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };/* via686 capture callbacks */
@@ -814,7 +813,6 @@ static const struct snd_pcm_ops snd_via686_capture_ops = { .prepare = snd_via82xx_pcm_prepare, .trigger = snd_via82xx_pcm_trigger, .pointer = snd_via686_pcm_pointer, - .page = snd_pcm_sgbuf_ops_page, };
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 19/24 ALSA: aoa: Avoid non-standard macro usage
In reply to Takashi IwaiPass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.
--- sound/aoa/soundbus/i2sbus/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/aoa/soundbus/i2sbus/pcm.c +1 -1
@@ -1028,7 +1028,7 @@ i2sbus_attach_codec(struct soundbus_dev *dev, struct snd_card *card,/* well, we really should support scatter/gather DMA */ snd_pcm_lib_preallocate_pages_for_all ( dev->pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (macio_get_pci_dev (i2sdev->macio)), + &macio_get_pci_dev (i2sdev->macio)->dev,64 *1024 ,64 *1024 );return 0 ;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 20/24 ALSA: echoaudio: Avoid non-standard macro usage
In reply to Takashi IwaiPass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.
Also slightly refactor the code (drop the return value check from the preallocation) as it never returns an error.
--- sound/pci/echoaudio/echoaudio.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
sound/pci/echoaudio/echoaudio.c +7 -13
@@ -324,7 +324,7 @@ static int pcm_open(struct snd_pcm_substream *substream,/* Finally allocate a page for the scatter-gather list */ if ((err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,PAGE_SIZE , &pipe->sgpage)) <0 ) {dev_err (chip->card->dev,"s-g list allocation failed\n" );return err;
@@ -865,7 +865,7 @@ static const struct snd_pcm_ops digital_capture_ops = {/* Preallocate memory only for the first substream because it's the most * used one */ -static int snd_echo_preallocate_pages (struct snd_pcm *pcm,struct device *dev) +static void snd_echo_preallocate_pages (struct snd_pcm *pcm,struct device *dev) {struct snd_pcm_substream *ss;int stream;
@@ -876,8 +876,6 @@ static int snd_echo_preallocate_pages(struct snd_pcm *pcm, struct device *dev) dev, ss->number ?0 :128 <<10 , 256<<10); - -return 0 ; }
@@ -904,8 +902,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip)strcpy (pcm->name, chip->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &analog_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &analog_capture_ops); -if ((err =snd_echo_preallocate_pages (pcm,snd_dma_pci_data (chip->pci))) <0 ) -return err; +snd_echo_preallocate_pages (pcm, &chip->pci->dev);#ifdef ECHOCARD_HAS_DIGITAL_IO /* PCM#1 Digital inputs, no outputs */
@@ -916,8 +913,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip) chip->digital_pcm = pcm;strcpy (pcm->name, chip->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &digital_capture_ops); -if ((err =snd_echo_preallocate_pages (pcm,snd_dma_pci_data (chip->pci))) <0 ) -return err; +snd_echo_preallocate_pages (pcm, &chip->pci->dev);#endif /* ECHOCARD_HAS_DIGITAL_IO */ #else /* ECHOCARD_HAS_VMIXER */
@@ -937,8 +933,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip)strcpy (pcm->name, chip->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &analog_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &analog_capture_ops); -if ((err =snd_echo_preallocate_pages (pcm,snd_dma_pci_data (chip->pci))) <0 ) -return err; +snd_echo_preallocate_pages (pcm, &chip->pci->dev);#ifdef ECHOCARD_HAS_DIGITAL_IO /* PCM#1 Digital i/o */
@@ -951,8 +946,7 @@ static int snd_echo_new_pcm(struct echoaudio *chip)strcpy (pcm->name, chip->card->shortname);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &digital_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &digital_capture_ops); -if ((err =snd_echo_preallocate_pages (pcm,snd_dma_pci_data (chip->pci))) <0 ) -return err; +snd_echo_preallocate_pages (pcm, &chip->pci->dev);#endif /* ECHOCARD_HAS_DIGITAL_IO */ #endif /* ECHOCARD_HAS_VMIXER */
@@ -1954,7 +1948,7 @@ static int snd_echo_create(struct snd_card *card,/* Create the DSP comm page - this is the area of memory used for most of the communication with the DSP, which accesses it via bus mastering */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,sizeof (struct comm_page ), &chip->commpage_dma_buf) <0 ) {dev_err (chip->card->dev,"cannot allocate the comm page\n" );
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 21/24 ALSA: es1968: Avoid non-standard macro usage
In reply to Takashi IwaiPass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.
Along with it, the unneeded assignment before snd_dma_alloc_pages*() call is dropped.
--- sound/pci/es1968.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/pci/es1968.c +1 -3
@@ -1422,10 +1422,8 @@ snd_es1968_init_dmabuf(struct es1968 *chip)int err;struct esm_memory *chunk; - chip->dma.dev.type =SNDRV_DMA_TYPE_DEV ; - chip->dma.dev.dev =snd_dma_pci_data (chip->pci); err =snd_dma_alloc_pages_fallback (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev, chip->total_bufsize, &chip->dma);if (err <0 || ! chip->dma.area) { dev_err(chip->card->dev,
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 22/24 ALSA: rme: Avoid non-standard macro usage
In reply to Takashi IwaiPass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.
Along with it, drop the unnecessary assignment before the snd_dma_alloc_pages() call and simplify by returning the error code directly.
--- sound/pci/rme9652/hdsp.c | 7 +------ sound/pci/rme9652/hdspm.c | 2 +- sound/pci/rme9652/rme9652.c | 7 +------ 3 files changed, 3 insertions(+), 13 deletions(-)
sound/pci/rme9652/hdsp.c +1 -6
@@ -569,12 +569,7 @@ static char channel_map_H9632_qs[HDSP_MAX_CHANNELS] = {static int snd_hammerfall_get_buffer (struct pci_dev *pci,struct snd_dma_buffer *dmab,size_t size) { - dmab->dev.type =SNDRV_DMA_TYPE_DEV ; - dmab->dev.dev =snd_dma_pci_data (pci); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), - size, dmab) <0 ) -return -ENOMEM ; -return 0 ; +return snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, size, dmab); }static void snd_hammerfall_free_buffer (struct snd_dma_buffer *dmab,struct pci_dev *pci)
sound/pci/rme9652/hdspm.c +1 -1
@@ -6406,7 +6406,7 @@ static int snd_hdspm_preallocate_memory(struct hdspm *hdspm) wanted =HDSPM_DMA_AREA_BYTES ;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (hdspm->pci), + &hdspm->pci->dev, wanted, wanted);dev_dbg (hdspm->card->dev," Preallocated %zd Bytes\n" , wanted);return 0 ;
sound/pci/rme9652/rme9652.c +1 -6
@@ -279,12 +279,7 @@ static char channel_map_9636_ds[26] = {static int snd_hammerfall_get_buffer (struct pci_dev *pci,struct snd_dma_buffer *dmab,size_t size) { - dmab->dev.type =SNDRV_DMA_TYPE_DEV ; - dmab->dev.dev =snd_dma_pci_data (pci); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), - size, dmab) <0 ) -return -ENOMEM ; -return 0 ; +return snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, size, dmab); }static void snd_hammerfall_free_buffer (struct snd_dma_buffer *dmab,struct pci_dev *pci)
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 23/24 ALSA: pci: Avoid non-standard macro usage
In reply to Takashi IwaiPass the device pointer from the PCI pointer directly, instead of a non-standard macro. The macro didn't give any better readability.
--- sound/pci/ad1889.c | 6 +++--- sound/pci/ali5451/ali5451.c | 2 +- sound/pci/als300.c | 3 ++- sound/pci/als4000.c | 3 ++- sound/pci/asihpi/asihpi.c | 4 ++-- sound/pci/atiixp.c | 6 +++--- sound/pci/atiixp_modem.c | 4 ++-- sound/pci/au88x0/au88x0_pcm.c | 2 +- sound/pci/aw2/aw2-alsa.c | 6 +++--- sound/pci/azt3328.c | 8 ++++---- sound/pci/bt87x.c | 4 ++-- sound/pci/ca0106/ca0106_main.c | 6 +++--- sound/pci/cmipci.c | 6 +++--- sound/pci/cs4281.c | 3 ++- sound/pci/cs46xx/cs46xx_lib.c | 16 ++++++++++------ sound/pci/cs5535audio/cs5535audio_pcm.c | 6 +++--- sound/pci/ctxfi/ctpcm.c | 3 ++- sound/pci/ctxfi/ctvmem.c | 2 +- sound/pci/emu10k1/emu10k1.c | 5 +++-- sound/pci/emu10k1/emu10k1x.c | 6 +++--- sound/pci/emu10k1/emufx.c | 2 +- sound/pci/emu10k1/emupcm.c | 10 +++++----- sound/pci/emu10k1/memory.c | 4 ++-- sound/pci/emu10k1/p16v.c | 4 ++-- sound/pci/ens1370.c | 8 +++++--- sound/pci/es1938.c | 3 ++- sound/pci/fm801.c | 2 +- sound/pci/ice1712/ice1712.c | 9 ++++++--- sound/pci/ice1712/ice1724.c | 6 +++--- sound/pci/intel8x0.c | 4 ++-- sound/pci/intel8x0m.c | 4 ++-- sound/pci/korg1212/korg1212.c | 8 ++++---- sound/pci/lola/lola.c | 2 +- sound/pci/lola/lola_pcm.c | 4 ++-- sound/pci/lx6464es/lx6464es.c | 2 +- sound/pci/maestro3.c | 3 ++- sound/pci/mixart/mixart.c | 7 ++++--- sound/pci/oxygen/oxygen_pcm.c | 10 +++++----- sound/pci/pcxhr/pcxhr.c | 4 ++-- sound/pci/riptide/riptide.c | 4 ++-- sound/pci/sis7019.c | 3 ++- sound/pci/sonicvibes.c | 3 ++- sound/pci/trident/trident_main.c | 22 ++++++++++++++-------- sound/pci/via82xx.c | 12 ++++++------ sound/pci/via82xx_modem.c | 4 ++-- sound/pci/ymfpci/ymfpci_main.c | 16 ++++++++++------ 46 files changed, 145 insertions(+), 116 deletions(-)
sound/pci/ad1889.c +3 -3
@@ -633,9 +633,9 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device) chip->csubs =NULL ;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), -BUFFER_BYTES_MAX /2 , -BUFFER_BYTES_MAX ); + &chip->pci->dev, +BUFFER_BYTES_MAX /2 , +BUFFER_BYTES_MAX );return 0 ; }
sound/pci/ali5451/ali5451.c +1 -1
@@ -1672,7 +1672,7 @@ static int snd_ali_pcm(struct snd_ali *codec, int device, desc->capture_ops);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (codec->pci), + &codec->pci->dev,64 *1024 ,128 *1024 ); pcm->info_flags =0 ;
sound/pci/als300.c +2 -1
@@ -592,7 +592,8 @@ static int snd_als300_new_pcm(struct snd_als300 *chip)/* pre-allocation of buffers */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,64 *1024 ); + &chip->pci->dev, +64 *1024 ,64 *1024 );return 0 ; }
sound/pci/als4000.c +2 -1
@@ -693,7 +693,8 @@ static int snd_als4000_pcm(struct snd_sb *chip, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_als4000_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_als4000_capture_ops); -snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , + &chip->pci->dev,64 *1024 ,64 *1024 ); chip->pcm = pcm;
sound/pci/asihpi/asihpi.c +2 -2
@@ -1325,8 +1325,8 @@ static int snd_card_asihpi_pcm_new(struct snd_card_asihpi *asihpi, int device)/*? do we want to emulate MMAP for non-BBM cards? Jack doesn't work with ALSAs MMAP emulation - WHY NOT? */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (asihpi->pci), -64 *1024 ,BUFFER_BYTES_MAX ); + &asihpi->pci->dev, +64 *1024 ,BUFFER_BYTES_MAX );return 0 ; }
sound/pci/atiixp.c +3 -3
@@ -353,7 +353,7 @@ static int atiixp_build_dma_packets(struct atiixp *chip, struct atiixp_dma *dma,if (dma->desc_buf.area ==NULL ) {if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,ATI_DESC_LIST_SIZE , &dma->desc_buf) <0 )return -ENOMEM ;
@@ -1284,7 +1284,7 @@ static int snd_atiixp_pcm_new(struct atiixp *chip) chip->pcmdevs[ATI_PCMDEV_ANALOG ] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,128 *1024 ); err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -1317,7 +1317,7 @@ static int snd_atiixp_pcm_new(struct atiixp *chip) chip->pcmdevs[ATI_PCMDEV_DIGITAL ] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,128 *1024 );/* pre-select AC97 SPDIF slots 10/11 */
sound/pci/atiixp_modem.c +2 -2
@@ -321,7 +321,7 @@ static int atiixp_build_dma_packets(struct atiixp_modem *chip,return -ENOMEM ;if (dma->desc_buf.area ==NULL ) { -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,ATI_DESC_LIST_SIZE , &dma->desc_buf) <0 )return -ENOMEM ; dma->period_bytes = dma->periods =0 ;/* clear */
@@ -995,7 +995,7 @@ static int snd_atiixp_pcm_new(struct atiixp_modem *chip) chip->pcmdevs[ATI_PCMDEV_ANALOG ] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,128 *1024 );return 0 ;
sound/pci/au88x0/au88x0_pcm.c +1 -1
@@ -637,7 +637,7 @@ static int snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)/* pre-allocation of Scatter-Gather buffers */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci_dev), + &chip->pci_dev,0x10000 ,0x10000 );switch (VORTEX_PCM_TYPE (pcm)) {
sound/pci/aw2/aw2-alsa.c +3 -3
@@ -613,7 +613,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)/* Preallocate continuous pages. */ snd_pcm_lib_preallocate_pages_for_all (pcm_playback_ana,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,64 *1024 ); err = snd_pcm_new(chip->card, "Audiowerk2 digital playback", 1, 1, 0,
@@ -645,7 +645,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)/* Preallocate continuous pages. */ snd_pcm_lib_preallocate_pages_for_all (pcm_playback_num,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,64 *1024 ); err = snd_pcm_new(chip->card, "Audiowerk2 capture", 2, 0, 1,
@@ -678,7 +678,7 @@ static int snd_aw2_new_pcm(struct aw2 *chip)/* Preallocate continuous pages. */ snd_pcm_lib_preallocate_pages_for_all (pcm_capture,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,64 *1024 );/* Create control */
sound/pci/azt3328.c +4 -4
@@ -2135,8 +2135,8 @@ snd_azf3328_pcm(struct snd_azf3328 *chip) chip->pcm[AZF_CODEC_CAPTURE ] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), -64 *1024 ,64 *1024 ); + &chip->pci->dev, +64 *1024 ,64 *1024 ); err =snd_pcm_new (chip->card,"AZF3328 I2S OUT" ,AZF_PCMDEV_I2S_OUT ,1 ,0 , &pcm);
@@ -2151,8 +2151,8 @@ snd_azf3328_pcm(struct snd_azf3328 *chip) chip->pcm[AZF_CODEC_I2S_OUT ] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), -64 *1024 ,64 *1024 ); + &chip->pci->dev, +64 *1024 ,64 *1024 );return 0 ; }
sound/pci/bt87x.c +2 -2
@@ -217,7 +217,7 @@ static int snd_bt87x_create_risc(struct snd_bt87x *chip, struct snd_pcm_substrea__le32 *risc;if (chip->dma_risc.area ==NULL ) { -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,PAGE_ALIGN (MAX_RISC_SIZE ), &chip->dma_risc) <0 )return -ENOMEM ; }
@@ -700,7 +700,7 @@ static int snd_bt87x_pcm(struct snd_bt87x *chip, int device, char *name)strcpy (pcm->name, name);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_bt87x_pcm_ops);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,128 *1024 ,ALIGN (255 *4092 ,1024 ));return 0 ;
sound/pci/ca0106/ca0106_main.c +3 -3
@@ -1389,7 +1389,7 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device)substream ; substream = substream->next) {snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 ); }
@@ -1397,7 +1397,7 @@ static int snd_ca0106_pcm(struct snd_ca0106 *emu, int device)substream ; substream = substream->next) {snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 ); }
@@ -1692,7 +1692,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card, chip->irq = pci->irq;/* This stores the periods table. */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev,1024 , &chip->buffer) <0 ) {snd_ca0106_free (chip);return -ENOMEM ;
sound/pci/cmipci.c +3 -3
@@ -1902,7 +1902,7 @@ static int snd_cmipci_pcm_new(struct cmipci *cm, int device) cm->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (cm->pci),64 *1024 ,128 *1024 ); + &cm->pci->dev,64 *1024 ,128 *1024 );return 0 ; }
@@ -1924,7 +1924,7 @@ static int snd_cmipci_pcm2_new(struct cmipci *cm, int device) cm->pcm2 = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (cm->pci),64 *1024 ,128 *1024 ); + &cm->pci->dev,64 *1024 ,128 *1024 );return 0 ; }
@@ -1947,7 +1947,7 @@ static int snd_cmipci_pcm_spdif_new(struct cmipci *cm, int device) cm->pcm_spdif = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (cm->pci),64 *1024 ,128 *1024 ); + &cm->pci->dev,64 *1024 ,128 *1024 ); err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, snd_pcm_alt_chmaps, cm->max_channels, 0,
sound/pci/cs4281.c +2 -1
@@ -975,7 +975,8 @@ static int snd_cs4281_pcm(struct cs4281 *chip, int device) chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,512 *1024 ); + &chip->pci->dev, +64 *1024 ,512 *1024 );return 0 ; }
sound/pci/cs46xx/cs46xx_lib.c +10 -6
@@ -1494,7 +1494,7 @@ static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,in cpcm =kzalloc (sizeof (*cpcm),GFP_KERNEL );if (cpcm ==NULL )return -ENOMEM ; -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,PAGE_SIZE , &cpcm->hw_buf) <0 ) {kfree (cpcm);return -ENOMEM ;
@@ -1582,7 +1582,7 @@ static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream) {struct snd_cs46xx *chip =snd_pcm_substream_chip (substream); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,PAGE_SIZE , &chip->capt.hw_buf) <0 )return -ENOMEM ; chip->capt.substream = substream;
@@ -1784,7 +1784,8 @@ int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device) chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
@@ -1809,7 +1810,8 @@ int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device) chip->pcm_rear = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
@@ -1832,7 +1834,8 @@ int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device) chip->pcm_center_lfe = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
@@ -1855,7 +1858,8 @@ int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device) chip->pcm_iec958 = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
sound/pci/cs5535audio/cs5535audio_pcm.c +3 -3
@@ -117,7 +117,7 @@ static int cs5535audio_build_dma_packets(struct cs5535audio *cs5535au,if (dma->desc_buf.area ==NULL ) {if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (cs5535au->pci), + &cs5535au->pci->dev,CS5535AUDIO_DESC_LIST_SIZE +1 , &dma->desc_buf) <0 )return -ENOMEM ;
@@ -432,8 +432,8 @@ int snd_cs5535audio_pcm(struct cs5535audio *cs5535au)strcpy (pcm->name,"CS5535 Audio" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (cs5535au->pci), -64 *1024 ,128 *1024 ); + &cs5535au->pci->dev, +64 *1024 ,128 *1024 ); cs5535au->pcm = pcm;return 0 ;
sound/pci/ctxfi/ctpcm.c +2 -1
@@ -450,7 +450,8 @@ int ct_alsa_pcm_create(struct ct_atc *atc, SNDRV_PCM_STREAM_CAPTURE, &ct_pcm_capture_ops);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (atc->pci),128 *1024 ,128 *1024 ); + &atc->pci->dev, +128 *1024 ,128 *1024 ); chs =2 ;switch (device) {
sound/pci/ctxfi/ctvmem.c +1 -1
@@ -183,7 +183,7 @@ int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci)/* Allocate page table pages */ for (i =0 ; i <CT_PTP_NUM ; i++) { err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (pci), + &pci->dev,PAGE_SIZE , &vm->ptp[i]);if (err <0 )break ;
sound/pci/emu10k1/emu10k1.c +3 -2
@@ -124,8 +124,9 @@ static int snd_card_emu10k1_probe(struct pci_dev *pci, goto error;/* This stores the periods table. */ if (emu->card_capabilities->ca0151_chip) {/* P16V */ -if ((err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), -1024 , &emu->p16v_buffer)) <0 ) + err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, +1024 , &emu->p16v_buffer); +if (err <0 ) goto error; }
sound/pci/emu10k1/emu10k1x.c +3 -3
@@ -877,7 +877,7 @@ static int snd_emu10k1x_pcm(struct emu10k1x *emu, int device) emu->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,32 *1024 ,32 *1024 ); return snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK, map, 2,
@@ -936,8 +936,8 @@ static int snd_emu10k1x_create(struct snd_card *card, } chip->irq = pci->irq; -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), -4 *1024 , &chip->dma_buffer) <0 ) { +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, +4 *1024 , &chip->dma_buffer) <0 ) {snd_emu10k1x_free (chip);return -ENOMEM ; }
sound/pci/emu10k1/emufx.c +1 -1
@@ -2464,7 +2464,7 @@ int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size) }if (size >0 ) { -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (emu->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &emu->pci->dev, size *2 , &emu->fx8010.etram_pages) <0 )return -ENOMEM ;memset (emu->fx8010.etram_pages.area,0 , size *2 );
sound/pci/emu10k1/emupcm.c +5 -5
@@ -1412,12 +1412,12 @@ int snd_emu10k1_pcm(struct snd_emu10k1 *emu, int device)for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream; substream; substream = substream->next)snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 );for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream; substream; substream = substream->next)snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 );return 0 ;
@@ -1443,7 +1443,7 @@ int snd_emu10k1_pcm_multi(struct snd_emu10k1 *emu, int device)for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream; substream; substream = substream->next)snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 );return 0 ;
@@ -1478,7 +1478,7 @@ int snd_emu10k1_pcm_mic(struct snd_emu10k1 *emu, int device) emu->pcm_mic = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 );return 0 ;
@@ -1853,7 +1853,7 @@ int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device)return err;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,64 *1024 ,64 *1024 );return 0 ;
sound/pci/emu10k1/memory.c +2 -2
@@ -387,7 +387,7 @@ int snd_emu10k1_alloc_pages_maybe_wider(struct snd_emu10k1 *emu, size_t size, }return snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), size, dmab); + &emu->pci->dev, size, dmab); }/*
@@ -477,7 +477,7 @@ static void __synth_free_pages(struct snd_emu10k1 *emu, int first_page,int page; dmab.dev.type =SNDRV_DMA_TYPE_DEV ; - dmab.dev.dev =snd_dma_pci_data (emu->pci); + dmab.dev.dev = &emu->pci->dev;for (page = first_page; page <= last_page; page++) {if (emu->page_ptr_table[page] ==NULL )
sound/pci/emu10k1/p16v.c +2 -2
@@ -643,7 +643,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device)substream ; substream = substream->next) {snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev, (65536 -64 ) *8 , (65536 -64 ) *8 );/*
@@ -656,7 +656,7 @@ int snd_p16v_pcm(struct snd_emu10k1 *emu, int device)substream ; substream = substream->next) {snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (emu->pci), + &emu->pci->dev,65536 -64 ,65536 -64 );/* dev_dbg(emu->card->dev,
sound/pci/ens1370.c +5 -3
@@ -1275,7 +1275,8 @@ static int snd_ensoniq_pcm(struct ensoniq *ensoniq, int device) ensoniq->pcm1 = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ensoniq->pci),64 *1024 ,128 *1024 ); + &ensoniq->pci->dev, +64 *1024 ,128 *1024 );#ifdef CHIP1370 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -1307,7 +1308,8 @@ static int snd_ensoniq_pcm2(struct ensoniq *ensoniq, int device) ensoniq->pcm2 = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ensoniq->pci),64 *1024 ,128 *1024 ); + &ensoniq->pci->dev, +64 *1024 ,128 *1024 );#ifdef CHIP1370 err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -2095,7 +2097,7 @@ static int snd_ensoniq_create(struct snd_card *card, } ensoniq->irq = pci->irq;#ifdef CHIP1370 -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev,16 , &ensoniq->dma_bug) <0 ) {dev_err (card->dev,"unable to allocate space for phantom area - dma_bug\n" );snd_ensoniq_free (ensoniq);
sound/pci/es1938.c +2 -1
@@ -1032,7 +1032,8 @@ static int snd_es1938_new_pcm(struct es1938 *chip, int device)strcpy (pcm->name,"ESS Solo-1" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,64 *1024 ); + &chip->pci->dev, +64 *1024 ,64 *1024 ); chip->pcm = pcm;return 0 ;
sound/pci/fm801.c +1 -1
@@ -721,7 +721,7 @@ static int snd_fm801_pcm(struct fm801 *chip, int device) chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (pdev), + &pdev->dev, chip->multichannel ?128 *1024 :64 *1024 ,128 *1024 ); return snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
sound/pci/ice1712/ice1712.c +6 -3
@@ -884,7 +884,8 @@ static int snd_ice1712_pcm(struct snd_ice1712 *ice, int device) ice->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci),64 *1024 ,64 *1024 ); + &ice->pci->dev, +64 *1024 ,64 *1024 );dev_warn (ice->card->dev,"Consumer PCM code does not work well at the moment --jk\n" );
@@ -909,7 +910,8 @@ static int snd_ice1712_pcm_ds(struct snd_ice1712 *ice, int device) ice->pcm_ds = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci),64 *1024 ,128 *1024 ); + &ice->pci->dev, +64 *1024 ,128 *1024 );return 0 ; }
@@ -1253,7 +1255,8 @@ static int snd_ice1712_pcm_profi(struct snd_ice1712 *ice, int device)strcpy (pcm->name,"ICE1712 multi" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci),256 *1024 ,256 *1024 ); + &ice->pci->dev, +256 *1024 ,256 *1024 ); ice->pcm_pro = pcm;
sound/pci/ice1712/ice1724.c +3 -3
@@ -1143,7 +1143,7 @@ static int snd_vt1724_pcm_profi(struct snd_ice1712 *ice, int device)strcpy (pcm->name,"ICE1724" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci), + &ice->pci->dev,256 *1024 ,256 *1024 ); ice->pcm_pro = pcm;
@@ -1341,7 +1341,7 @@ static int snd_vt1724_pcm_spdif(struct snd_ice1712 *ice, int device)strcpy (pcm->name, name);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci), + &ice->pci->dev,256 *1024 ,256 *1024 ); ice->pcm = pcm;
@@ -1455,7 +1455,7 @@ static int snd_vt1724_pcm_indep(struct snd_ice1712 *ice, int device)strcpy (pcm->name,"ICE1724 Surround PCM" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (ice->pci), + &ice->pci->dev,256 *1024 ,256 *1024 ); ice->pcm_ds = pcm;
sound/pci/intel8x0.c +2 -2
@@ -1488,7 +1488,7 @@ static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device, chip->pcm[device] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,intel8x0_dma_type (chip), -snd_dma_pci_data (chip->pci), + &chip->pci->dev, rec->prealloc_size, rec->prealloc_max_size); if (rec->playback_ops &&
@@ -3047,7 +3047,7 @@ static int snd_intel8x0_create(struct snd_card *card,/* allocate buffer descriptor lists */ /* the start of each lists must be aligned to 8 bytes */ -if (snd_dma_alloc_pages (intel8x0_dma_type (chip),snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (intel8x0_dma_type (chip), &pci->dev, chip->bdbars_count *sizeof (u32) *ICH_MAX_FRAGS *2 , &chip->bdbars) <0 ) {snd_intel8x0_free (chip);
sound/pci/intel8x0m.c +2 -2
@@ -734,7 +734,7 @@ static int snd_intel8x0m_pcm1(struct intel8x0m *chip, int device, chip->pcm[device] = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev, rec->prealloc_size, rec->prealloc_max_size);
@@ -1176,7 +1176,7 @@ static int snd_intel8x0m_create(struct snd_card *card,/* allocate buffer descriptor lists */ /* the start of each lists must be aligned to 8 bytes */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, chip->bdbars_count *sizeof (u32) *ICH_MAX_FRAGS *2 , &chip->bdbars) <0 ) {snd_intel8x0m_free (chip);
sound/pci/korg1212/korg1212.c +4 -4
@@ -2275,7 +2275,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, korg1212->idRegPtr, stateName[korg1212->cardState]); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev,sizeof (struct KorgSharedBuffer ), &korg1212->dma_shared) <0 ) {snd_printk (KERN_ERR "korg1212: can not allocate shared buffer memory (%zd bytes)\n" ,sizeof (struct KorgSharedBuffer ));snd_korg1212_free (korg1212);
@@ -2290,7 +2290,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci, korg1212->DataBufsSize =sizeof (struct KorgAudioBuffer ) * kNumBuffers; -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, korg1212->DataBufsSize, &korg1212->dma_play) <0 ) {snd_printk (KERN_ERR "korg1212: can not allocate play data buffer memory (%d bytes)\n" , korg1212->DataBufsSize);snd_korg1212_free (korg1212);
@@ -2302,7 +2302,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,K1212_DEBUG_PRINTK ("K1212_DEBUG: Play Data Area = 0x%p (0x%08x), %d bytes\n" , korg1212->playDataBufsPtr, korg1212->PlayDataPhy, korg1212->DataBufsSize); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, korg1212->DataBufsSize, &korg1212->dma_rec) <0 ) {snd_printk (KERN_ERR "korg1212: can not allocate record data buffer memory (%d bytes)\n" , korg1212->DataBufsSize);snd_korg1212_free (korg1212);
@@ -2337,7 +2337,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,return err; } -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, dsp_code->size, &korg1212->dma_dsp) <0 ) {snd_printk (KERN_ERR "korg1212: cannot allocate dsp code memory (%zd bytes)\n" , dsp_code->size);snd_korg1212_free (korg1212);
sound/pci/lola/lola.c +1 -1
@@ -350,7 +350,7 @@ static int setup_corb_rirb(struct lola *chip)unsigned long end_time; err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,PAGE_SIZE , &chip->rb);if (err <0 )return err;
sound/pci/lola/lola_pcm.c +2 -2
@@ -591,7 +591,7 @@ int lola_create_pcm(struct lola *chip)for (i =0 ; i <2 ; i++) { err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,PAGE_SIZE , &chip->pcm[i].bdl);if (err <0 )return err;
@@ -611,7 +611,7 @@ int lola_create_pcm(struct lola *chip) }/* buffer pre-allocation */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,1024 *64 ,32 *1024 *1024 );return 0 ; }
sound/pci/lx6464es/lx6464es.c +1 -1
@@ -846,7 +846,7 @@ static int lx_pcm_create(struct lx6464es *chip)strcpy (pcm->name, card_name);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev, size, size); chip->pcm = pcm;
sound/pci/maestro3.c +2 -1
@@ -1861,7 +1861,8 @@ snd_m3_pcm(struct snd_m3 * chip, int device) chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,64 *1024 ); + &chip->pci->dev, +64 *1024 ,64 *1024 );return 0 ; }
sound/pci/mixart/mixart.c +4 -3
@@ -948,7 +948,8 @@ static void preallocate_buffers(struct snd_mixart *chip, struct snd_pcm *pcm) }#endif snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->mgr->pci),32 *1024 ,32 *1024 ); + &chip->mgr->pci->dev, +32 *1024 ,32 *1024 ); }/*
@@ -1360,7 +1361,7 @@ static int snd_mixart_probe(struct pci_dev *pci,/* create array of streaminfo */ size =PAGE_ALIGN ( (MIXART_MAX_STREAM_PER_CARD *MIXART_MAX_CARDS *sizeof (struct mixart_flowinfo )) ); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, size, &mgr->flowinfo) <0 ) {snd_mixart_free (mgr);return -ENOMEM ;
@@ -1371,7 +1372,7 @@ static int snd_mixart_probe(struct pci_dev *pci,/* create array of bufferinfo */ size =PAGE_ALIGN ( (MIXART_MAX_STREAM_PER_CARD *MIXART_MAX_CARDS *sizeof (struct mixart_bufferinfo )) ); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, size, &mgr->bufferinfo) <0 ) {snd_mixart_free (mgr);return -ENOMEM ;
sound/pci/oxygen/oxygen_pcm.c +5 -5
@@ -713,13 +713,13 @@ int oxygen_pcm_init(struct oxygen *chip)if (outs)snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,DEFAULT_BUFFER_BYTES_MULTICH ,BUFFER_BYTES_MAX_MULTICH );if (ins)snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,DEFAULT_BUFFER_BYTES ,BUFFER_BYTES_MAX ); }
@@ -739,7 +739,7 @@ int oxygen_pcm_init(struct oxygen *chip) pcm->private_data = chip;strcpy (pcm->name,"Digital" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,DEFAULT_BUFFER_BYTES ,BUFFER_BYTES_MAX ); }
@@ -769,7 +769,7 @@ int oxygen_pcm_init(struct oxygen *chip) pcm->private_data = chip;strcpy (pcm->name, outs ?"Front Panel" :"Analog 2" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,DEFAULT_BUFFER_BYTES ,BUFFER_BYTES_MAX ); }
@@ -787,7 +787,7 @@ int oxygen_pcm_init(struct oxygen *chip) pcm->private_data = chip;strcpy (pcm->name,"Analog 3" );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,DEFAULT_BUFFER_BYTES ,BUFFER_BYTES_MAX ); }
sound/pci/pcxhr/pcxhr.c +2 -2
@@ -1171,7 +1171,7 @@ int pcxhr_create_pcm(struct snd_pcxhr *chip)strcpy (pcm->name, name);snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->mgr->pci), + &chip->mgr->pci->dev,32 *1024 ,32 *1024 ); chip->pcm = pcm;return 0 ;
@@ -1644,7 +1644,7 @@ static int pcxhr_probe(struct pci_dev *pci,/* create hostport purgebuffer */ size =PAGE_ALIGN (sizeof (struct pcxhr_hostport )); -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &pci->dev, size, &mgr->hostport) <0 ) {pcxhr_free (mgr);return -ENOMEM ;
sound/pci/riptide/riptide.c +2 -2
@@ -1550,7 +1550,7 @@ snd_riptide_hw_params(struct snd_pcm_substream *substream,if (sgdlist->area)snd_dma_free_pages (sgdlist);if ((err =snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,sizeof (struct sgd ) * (DESC_MAX_MASK +1 ), sgdlist)) <0 ) { snd_printk(KERN_ERR "Riptide: failed to alloc %d dma bytes\n",
@@ -1693,7 +1693,7 @@ static int snd_riptide_pcm(struct snd_riptide *chip, int device)strcpy (pcm->name,"RIPTIDE" ); chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,128 *1024 );return 0 ; }
sound/pci/sis7019.c +2 -1
@@ -905,7 +905,8 @@ static int sis_pcm_create(struct sis7019 *sis)* world if this fails. */ snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (sis->pci),64 *1024 ,128 *1024 ); + &sis->pci->dev, +64 *1024 ,128 *1024 );return 0 ; }
sound/pci/sonicvibes.c +2 -1
@@ -884,7 +884,8 @@ static int snd_sonicvibes_pcm(struct sonicvibes *sonic, int device) sonic->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (sonic->pci),64 *1024 ,128 *1024 ); + &sonic->pci->dev, +64 *1024 ,128 *1024 );return 0 ; }
sound/pci/trident/trident_main.c +14 -8
@@ -2184,14 +2184,16 @@ int snd_trident_pcm(struct snd_trident *trident, int device)struct snd_pcm_substream *substream;for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK ].substream; substream; substream = substream->next)snd_pcm_lib_preallocate_pages (substream,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (trident->pci), + &trident->pci->dev,64 *1024 ,128 *1024 );snd_pcm_lib_preallocate_pages (pcm->streams[SNDRV_PCM_STREAM_CAPTURE ].substream, -SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (trident->pci), +SNDRV_DMA_TYPE_DEV , + &trident->pci->dev,64 *1024 ,128 *1024 ); }else {snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (trident->pci),64 *1024 ,128 *1024 ); + &trident->pci->dev, +64 *1024 ,128 *1024 ); }return 0 ;
@@ -2241,10 +2243,12 @@ int snd_trident_foldback_pcm(struct snd_trident *trident, int device)if (trident->tlb.entries)snd_pcm_lib_preallocate_pages_for_all (foldback,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (trident->pci),0 ,128 *1024 ); + &trident->pci->dev, +0 ,128 *1024 );else snd_pcm_lib_preallocate_pages_for_all (foldback,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (trident->pci),64 *1024 ,128 *1024 ); + &trident->pci->dev, +64 *1024 ,128 *1024 );return 0 ; }
@@ -2278,7 +2282,9 @@ int snd_trident_spdif_pcm(struct snd_trident *trident, int device)strcpy (spdif->name,"Trident 4DWave IEC958" ); trident->spdif = spdif; -snd_pcm_lib_preallocate_pages_for_all (spdif,SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (trident->pci),64 *1024 ,128 *1024 ); +snd_pcm_lib_preallocate_pages_for_all (spdif,SNDRV_DMA_TYPE_DEV , + &trident->pci->dev, +64 *1024 ,128 *1024 );return 0 ; }
@@ -3336,7 +3342,7 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident)/* TLB array must be aligned to 16kB !!! so we allocate 32kB region and correct offset when necessary */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (trident->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &trident->pci->dev,2 *SNDRV_TRIDENT_MAX_PAGES *4 , &trident->tlb.buffer) <0 ) {dev_err (trident->card->dev,"unable to allocate TLB buffer\n" );return -ENOMEM ;
@@ -3351,7 +3357,7 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident)return -ENOMEM ;/* allocate and setup silent page and initialise TLB entries */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (trident->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &trident->pci->dev,SNDRV_TRIDENT_PAGE_SIZE , &trident->tlb.silent_page) <0 ) {dev_err (trident->card->dev,"unable to allocate silent page\n" );return -ENOMEM ;
sound/pci/via82xx.c +6 -6
@@ -419,7 +419,7 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre/* the start of each lists must be aligned to 8 bytes, * but the kernel pages are much bigger, so we don't care */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,PAGE_ALIGN (VIA_TABLE_SIZE *2 *8 ), &dev->table) <0 )return -ENOMEM ;
@@ -1454,7 +1454,7 @@ static int snd_via8233_pcm_new(struct via82xx *chip)init_viadev (chip, chip->capture_devno,VIA_REG_CAPTURE_8233_STATUS ,6 ,1 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,VIA_MAX_BUFSIZE ); err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -1478,7 +1478,7 @@ static int snd_via8233_pcm_new(struct via82xx *chip)init_viadev (chip, chip->capture_devno +1 ,VIA_REG_CAPTURE_8233_STATUS +0x10 ,7 ,1 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,VIA_MAX_BUFSIZE ); err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -1521,7 +1521,7 @@ static int snd_via8233a_pcm_new(struct via82xx *chip)init_viadev (chip, chip->capture_devno,VIA_REG_CAPTURE_8233_STATUS ,6 ,1 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,VIA_MAX_BUFSIZE ); err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
@@ -1547,7 +1547,7 @@ static int snd_via8233a_pcm_new(struct via82xx *chip)init_viadev (chip, chip->playback_devno,0x30 ,3 ,0 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,VIA_MAX_BUFSIZE );return 0 ; }
@@ -1577,7 +1577,7 @@ static int snd_via686_pcm_new(struct via82xx *chip)init_viadev (chip,1 ,VIA_REG_CAPTURE_STATUS ,0 ,1 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,VIA_MAX_BUFSIZE );return 0 ; }
sound/pci/via82xx_modem.c +2 -2
@@ -272,7 +272,7 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre/* the start of each lists must be aligned to 8 bytes, * but the kernel pages are much bigger, so we don't care */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,PAGE_ALIGN (VIA_TABLE_SIZE *2 *8 ), &dev->table) <0 )return -ENOMEM ;
@@ -850,7 +850,7 @@ static int snd_via686_pcm_new(struct via82xx_modem *chip)init_viadev (chip,1 ,VIA_REG_MI_STATUS ,1 );snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV_SG , -snd_dma_pci_data (chip->pci), + &chip->pci->dev,64 *1024 ,128 *1024 );return 0 ; }
sound/pci/ymfpci/ymfpci_main.c +10 -6
@@ -587,7 +587,7 @@ static void snd_ymfpci_pcm_init_voice(struct snd_ymfpci_pcm *ypcm, unsigned intstatic int snd_ymfpci_ac3_init (struct snd_ymfpci *chip) { -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev,4096 , &chip->ac3_tmp_base) <0 )return -ENOMEM ;
@@ -1149,7 +1149,8 @@ int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device) chip->pcm = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return snd_pcm_add_chmap_ctls (pcm,SNDRV_PCM_STREAM_PLAYBACK , snd_pcm_std_chmaps,2 ,0 ,NULL );
@@ -1184,7 +1185,8 @@ int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device) chip->pcm2 = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
@@ -1217,7 +1219,8 @@ int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device) chip->pcm_spdif = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return 0 ; }
@@ -1258,7 +1261,8 @@ int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device) chip->pcm_4ch = pcm;snd_pcm_lib_preallocate_pages_for_all (pcm,SNDRV_DMA_TYPE_DEV , -snd_dma_pci_data (chip->pci),64 *1024 ,256 *1024 ); + &chip->pci->dev, +64 *1024 ,256 *1024 );return snd_pcm_add_chmap_ctls (pcm,SNDRV_PCM_STREAM_PLAYBACK , surround_map,2 ,0 ,NULL );
@@ -2108,7 +2112,7 @@ static int snd_ymfpci_memalloc(struct snd_ymfpci *chip) chip->work_size;/* work_ptr must be aligned to 256 bytes, but it's already covered with the kernel page allocation mechanism */ -if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV ,snd_dma_pci_data (chip->pci), +if (snd_dma_alloc_pages (SNDRV_DMA_TYPE_DEV , &chip->pci->dev, size, &chip->work_ptr) <0 )return -ENOMEM ; ptr = chip->work_ptr.area;
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 24/24 ALSA: docs: Remove snd_dma_pci_data() usage in documentation
In reply to Takashi IwaiThe macro will be removed soon later, so update the documentation to reflect that as well.
--- Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/sound/kernel-api/writing-an-alsa-driver.rst +4 -4
@@ -1383,7 +1383,7 @@ shows only the skeleton, how to build up the PCM interfaces. /* pre-allocation of buffers */ /* NOTE: this may fail */ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, - snd_dma_pci_data(chip->pci), + &chip->pci->dev, 64*1024, 64*1024); return 0; }
@@ -1470,7 +1470,7 @@ buffer. For the pre-allocation, simply call the following: :: snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, - snd_dma_pci_data(chip->pci), + &chip->pci->dev, 64*1024, 64*1024); It will allocate a buffer up to 64kB as default. Buffer management
@@ -3514,7 +3514,7 @@ bus). :: snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, - snd_dma_pci_data(pci), size, max); + &pci->dev, size, max); where ``size`` is the byte size to be pre-allocated and the ``max`` is the maximum size to be changed via the ``prealloc`` proc file. The
@@ -3700,7 +3700,7 @@ For creating the SG-buffer handler, call :c:func:`snd_pcm_lib_preallocate_pages()` or :c:func:`snd_pcm_lib_preallocate_pages_for_all()` with ``SNDRV_DMA_TYPE_DEV_SG`` in the PCM constructor like other PCI -pre-allocator. You need to pass ``snd_dma_pci_data(pci)``, where pci is +pre-allocator. You need to pass ``&pci->dev``, where pci is the :c:type:`struct pci_dev <pci_dev>` pointer of the chip as well.
Signature · 6 lines
2.16.4 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel