hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/sound/sh/aica.c
....@@ -1,27 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
2
-* This code is licenced under
3
-* the General Public Licence
4
-* version 2
53 *
64 * Copyright Adrian McMenamin 2005, 2006, 2007
75 * <adrian@mcmen.demon.co.uk>
86 * Requires firmware (BSD licenced) available from:
97 * http://linuxdc.cvs.sourceforge.net/linuxdc/linux-sh-dc/sound/oss/aica/firmware/
108 * or the maintainer
11
-*
12
-* This program is free software; you can redistribute it and/or modify
13
-* it under the terms of version 2 of the GNU General Public License as published by
14
-* the Free Software Foundation.
15
-*
16
-* This program is distributed in the hope that it will be useful,
17
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
-* GNU General Public License for more details.
20
-*
21
-* You should have received a copy of the GNU General Public License
22
-* along with this program; if not, write to the Free Software
23
-* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24
-*
259 */
2610
2711 #include <linux/init.h>
....@@ -379,23 +363,6 @@
379363 return 0;
380364 }
381365
382
-static int snd_aicapcm_pcm_hw_free(struct snd_pcm_substream
383
- *substream)
384
-{
385
- /* Free the DMA buffer */
386
- return snd_pcm_lib_free_pages(substream);
387
-}
388
-
389
-static int snd_aicapcm_pcm_hw_params(struct snd_pcm_substream
390
- *substream, struct snd_pcm_hw_params
391
- *hw_params)
392
-{
393
- /* Allocate a DMA buffer using ALSA built-ins */
394
- return
395
- snd_pcm_lib_malloc_pages(substream,
396
- params_buffer_bytes(hw_params));
397
-}
398
-
399366 static int snd_aicapcm_pcm_prepare(struct snd_pcm_substream
400367 *substream)
401368 {
....@@ -432,9 +399,6 @@
432399 static const struct snd_pcm_ops snd_aicapcm_playback_ops = {
433400 .open = snd_aicapcm_pcm_open,
434401 .close = snd_aicapcm_pcm_close,
435
- .ioctl = snd_pcm_lib_ioctl,
436
- .hw_params = snd_aicapcm_pcm_hw_params,
437
- .hw_free = snd_aicapcm_pcm_hw_free,
438402 .prepare = snd_aicapcm_pcm_prepare,
439403 .trigger = snd_aicapcm_pcm_trigger,
440404 .pointer = snd_aicapcm_pcm_pointer,
....@@ -457,14 +421,12 @@
457421 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
458422 &snd_aicapcm_playback_ops);
459423 /* Allocate the DMA buffers */
460
- err =
461
- snd_pcm_lib_preallocate_pages_for_all(pcm,
462
- SNDRV_DMA_TYPE_CONTINUOUS,
463
- snd_dma_continuous_data
464
- (GFP_KERNEL),
465
- AICA_BUFFER_SIZE,
466
- AICA_BUFFER_SIZE);
467
- return err;
424
+ snd_pcm_set_managed_buffer_all(pcm,
425
+ SNDRV_DMA_TYPE_CONTINUOUS,
426
+ NULL,
427
+ AICA_BUFFER_SIZE,
428
+ AICA_BUFFER_SIZE);
429
+ return 0;
468430 }
469431
470432 /* Mixer controls */