.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for Digigram VX soundcards |
---|
3 | 4 | * |
---|
4 | 5 | * PCM part |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (c) 2002,2003 by Takashi Iwai <tiwai@suse.de> |
---|
7 | | - * |
---|
8 | | - * This program is free software; you can redistribute it and/or modify |
---|
9 | | - * it under the terms of the GNU General Public License as published by |
---|
10 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
11 | | - * (at your option) any later version. |
---|
12 | | - * |
---|
13 | | - * This program is distributed in the hope that it will be useful, |
---|
14 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | | - * GNU General Public License for more details. |
---|
17 | | - * |
---|
18 | | - * You should have received a copy of the GNU General Public License |
---|
19 | | - * along with this program; if not, write to the Free Software |
---|
20 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
21 | | - * |
---|
22 | 8 | * |
---|
23 | 9 | * STRATEGY |
---|
24 | 10 | * for playback, we send series of "chunks", which size is equal with the |
---|
.. | .. |
---|
38 | 24 | * |
---|
39 | 25 | * the current point of read buffer is kept in pipe->hw_ptr. note that |
---|
40 | 26 | * this is in bytes. |
---|
41 | | - * |
---|
42 | 27 | * |
---|
43 | 28 | * TODO |
---|
44 | 29 | * - linked trigger for full-duplex mode. |
---|
.. | .. |
---|
75 | 60 | *buf++ = vx_inb(chip, RXL); |
---|
76 | 61 | if (++offset >= pipe->buffer_bytes) { |
---|
77 | 62 | offset = 0; |
---|
78 | | - buf = (unsigned char *)runtime->dma_area; |
---|
79 | 63 | } |
---|
80 | 64 | pipe->hw_ptr = offset; |
---|
81 | 65 | } |
---|
.. | .. |
---|
545 | 529 | err = vx_alloc_pipe(chip, 0, audio, 2, &pipe); /* stereo playback */ |
---|
546 | 530 | if (err < 0) |
---|
547 | 531 | return err; |
---|
548 | | - chip->playback_pipes[audio] = pipe; |
---|
549 | 532 | } |
---|
550 | 533 | /* open for playback */ |
---|
551 | 534 | pipe->references++; |
---|
.. | .. |
---|
788 | 771 | } |
---|
789 | 772 | |
---|
790 | 773 | /* |
---|
791 | | - * vx_pcm_hw_params - hw_params callback for playback and capture |
---|
792 | | - */ |
---|
793 | | -static int vx_pcm_hw_params(struct snd_pcm_substream *subs, |
---|
794 | | - struct snd_pcm_hw_params *hw_params) |
---|
795 | | -{ |
---|
796 | | - return snd_pcm_lib_alloc_vmalloc_32_buffer |
---|
797 | | - (subs, params_buffer_bytes(hw_params)); |
---|
798 | | -} |
---|
799 | | - |
---|
800 | | -/* |
---|
801 | | - * vx_pcm_hw_free - hw_free callback for playback and capture |
---|
802 | | - */ |
---|
803 | | -static int vx_pcm_hw_free(struct snd_pcm_substream *subs) |
---|
804 | | -{ |
---|
805 | | - return snd_pcm_lib_free_vmalloc_buffer(subs); |
---|
806 | | -} |
---|
807 | | - |
---|
808 | | -/* |
---|
809 | 774 | * vx_pcm_prepare - prepare callback for playback and capture |
---|
810 | 775 | */ |
---|
811 | 776 | static int vx_pcm_prepare(struct snd_pcm_substream *subs) |
---|
.. | .. |
---|
876 | 841 | static const struct snd_pcm_ops vx_pcm_playback_ops = { |
---|
877 | 842 | .open = vx_pcm_playback_open, |
---|
878 | 843 | .close = vx_pcm_playback_close, |
---|
879 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
880 | | - .hw_params = vx_pcm_hw_params, |
---|
881 | | - .hw_free = vx_pcm_hw_free, |
---|
882 | 844 | .prepare = vx_pcm_prepare, |
---|
883 | 845 | .trigger = vx_pcm_trigger, |
---|
884 | 846 | .pointer = vx_pcm_playback_pointer, |
---|
885 | | - .page = snd_pcm_lib_get_vmalloc_page, |
---|
886 | 847 | }; |
---|
887 | 848 | |
---|
888 | 849 | |
---|
.. | .. |
---|
1097 | 1058 | static const struct snd_pcm_ops vx_pcm_capture_ops = { |
---|
1098 | 1059 | .open = vx_pcm_capture_open, |
---|
1099 | 1060 | .close = vx_pcm_capture_close, |
---|
1100 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
1101 | | - .hw_params = vx_pcm_hw_params, |
---|
1102 | | - .hw_free = vx_pcm_hw_free, |
---|
1103 | 1061 | .prepare = vx_pcm_prepare, |
---|
1104 | 1062 | .trigger = vx_pcm_trigger, |
---|
1105 | 1063 | .pointer = vx_pcm_capture_pointer, |
---|
1106 | | - .page = snd_pcm_lib_get_vmalloc_page, |
---|
1107 | 1064 | }; |
---|
1108 | 1065 | |
---|
1109 | 1066 | |
---|
.. | .. |
---|
1248 | 1205 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &vx_pcm_playback_ops); |
---|
1249 | 1206 | if (ins) |
---|
1250 | 1207 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &vx_pcm_capture_ops); |
---|
| 1208 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, |
---|
| 1209 | + snd_dma_continuous_data(GFP_KERNEL | GFP_DMA32), |
---|
| 1210 | + 0, 0); |
---|
1251 | 1211 | |
---|
1252 | 1212 | pcm->private_data = chip; |
---|
1253 | 1213 | pcm->private_free = snd_vx_pcm_free; |
---|