hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/sound/sh/sh_dac_audio.c
....@@ -1,25 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * sh_dac_audio.c - SuperH DAC audio driver for ALSA
34 *
45 * Copyright (c) 2009 by Rafael Ignacio Zurita <rizurita@yahoo.com>
56 *
6
- *
77 * Based on sh_dac_audio.c (Copyright (C) 2004, 2005 by Andriy Skulysh)
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
- *
238 */
249
2510 #include <linux/hrtimer.h>
....@@ -140,18 +125,6 @@
140125 return 0;
141126 }
142127
143
-static int snd_sh_dac_pcm_hw_params(struct snd_pcm_substream *substream,
144
- struct snd_pcm_hw_params *hw_params)
145
-{
146
- return snd_pcm_lib_malloc_pages(substream,
147
- params_buffer_bytes(hw_params));
148
-}
149
-
150
-static int snd_sh_dac_pcm_hw_free(struct snd_pcm_substream *substream)
151
-{
152
- return snd_pcm_lib_free_pages(substream);
153
-}
154
-
155128 static int snd_sh_dac_pcm_prepare(struct snd_pcm_substream *substream)
156129 {
157130 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream);
....@@ -252,9 +225,6 @@
252225 static const struct snd_pcm_ops snd_sh_dac_pcm_ops = {
253226 .open = snd_sh_dac_pcm_open,
254227 .close = snd_sh_dac_pcm_close,
255
- .ioctl = snd_pcm_lib_ioctl,
256
- .hw_params = snd_sh_dac_pcm_hw_params,
257
- .hw_free = snd_sh_dac_pcm_hw_free,
258228 .prepare = snd_sh_dac_pcm_prepare,
259229 .trigger = snd_sh_dac_pcm_trigger,
260230 .pointer = snd_sh_dac_pcm_pointer,
....@@ -279,10 +249,8 @@
279249 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_sh_dac_pcm_ops);
280250
281251 /* buffer size=48K */
282
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
283
- snd_dma_continuous_data(GFP_KERNEL),
284
- 48 * 1024,
285
- 48 * 1024);
252
+ snd_pcm_set_managed_buffer_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
253
+ NULL, 48 * 1024, 48 * 1024);
286254
287255 return 0;
288256 }
....@@ -354,7 +322,7 @@
354322 struct snd_sh_dac *chip;
355323 int err;
356324
357
- static struct snd_device_ops ops = {
325
+ static const struct snd_device_ops ops = {
358326 .dev_free = snd_sh_dac_dev_free,
359327 };
360328