.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Driver for AMD7930 sound chips found on Sparcs. |
---|
3 | 4 | * Copyright (C) 2002, 2008 David S. Miller <davem@davemloft.net> |
---|
.. | .. |
---|
722 | 723 | return 0; |
---|
723 | 724 | } |
---|
724 | 725 | |
---|
725 | | -static int snd_amd7930_hw_params(struct snd_pcm_substream *substream, |
---|
726 | | - struct snd_pcm_hw_params *hw_params) |
---|
727 | | -{ |
---|
728 | | - return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); |
---|
729 | | -} |
---|
730 | | - |
---|
731 | | -static int snd_amd7930_hw_free(struct snd_pcm_substream *substream) |
---|
732 | | -{ |
---|
733 | | - return snd_pcm_lib_free_pages(substream); |
---|
734 | | -} |
---|
735 | | - |
---|
736 | 726 | static const struct snd_pcm_ops snd_amd7930_playback_ops = { |
---|
737 | 727 | .open = snd_amd7930_playback_open, |
---|
738 | 728 | .close = snd_amd7930_playback_close, |
---|
739 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
740 | | - .hw_params = snd_amd7930_hw_params, |
---|
741 | | - .hw_free = snd_amd7930_hw_free, |
---|
742 | 729 | .prepare = snd_amd7930_playback_prepare, |
---|
743 | 730 | .trigger = snd_amd7930_playback_trigger, |
---|
744 | 731 | .pointer = snd_amd7930_playback_pointer, |
---|
.. | .. |
---|
747 | 734 | static const struct snd_pcm_ops snd_amd7930_capture_ops = { |
---|
748 | 735 | .open = snd_amd7930_capture_open, |
---|
749 | 736 | .close = snd_amd7930_capture_close, |
---|
750 | | - .ioctl = snd_pcm_lib_ioctl, |
---|
751 | | - .hw_params = snd_amd7930_hw_params, |
---|
752 | | - .hw_free = snd_amd7930_hw_free, |
---|
753 | 737 | .prepare = snd_amd7930_capture_prepare, |
---|
754 | 738 | .trigger = snd_amd7930_capture_trigger, |
---|
755 | 739 | .pointer = snd_amd7930_capture_pointer, |
---|
.. | .. |
---|
775 | 759 | strcpy(pcm->name, amd->card->shortname); |
---|
776 | 760 | amd->pcm = pcm; |
---|
777 | 761 | |
---|
778 | | - snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, |
---|
779 | | - snd_dma_continuous_data(GFP_KERNEL), |
---|
780 | | - 64*1024, 64*1024); |
---|
| 762 | + snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS, |
---|
| 763 | + NULL, 64*1024, 64*1024); |
---|
781 | 764 | |
---|
782 | 765 | return 0; |
---|
783 | 766 | } |
---|
.. | .. |
---|
854 | 837 | return change; |
---|
855 | 838 | } |
---|
856 | 839 | |
---|
857 | | -static struct snd_kcontrol_new amd7930_controls[] = { |
---|
| 840 | +static const struct snd_kcontrol_new amd7930_controls[] = { |
---|
858 | 841 | { |
---|
859 | 842 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
---|
860 | 843 | .name = "Monitor Volume", |
---|
.. | .. |
---|
929 | 912 | return snd_amd7930_free(amd); |
---|
930 | 913 | } |
---|
931 | 914 | |
---|
932 | | -static struct snd_device_ops snd_amd7930_dev_ops = { |
---|
| 915 | +static const struct snd_device_ops snd_amd7930_dev_ops = { |
---|
933 | 916 | .dev_free = snd_amd7930_dev_free, |
---|
934 | 917 | }; |
---|
935 | 918 | |
---|