hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/sound/pci/sis7019.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for SiS7019 Audio Accelerator
34 *
....@@ -6,19 +7,6 @@
67 * Inspired by the Trident 4D-WaveDX/NX driver.
78 *
89 * All rights reserved.
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, version 2.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
18
- *
19
- * You should have received a copy of the GNU General Public License
20
- * along with this program; if not, write to the Free Software
21
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2210 */
2311
2412 #include <linux/init.h>
....@@ -511,18 +499,6 @@
511499 return 0;
512500 }
513501
514
-static int sis_playback_hw_params(struct snd_pcm_substream *substream,
515
- struct snd_pcm_hw_params *hw_params)
516
-{
517
- return snd_pcm_lib_malloc_pages(substream,
518
- params_buffer_bytes(hw_params));
519
-}
520
-
521
-static int sis_hw_free(struct snd_pcm_substream *substream)
522
-{
523
- return snd_pcm_lib_free_pages(substream);
524
-}
525
-
526502 static int sis_pcm_playback_prepare(struct snd_pcm_substream *substream)
527503 {
528504 struct snd_pcm_runtime *runtime = substream->runtime;
....@@ -713,11 +689,6 @@
713689 if (rc)
714690 goto out;
715691
716
- rc = snd_pcm_lib_malloc_pages(substream,
717
- params_buffer_bytes(hw_params));
718
- if (rc < 0)
719
- goto out;
720
-
721692 rc = sis_alloc_timing_voice(substream, hw_params);
722693
723694 out:
....@@ -875,9 +846,6 @@
875846 static const struct snd_pcm_ops sis_playback_ops = {
876847 .open = sis_playback_open,
877848 .close = sis_substream_close,
878
- .ioctl = snd_pcm_lib_ioctl,
879
- .hw_params = sis_playback_hw_params,
880
- .hw_free = sis_hw_free,
881849 .prepare = sis_pcm_playback_prepare,
882850 .trigger = sis_pcm_trigger,
883851 .pointer = sis_pcm_pointer,
....@@ -886,9 +854,7 @@
886854 static const struct snd_pcm_ops sis_capture_ops = {
887855 .open = sis_capture_open,
888856 .close = sis_substream_close,
889
- .ioctl = snd_pcm_lib_ioctl,
890857 .hw_params = sis_capture_hw_params,
891
- .hw_free = sis_hw_free,
892858 .prepare = sis_pcm_capture_prepare,
893859 .trigger = sis_pcm_trigger,
894860 .pointer = sis_pcm_pointer,
....@@ -916,8 +882,8 @@
916882 /* Try to preallocate some memory, but it's not the end of the
917883 * world if this fails.
918884 */
919
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
920
- snd_dma_pci_data(sis->pci), 64*1024, 128*1024);
885
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV,
886
+ &sis->pci->dev, 64*1024, 128*1024);
921887
922888 return 0;
923889 }
....@@ -1017,7 +983,7 @@
1017983 {
1018984 struct snd_ac97_bus *bus;
1019985 struct snd_ac97_template ac97;
1020
- static struct snd_ac97_bus_ops ops = {
986
+ static const struct snd_ac97_bus_ops ops = {
1021987 .write = sis_ac97_write,
1022988 .read = sis_ac97_read,
1023989 };
....@@ -1214,7 +1180,6 @@
12141180 int i;
12151181
12161182 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
1217
- snd_pcm_suspend_all(sis->pcm);
12181183 if (sis->codecs_present & SIS_PRIMARY_CODEC_PRESENT)
12191184 snd_ac97_suspend(sis->ac97[0]);
12201185 if (sis->codecs_present & SIS_SECONDARY_CODEC_PRESENT)
....@@ -1315,7 +1280,7 @@
13151280 {
13161281 struct sis7019 *sis = card->private_data;
13171282 struct voice *voice;
1318
- static struct snd_device_ops ops = {
1283
+ static const struct snd_device_ops ops = {
13191284 .dev_free = sis_dev_free,
13201285 };
13211286 int rc;
....@@ -1346,7 +1311,7 @@
13461311 }
13471312
13481313 rc = -EIO;
1349
- sis->ioaddr = ioremap_nocache(pci_resource_start(pci, 1), 0x4000);
1314
+ sis->ioaddr = ioremap(pci_resource_start(pci, 1), 0x4000);
13501315 if (!sis->ioaddr) {
13511316 dev_err(&pci->dev, "unable to remap MMIO, aborting\n");
13521317 goto error_out_cleanup;
....@@ -1370,6 +1335,7 @@
13701335 }
13711336
13721337 sis->irq = pci->irq;
1338
+ card->sync_irq = sis->irq;
13731339 pci_set_master(pci);
13741340
13751341 for (i = 0; i < 64; i++) {