.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for Sound Core PDAudioCF soundcards |
---|
3 | 4 | * |
---|
4 | 5 | * PCM part |
---|
5 | 6 | * |
---|
6 | 7 | * Copyright (c) 2003 by Jaroslav Kysela <perex@perex.cz> |
---|
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 | 8 | */ |
---|
22 | 9 | |
---|
23 | 10 | #include <linux/delay.h> |
---|
.. | .. |
---|
58 | 45 | case SNDRV_PCM_TRIGGER_START: |
---|
59 | 46 | chip->pcm_hwptr = 0; |
---|
60 | 47 | chip->pcm_tdone = 0; |
---|
61 | | - /* fall thru */ |
---|
| 48 | + fallthrough; |
---|
62 | 49 | case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: |
---|
63 | 50 | case SNDRV_PCM_TRIGGER_RESUME: |
---|
64 | 51 | mask = 0; |
---|
.. | .. |
---|
94 | 81 | mutex_unlock(&chip->reg_lock); |
---|
95 | 82 | snd_ak4117_check_rate_and_errors(chip->ak4117, AK4117_CHECK_NO_RATE); |
---|
96 | 83 | return ret; |
---|
97 | | -} |
---|
98 | | - |
---|
99 | | -/* |
---|
100 | | - * pdacf_pcm_hw_params - hw_params callback for playback and capture |
---|
101 | | - */ |
---|
102 | | -static int pdacf_pcm_hw_params(struct snd_pcm_substream *subs, |
---|
103 | | - struct snd_pcm_hw_params *hw_params) |
---|
104 | | -{ |
---|
105 | | - return snd_pcm_lib_alloc_vmalloc_32_buffer |
---|
106 | | - (subs, params_buffer_bytes(hw_params)); |
---|
107 | | -} |
---|
108 | | - |
---|
109 | | -/* |
---|
110 | | - * pdacf_pcm_hw_free - hw_free callback for playback and capture |
---|
111 | | - */ |
---|
112 | | -static int pdacf_pcm_hw_free(struct snd_pcm_substream *subs) |
---|
113 | | -{ |
---|
114 | | - return snd_pcm_lib_free_vmalloc_buffer(subs); |
---|
115 | 84 | } |
---|
116 | 85 | |
---|
117 | 86 | /* |
---|
.. | .. |
---|
163 | 132 | case SNDRV_PCM_FORMAT_S24_3LE: |
---|
164 | 133 | case SNDRV_PCM_FORMAT_S24_3BE: |
---|
165 | 134 | chip->pcm_sample = 3; |
---|
166 | | - /* fall through */ |
---|
| 135 | + fallthrough; |
---|
167 | 136 | default: /* 24-bit */ |
---|
168 | 137 | aval = AK4117_DIF_24R; |
---|
169 | 138 | chip->pcm_frame = 3; |
---|
.. | .. |
---|
269 | 238 | static const struct snd_pcm_ops pdacf_pcm_capture_ops = { |
---|
270 | 239 | .open = pdacf_pcm_capture_open, |
---|
271 | 240 | .close = pdacf_pcm_capture_close, |
---|
272 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
273 | | - .hw_params = pdacf_pcm_hw_params, |
---|
274 | | - .hw_free = pdacf_pcm_hw_free, |
---|
275 | 241 | .prepare = pdacf_pcm_prepare, |
---|
276 | 242 | .trigger = pdacf_pcm_trigger, |
---|
277 | 243 | .pointer = pdacf_pcm_capture_pointer, |
---|
278 | | - .page = snd_pcm_lib_get_vmalloc_page, |
---|
279 | 244 | }; |
---|
280 | 245 | |
---|
281 | 246 | |
---|
.. | .. |
---|
292 | 257 | return err; |
---|
293 | 258 | |
---|
294 | 259 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &pdacf_pcm_capture_ops); |
---|
| 260 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_VMALLOC, |
---|
| 261 | + snd_dma_continuous_data(GFP_KERNEL | GFP_DMA32), |
---|
| 262 | + 0, 0); |
---|
295 | 263 | |
---|
296 | 264 | pcm->private_data = chip; |
---|
297 | 265 | pcm->info_flags = 0; |
---|