.. | .. |
---|
1 | | -/** |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
| 2 | +/* |
---|
2 | 3 | * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. |
---|
3 | | - * |
---|
4 | | - * This source file is released under GPL v2 license (no other versions). |
---|
5 | | - * See the COPYING file included in the main directory of this source |
---|
6 | | - * distribution for the license terms and conditions. |
---|
7 | 4 | * |
---|
8 | 5 | * @File ctpcm.c |
---|
9 | 6 | * |
---|
.. | .. |
---|
12 | 9 | * |
---|
13 | 10 | * @Author Liu Chun |
---|
14 | 11 | * @Date Apr 2 2008 |
---|
15 | | - * |
---|
16 | 12 | */ |
---|
17 | 13 | |
---|
18 | 14 | #include "ctpcm.h" |
---|
.. | .. |
---|
182 | 178 | { |
---|
183 | 179 | struct ct_atc *atc = snd_pcm_substream_chip(substream); |
---|
184 | 180 | struct ct_atc_pcm *apcm = substream->runtime->private_data; |
---|
185 | | - int err; |
---|
186 | 181 | |
---|
187 | | - err = snd_pcm_lib_malloc_pages(substream, |
---|
188 | | - params_buffer_bytes(hw_params)); |
---|
189 | | - if (err < 0) |
---|
190 | | - return err; |
---|
191 | 182 | /* clear previous resources */ |
---|
192 | 183 | atc->pcm_release_resources(atc, apcm); |
---|
193 | | - return err; |
---|
| 184 | + return 0; |
---|
194 | 185 | } |
---|
195 | 186 | |
---|
196 | 187 | static int ct_pcm_hw_free(struct snd_pcm_substream *substream) |
---|
.. | .. |
---|
200 | 191 | |
---|
201 | 192 | /* clear previous resources */ |
---|
202 | 193 | atc->pcm_release_resources(atc, apcm); |
---|
203 | | - /* Free snd-allocated pages */ |
---|
204 | | - return snd_pcm_lib_free_pages(substream); |
---|
| 194 | + return 0; |
---|
205 | 195 | } |
---|
206 | 196 | |
---|
207 | 197 | |
---|
.. | .. |
---|
377 | 367 | static const struct snd_pcm_ops ct_pcm_playback_ops = { |
---|
378 | 368 | .open = ct_pcm_playback_open, |
---|
379 | 369 | .close = ct_pcm_playback_close, |
---|
380 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
381 | 370 | .hw_params = ct_pcm_hw_params, |
---|
382 | 371 | .hw_free = ct_pcm_hw_free, |
---|
383 | 372 | .prepare = ct_pcm_playback_prepare, |
---|
384 | 373 | .trigger = ct_pcm_playback_trigger, |
---|
385 | 374 | .pointer = ct_pcm_playback_pointer, |
---|
386 | | - .page = snd_pcm_sgbuf_ops_page, |
---|
387 | 375 | }; |
---|
388 | 376 | |
---|
389 | 377 | /* PCM operators for capture */ |
---|
390 | 378 | static const struct snd_pcm_ops ct_pcm_capture_ops = { |
---|
391 | 379 | .open = ct_pcm_capture_open, |
---|
392 | 380 | .close = ct_pcm_capture_close, |
---|
393 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
394 | 381 | .hw_params = ct_pcm_hw_params, |
---|
395 | 382 | .hw_free = ct_pcm_hw_free, |
---|
396 | 383 | .prepare = ct_pcm_capture_prepare, |
---|
397 | 384 | .trigger = ct_pcm_capture_trigger, |
---|
398 | 385 | .pointer = ct_pcm_capture_pointer, |
---|
399 | | - .page = snd_pcm_sgbuf_ops_page, |
---|
400 | 386 | }; |
---|
401 | 387 | |
---|
402 | 388 | static const struct snd_pcm_chmap_elem surround_map[] = { |
---|
.. | .. |
---|
455 | 441 | snd_pcm_set_ops(pcm, |
---|
456 | 442 | SNDRV_PCM_STREAM_CAPTURE, &ct_pcm_capture_ops); |
---|
457 | 443 | |
---|
458 | | - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
---|
459 | | - snd_dma_pci_data(atc->pci), 128*1024, 128*1024); |
---|
| 444 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
---|
| 445 | + &atc->pci->dev, 128*1024, 128*1024); |
---|
460 | 446 | |
---|
461 | 447 | chs = 2; |
---|
462 | 448 | switch (device) { |
---|