.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz> |
---|
3 | 4 | * Uros Bizjak <uros@kss-loka.si> |
---|
4 | 5 | * |
---|
5 | 6 | * Routines for control of 8-bit SoundBlaster cards and clones |
---|
6 | 7 | * Please note: I don't have access to old SB8 soundcards. |
---|
7 | | - * |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License as published by |
---|
11 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
12 | | - * (at your option) any later version. |
---|
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 |
---|
22 | 8 | * |
---|
23 | 9 | * -- |
---|
24 | 10 | * |
---|
.. | .. |
---|
130 | 116 | chip->playback_format = SB_DSP_HI_OUTPUT_AUTO; |
---|
131 | 117 | break; |
---|
132 | 118 | } |
---|
133 | | - /* fallthru */ |
---|
| 119 | + fallthrough; |
---|
134 | 120 | case SB_HW_201: |
---|
135 | 121 | if (rate > 23000) { |
---|
136 | 122 | chip->playback_format = SB_DSP_HI_OUTPUT_AUTO; |
---|
137 | 123 | break; |
---|
138 | 124 | } |
---|
139 | | - /* fallthru */ |
---|
| 125 | + fallthrough; |
---|
140 | 126 | case SB_HW_20: |
---|
141 | 127 | chip->playback_format = SB_DSP_LO_OUTPUT_AUTO; |
---|
142 | 128 | break; |
---|
.. | .. |
---|
239 | 225 | return 0; |
---|
240 | 226 | } |
---|
241 | 227 | |
---|
242 | | -static int snd_sb8_hw_params(struct snd_pcm_substream *substream, |
---|
243 | | - struct snd_pcm_hw_params *hw_params) |
---|
244 | | -{ |
---|
245 | | - return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
---|
246 | | -} |
---|
247 | | - |
---|
248 | | -static int snd_sb8_hw_free(struct snd_pcm_substream *substream) |
---|
249 | | -{ |
---|
250 | | - snd_pcm_lib_free_pages(substream); |
---|
251 | | - return 0; |
---|
252 | | -} |
---|
253 | | - |
---|
254 | 228 | static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream) |
---|
255 | 229 | { |
---|
256 | 230 | unsigned long flags; |
---|
.. | .. |
---|
287 | 261 | chip->capture_format = SB_DSP_HI_INPUT_AUTO; |
---|
288 | 262 | break; |
---|
289 | 263 | } |
---|
290 | | - /* fallthru */ |
---|
| 264 | + fallthrough; |
---|
291 | 265 | case SB_HW_20: |
---|
292 | 266 | chip->capture_format = SB_DSP_LO_INPUT_AUTO; |
---|
293 | 267 | break; |
---|
.. | .. |
---|
387 | 361 | case SB_MODE_PLAYBACK_16: /* ok.. playback is active */ |
---|
388 | 362 | if (chip->hardware != SB_HW_JAZZ16) |
---|
389 | 363 | break; |
---|
390 | | - /* fallthru */ |
---|
| 364 | + fallthrough; |
---|
391 | 365 | case SB_MODE_PLAYBACK_8: |
---|
392 | 366 | substream = chip->playback_substream; |
---|
393 | 367 | if (chip->playback_format == SB_DSP_OUTPUT) |
---|
.. | .. |
---|
397 | 371 | case SB_MODE_CAPTURE_16: |
---|
398 | 372 | if (chip->hardware != SB_HW_JAZZ16) |
---|
399 | 373 | break; |
---|
400 | | - /* fallthru */ |
---|
| 374 | + fallthrough; |
---|
401 | 375 | case SB_MODE_CAPTURE_8: |
---|
402 | 376 | substream = chip->capture_substream; |
---|
403 | 377 | if (chip->capture_format == SB_DSP_INPUT) |
---|
.. | .. |
---|
572 | 546 | static const struct snd_pcm_ops snd_sb8_playback_ops = { |
---|
573 | 547 | .open = snd_sb8_open, |
---|
574 | 548 | .close = snd_sb8_close, |
---|
575 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
576 | | - .hw_params = snd_sb8_hw_params, |
---|
577 | | - .hw_free = snd_sb8_hw_free, |
---|
578 | 549 | .prepare = snd_sb8_playback_prepare, |
---|
579 | 550 | .trigger = snd_sb8_playback_trigger, |
---|
580 | 551 | .pointer = snd_sb8_playback_pointer, |
---|
.. | .. |
---|
583 | 554 | static const struct snd_pcm_ops snd_sb8_capture_ops = { |
---|
584 | 555 | .open = snd_sb8_open, |
---|
585 | 556 | .close = snd_sb8_close, |
---|
586 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
587 | | - .hw_params = snd_sb8_hw_params, |
---|
588 | | - .hw_free = snd_sb8_hw_free, |
---|
589 | 557 | .prepare = snd_sb8_capture_prepare, |
---|
590 | 558 | .trigger = snd_sb8_capture_trigger, |
---|
591 | 559 | .pointer = snd_sb8_capture_pointer, |
---|
.. | .. |
---|
609 | 577 | |
---|
610 | 578 | if (chip->dma8 > 3 || chip->dma16 >= 0) |
---|
611 | 579 | max_prealloc = 128 * 1024; |
---|
612 | | - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
---|
613 | | - snd_dma_isa_data(), |
---|
614 | | - 64*1024, max_prealloc); |
---|
| 580 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, |
---|
| 581 | + card->dev, 64*1024, max_prealloc); |
---|
615 | 582 | |
---|
616 | 583 | return 0; |
---|
617 | 584 | } |
---|