.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * als300.c - driver for Avance Logic ALS300/ALS300+ soundcards. |
---|
3 | 4 | * Copyright (C) 2005 by Ash Willis <ashwillis@programmer.net> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
8 | | - * (at your option) any later version. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | | - * |
---|
15 | | - * You should have received a copy of the GNU General Public License |
---|
16 | | - * along with this program; if not, write to the Free Software |
---|
17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
18 | 5 | * |
---|
19 | 6 | * TODO |
---|
20 | 7 | * 4 channel playback for ALS300+ |
---|
.. | .. |
---|
307 | 294 | struct snd_ac97_bus *bus; |
---|
308 | 295 | struct snd_ac97_template ac97; |
---|
309 | 296 | int err; |
---|
310 | | - static struct snd_ac97_bus_ops ops = { |
---|
| 297 | + static const struct snd_ac97_bus_ops ops = { |
---|
311 | 298 | .write = snd_als300_ac97_write, |
---|
312 | 299 | .read = snd_als300_ac97_read, |
---|
313 | 300 | }; |
---|
.. | .. |
---|
391 | 378 | data = substream->runtime->private_data; |
---|
392 | 379 | kfree(data); |
---|
393 | 380 | chip->playback_substream = NULL; |
---|
394 | | - snd_pcm_lib_free_pages(substream); |
---|
395 | 381 | return 0; |
---|
396 | 382 | } |
---|
397 | 383 | |
---|
.. | .. |
---|
420 | 406 | data = substream->runtime->private_data; |
---|
421 | 407 | kfree(data); |
---|
422 | 408 | chip->capture_substream = NULL; |
---|
423 | | - snd_pcm_lib_free_pages(substream); |
---|
424 | 409 | return 0; |
---|
425 | | -} |
---|
426 | | - |
---|
427 | | -static int snd_als300_pcm_hw_params(struct snd_pcm_substream *substream, |
---|
428 | | - struct snd_pcm_hw_params *hw_params) |
---|
429 | | -{ |
---|
430 | | - return snd_pcm_lib_malloc_pages(substream, |
---|
431 | | - params_buffer_bytes(hw_params)); |
---|
432 | | -} |
---|
433 | | - |
---|
434 | | -static int snd_als300_pcm_hw_free(struct snd_pcm_substream *substream) |
---|
435 | | -{ |
---|
436 | | - return snd_pcm_lib_free_pages(substream); |
---|
437 | 410 | } |
---|
438 | 411 | |
---|
439 | 412 | static int snd_als300_playback_prepare(struct snd_pcm_substream *substream) |
---|
.. | .. |
---|
566 | 539 | static const struct snd_pcm_ops snd_als300_playback_ops = { |
---|
567 | 540 | .open = snd_als300_playback_open, |
---|
568 | 541 | .close = snd_als300_playback_close, |
---|
569 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
570 | | - .hw_params = snd_als300_pcm_hw_params, |
---|
571 | | - .hw_free = snd_als300_pcm_hw_free, |
---|
572 | 542 | .prepare = snd_als300_playback_prepare, |
---|
573 | 543 | .trigger = snd_als300_trigger, |
---|
574 | 544 | .pointer = snd_als300_pointer, |
---|
.. | .. |
---|
577 | 547 | static const struct snd_pcm_ops snd_als300_capture_ops = { |
---|
578 | 548 | .open = snd_als300_capture_open, |
---|
579 | 549 | .close = snd_als300_capture_close, |
---|
580 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
581 | | - .hw_params = snd_als300_pcm_hw_params, |
---|
582 | | - .hw_free = snd_als300_pcm_hw_free, |
---|
583 | 550 | .prepare = snd_als300_capture_prepare, |
---|
584 | 551 | .trigger = snd_als300_trigger, |
---|
585 | 552 | .pointer = snd_als300_pointer, |
---|
.. | .. |
---|
604 | 571 | &snd_als300_capture_ops); |
---|
605 | 572 | |
---|
606 | 573 | /* pre-allocation of buffers */ |
---|
607 | | - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, |
---|
608 | | - snd_dma_pci_data(chip->pci), 64*1024, 64*1024); |
---|
| 574 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_DEV, &chip->pci->dev, |
---|
| 575 | + 64*1024, 64*1024); |
---|
609 | 576 | return 0; |
---|
610 | 577 | } |
---|
611 | 578 | |
---|
.. | .. |
---|
650 | 617 | void *irq_handler; |
---|
651 | 618 | int err; |
---|
652 | 619 | |
---|
653 | | - static struct snd_device_ops ops = { |
---|
| 620 | + static const struct snd_device_ops ops = { |
---|
654 | 621 | .dev_free = snd_als300_dev_free, |
---|
655 | 622 | }; |
---|
656 | 623 | *rchip = NULL; |
---|
.. | .. |
---|
697 | 664 | return -EBUSY; |
---|
698 | 665 | } |
---|
699 | 666 | chip->irq = pci->irq; |
---|
700 | | - |
---|
| 667 | + card->sync_irq = chip->irq; |
---|
701 | 668 | |
---|
702 | 669 | snd_als300_init(chip); |
---|
703 | 670 | |
---|
.. | .. |
---|
731 | 698 | struct snd_als300 *chip = card->private_data; |
---|
732 | 699 | |
---|
733 | 700 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); |
---|
734 | | - snd_pcm_suspend_all(chip->pcm); |
---|
735 | 701 | snd_ac97_suspend(chip->ac97); |
---|
736 | 702 | return 0; |
---|
737 | 703 | } |
---|