hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/sound/soc/samsung/dmaengine.c
....@@ -1,19 +1,9 @@
1
-/*
2
- * dmaengine.c - Samsung dmaengine wrapper
3
- *
4
- * Author: Mark Brown <broonie@linaro.org>
5
- * Copyright 2013 Linaro
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * version 2 as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful, but
12
- * WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- * General Public License for more details.
15
- *
16
- */
1
+// SPDX-License-Identifier: GPL-2.0
2
+//
3
+// dmaengine.c - Samsung dmaengine wrapper
4
+//
5
+// Author: Mark Brown <broonie@linaro.org>
6
+// Copyright 2013 Linaro
177
188 #include <linux/module.h>
199 #include <sound/core.h>
....@@ -25,9 +15,9 @@
2515 #include "dma.h"
2616
2717 int samsung_asoc_dma_platform_register(struct device *dev, dma_filter_fn filter,
28
- const char *tx, const char *rx)
18
+ const char *tx, const char *rx,
19
+ struct device *dma_dev)
2920 {
30
- unsigned int flags = SND_DMAENGINE_PCM_FLAG_COMPAT;
3121 struct snd_dmaengine_pcm_config *pcm_conf;
3222
3323 pcm_conf = devm_kzalloc(dev, sizeof(*pcm_conf), GFP_KERNEL);
....@@ -36,15 +26,13 @@
3626
3727 pcm_conf->prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config;
3828 pcm_conf->compat_filter_fn = filter;
29
+ pcm_conf->dma_dev = dma_dev;
3930
40
- if (dev->of_node) {
41
- pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx;
42
- pcm_conf->chan_names[SNDRV_PCM_STREAM_CAPTURE] = rx;
43
- } else {
44
- flags |= SND_DMAENGINE_PCM_FLAG_CUSTOM_CHANNEL_NAME;
45
- }
31
+ pcm_conf->chan_names[SNDRV_PCM_STREAM_PLAYBACK] = tx;
32
+ pcm_conf->chan_names[SNDRV_PCM_STREAM_CAPTURE] = rx;
4633
47
- return devm_snd_dmaengine_pcm_register(dev, pcm_conf, flags);
34
+ return devm_snd_dmaengine_pcm_register(dev, pcm_conf,
35
+ SND_DMAENGINE_PCM_FLAG_COMPAT);
4836 }
4937 EXPORT_SYMBOL_GPL(samsung_asoc_dma_platform_register);
5038