hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/sound/pci/als4000.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * card-als4000.c - driver for Avance Logic ALS4000 based soundcards.
34 * Copyright (C) 2000 by Bart Hartgers <bart@etpmod.phys.tue.nl>,
....@@ -5,21 +6,6 @@
56 * Copyright (C) 2002, 2008 by Andreas Mohr <hw7oshyuv3001@sneakemail.com>
67 *
78 * Framework borrowed from Massimo Piccioni's card-als100.c.
8
- *
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.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
-
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
239 *
2410 * NOTES
2511 *
....@@ -368,18 +354,6 @@
368354 };
369355 #define capture_cmd(chip) (capture_cmd_vals[(chip)->capture_format])
370356
371
-static int snd_als4000_hw_params(struct snd_pcm_substream *substream,
372
- struct snd_pcm_hw_params *hw_params)
373
-{
374
- return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
375
-}
376
-
377
-static int snd_als4000_hw_free(struct snd_pcm_substream *substream)
378
-{
379
- snd_pcm_lib_free_pages(substream);
380
- return 0;
381
-}
382
-
383357 static int snd_als4000_capture_prepare(struct snd_pcm_substream *substream)
384358 {
385359 struct snd_sb *chip = snd_pcm_substream_chip(substream);
....@@ -647,7 +621,6 @@
647621 struct snd_sb *chip = snd_pcm_substream_chip(substream);
648622
649623 chip->playback_substream = NULL;
650
- snd_pcm_lib_free_pages(substream);
651624 return 0;
652625 }
653626
....@@ -666,7 +639,6 @@
666639 struct snd_sb *chip = snd_pcm_substream_chip(substream);
667640
668641 chip->capture_substream = NULL;
669
- snd_pcm_lib_free_pages(substream);
670642 return 0;
671643 }
672644
....@@ -675,9 +647,6 @@
675647 static const struct snd_pcm_ops snd_als4000_playback_ops = {
676648 .open = snd_als4000_playback_open,
677649 .close = snd_als4000_playback_close,
678
- .ioctl = snd_pcm_lib_ioctl,
679
- .hw_params = snd_als4000_hw_params,
680
- .hw_free = snd_als4000_hw_free,
681650 .prepare = snd_als4000_playback_prepare,
682651 .trigger = snd_als4000_playback_trigger,
683652 .pointer = snd_als4000_playback_pointer
....@@ -686,9 +655,6 @@
686655 static const struct snd_pcm_ops snd_als4000_capture_ops = {
687656 .open = snd_als4000_capture_open,
688657 .close = snd_als4000_capture_close,
689
- .ioctl = snd_pcm_lib_ioctl,
690
- .hw_params = snd_als4000_hw_params,
691
- .hw_free = snd_als4000_hw_free,
692658 .prepare = snd_als4000_capture_prepare,
693659 .trigger = snd_als4000_capture_trigger,
694660 .pointer = snd_als4000_capture_pointer
....@@ -707,8 +673,8 @@
707673 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_als4000_playback_ops);
708674 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_als4000_capture_ops);
709675
710
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
711
- 64*1024, 64*1024);
676
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
677
+ &chip->pci->dev, 64*1024, 64*1024);
712678
713679 chip->pcm = pcm;
714680
....@@ -994,7 +960,6 @@
994960
995961 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
996962
997
- snd_pcm_suspend_all(chip->pcm);
998963 snd_sbmixer_suspend(chip);
999964 return 0;
1000965 }