forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/isa/sb/sb16_main.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
34 * Routines for control of 16-bit SoundBlaster cards and clones
....@@ -15,22 +16,6 @@
1516 * 16bit DMA transfers from DSP chip (capture) until 8bit transfer
1617 * to DSP chip (playback) starts. This bug can be avoided with
1718 * "16bit DMA Allocation" setting set to Playback or Capture.
18
- *
19
- *
20
- * This program is free software; you can redistribute it and/or modify
21
- * it under the terms of the GNU General Public License as published by
22
- * the Free Software Foundation; either version 2 of the License, or
23
- * (at your option) any later version.
24
- *
25
- * This program is distributed in the hope that it will be useful,
26
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
- * GNU General Public License for more details.
29
- *
30
- * You should have received a copy of the GNU General Public License
31
- * along with this program; if not, write to the Free Software
32
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33
- *
3419 */
3520
3621 #include <linux/io.h>
....@@ -245,18 +230,6 @@
245230 snd_sbdsp_command(chip, rate & 0xff);
246231 }
247232 spin_unlock_irqrestore(&chip->reg_lock, flags);
248
-}
249
-
250
-static int snd_sb16_hw_params(struct snd_pcm_substream *substream,
251
- struct snd_pcm_hw_params *hw_params)
252
-{
253
- return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
254
-}
255
-
256
-static int snd_sb16_hw_free(struct snd_pcm_substream *substream)
257
-{
258
- snd_pcm_lib_free_pages(substream);
259
- return 0;
260233 }
261234
262235 static int snd_sb16_playback_prepare(struct snd_pcm_substream *substream)
....@@ -844,9 +817,6 @@
844817 static const struct snd_pcm_ops snd_sb16_playback_ops = {
845818 .open = snd_sb16_playback_open,
846819 .close = snd_sb16_playback_close,
847
- .ioctl = snd_pcm_lib_ioctl,
848
- .hw_params = snd_sb16_hw_params,
849
- .hw_free = snd_sb16_hw_free,
850820 .prepare = snd_sb16_playback_prepare,
851821 .trigger = snd_sb16_playback_trigger,
852822 .pointer = snd_sb16_playback_pointer,
....@@ -855,9 +825,6 @@
855825 static const struct snd_pcm_ops snd_sb16_capture_ops = {
856826 .open = snd_sb16_capture_open,
857827 .close = snd_sb16_capture_close,
858
- .ioctl = snd_pcm_lib_ioctl,
859
- .hw_params = snd_sb16_hw_params,
860
- .hw_free = snd_sb16_hw_free,
861828 .prepare = snd_sb16_capture_prepare,
862829 .trigger = snd_sb16_capture_trigger,
863830 .pointer = snd_sb16_capture_pointer,
....@@ -884,9 +851,8 @@
884851 else
885852 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
886853
887
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
888
- snd_dma_isa_data(),
889
- 64*1024, 128*1024);
854
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
855
+ card->dev, 64*1024, 128*1024);
890856 return 0;
891857 }
892858