hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/sound/pci/lola/lola_pcm.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Support for Digigram Lola PCI-e boards
34 *
45 * Copyright (c) 2011 Takashi Iwai <tiwai@suse.de>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published by the Free
8
- * Software Foundation; either version 2 of the License, or (at your option)
9
- * any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
15
- *
16
- * You should have received a copy of the GNU General Public License along with
17
- * this program; if not, write to the Free Software Foundation, Inc., 59
18
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
196 */
207
218 #include <linux/kernel.h>
....@@ -295,8 +282,7 @@
295282 str->bufsize = 0;
296283 str->period_bytes = 0;
297284 str->format_verb = 0;
298
- return snd_pcm_lib_malloc_pages(substream,
299
- params_buffer_bytes(hw_params));
285
+ return 0;
300286 }
301287
302288 static int lola_pcm_hw_free(struct snd_pcm_substream *substream)
....@@ -309,7 +295,7 @@
309295 lola_stream_reset(chip, str);
310296 lola_cleanup_slave_streams(pcm, str);
311297 mutex_unlock(&chip->open_mutex);
312
- return snd_pcm_lib_free_pages(substream);
298
+ return 0;
313299 }
314300
315301 /*
....@@ -589,13 +575,11 @@
589575 static const struct snd_pcm_ops lola_pcm_ops = {
590576 .open = lola_pcm_open,
591577 .close = lola_pcm_close,
592
- .ioctl = snd_pcm_lib_ioctl,
593578 .hw_params = lola_pcm_hw_params,
594579 .hw_free = lola_pcm_hw_free,
595580 .prepare = lola_pcm_prepare,
596581 .trigger = lola_pcm_trigger,
597582 .pointer = lola_pcm_pointer,
598
- .page = snd_pcm_sgbuf_ops_page,
599583 };
600584
601585 int lola_create_pcm(struct lola *chip)
....@@ -605,7 +589,7 @@
605589
606590 for (i = 0; i < 2; i++) {
607591 err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,
608
- snd_dma_pci_data(chip->pci),
592
+ &chip->pci->dev,
609593 PAGE_SIZE, &chip->pcm[i].bdl);
610594 if (err < 0)
611595 return err;
....@@ -624,9 +608,9 @@
624608 snd_pcm_set_ops(pcm, i, &lola_pcm_ops);
625609 }
626610 /* buffer pre-allocation */
627
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
628
- snd_dma_pci_data(chip->pci),
629
- 1024 * 64, 32 * 1024 * 1024);
611
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
612
+ &chip->pci->dev,
613
+ 1024 * 64, 32 * 1024 * 1024);
630614 return 0;
631615 }
632616