| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Support for Digigram Lola PCI-e boards |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 19 | 6 | */ |
|---|
| 20 | 7 | |
|---|
| 21 | 8 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 295 | 282 | str->bufsize = 0; |
|---|
| 296 | 283 | str->period_bytes = 0; |
|---|
| 297 | 284 | str->format_verb = 0; |
|---|
| 298 | | - return snd_pcm_lib_malloc_pages(substream, |
|---|
| 299 | | - params_buffer_bytes(hw_params)); |
|---|
| 285 | + return 0; |
|---|
| 300 | 286 | } |
|---|
| 301 | 287 | |
|---|
| 302 | 288 | static int lola_pcm_hw_free(struct snd_pcm_substream *substream) |
|---|
| .. | .. |
|---|
| 309 | 295 | lola_stream_reset(chip, str); |
|---|
| 310 | 296 | lola_cleanup_slave_streams(pcm, str); |
|---|
| 311 | 297 | mutex_unlock(&chip->open_mutex); |
|---|
| 312 | | - return snd_pcm_lib_free_pages(substream); |
|---|
| 298 | + return 0; |
|---|
| 313 | 299 | } |
|---|
| 314 | 300 | |
|---|
| 315 | 301 | /* |
|---|
| .. | .. |
|---|
| 589 | 575 | static const struct snd_pcm_ops lola_pcm_ops = { |
|---|
| 590 | 576 | .open = lola_pcm_open, |
|---|
| 591 | 577 | .close = lola_pcm_close, |
|---|
| 592 | | - .ioctl = snd_pcm_lib_ioctl, |
|---|
| 593 | 578 | .hw_params = lola_pcm_hw_params, |
|---|
| 594 | 579 | .hw_free = lola_pcm_hw_free, |
|---|
| 595 | 580 | .prepare = lola_pcm_prepare, |
|---|
| 596 | 581 | .trigger = lola_pcm_trigger, |
|---|
| 597 | 582 | .pointer = lola_pcm_pointer, |
|---|
| 598 | | - .page = snd_pcm_sgbuf_ops_page, |
|---|
| 599 | 583 | }; |
|---|
| 600 | 584 | |
|---|
| 601 | 585 | int lola_create_pcm(struct lola *chip) |
|---|
| .. | .. |
|---|
| 605 | 589 | |
|---|
| 606 | 590 | for (i = 0; i < 2; i++) { |
|---|
| 607 | 591 | err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, |
|---|
| 608 | | - snd_dma_pci_data(chip->pci), |
|---|
| 592 | + &chip->pci->dev, |
|---|
| 609 | 593 | PAGE_SIZE, &chip->pcm[i].bdl); |
|---|
| 610 | 594 | if (err < 0) |
|---|
| 611 | 595 | return err; |
|---|
| .. | .. |
|---|
| 624 | 608 | snd_pcm_set_ops(pcm, i, &lola_pcm_ops); |
|---|
| 625 | 609 | } |
|---|
| 626 | 610 | /* 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); |
|---|
| 630 | 614 | return 0; |
|---|
| 631 | 615 | } |
|---|
| 632 | 616 | |
|---|