forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/usb/6fire/pcm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Linux driver for TerraTec DMX 6Fire USB
34 *
....@@ -6,11 +7,6 @@
67 * Author: Torsten Schenk <torsten.schenk@zoho.com>
78 * Created: Jan 01, 2011
89 * Copyright: (C) Torsten Schenk
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
1410 */
1511
1612 #include "pcm.h"
....@@ -450,18 +446,6 @@
450446 return 0;
451447 }
452448
453
-static int usb6fire_pcm_hw_params(struct snd_pcm_substream *alsa_sub,
454
- struct snd_pcm_hw_params *hw_params)
455
-{
456
- return snd_pcm_lib_alloc_vmalloc_buffer(alsa_sub,
457
- params_buffer_bytes(hw_params));
458
-}
459
-
460
-static int usb6fire_pcm_hw_free(struct snd_pcm_substream *alsa_sub)
461
-{
462
- return snd_pcm_lib_free_vmalloc_buffer(alsa_sub);
463
-}
464
-
465449 static int usb6fire_pcm_prepare(struct snd_pcm_substream *alsa_sub)
466450 {
467451 struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub);
....@@ -558,13 +542,9 @@
558542 static const struct snd_pcm_ops pcm_ops = {
559543 .open = usb6fire_pcm_open,
560544 .close = usb6fire_pcm_close,
561
- .ioctl = snd_pcm_lib_ioctl,
562
- .hw_params = usb6fire_pcm_hw_params,
563
- .hw_free = usb6fire_pcm_hw_free,
564545 .prepare = usb6fire_pcm_prepare,
565546 .trigger = usb6fire_pcm_trigger,
566547 .pointer = usb6fire_pcm_pointer,
567
- .page = snd_pcm_lib_get_vmalloc_page,
568548 };
569549
570550 static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
....@@ -663,14 +643,8 @@
663643 strcpy(pcm->name, "DMX 6Fire USB");
664644 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &pcm_ops);
665645 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pcm_ops);
646
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, NULL, 0, 0);
666647
667
- if (ret) {
668
- usb6fire_pcm_buffers_destroy(rt);
669
- kfree(rt);
670
- dev_err(&chip->dev->dev,
671
- "error preallocating pcm buffers.\n");
672
- return ret;
673
- }
674648 rt->instance = pcm;
675649
676650 chip->pcm = rt;