hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/sound/soc/samsung/smdk_wm8994pcm.c
....@@ -1,14 +1,8 @@
1
-/*
2
- * sound/soc/samsung/smdk_wm8994pcm.c
3
- *
4
- * Copyright (c) 2011 Samsung Electronics Co., Ltd
5
- * http://www.samsung.com
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of the GNU General Public License as published by the
9
- * Free Software Foundation; either version 2 of the License, or (at your
10
- * option) any later version.
11
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// Copyright (c) 2011 Samsung Electronics Co., Ltd
4
+// http://www.samsung.com
5
+
126 #include <linux/module.h>
137 #include <sound/soc.h>
148 #include <sound/pcm.h>
....@@ -49,9 +43,9 @@
4943 static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream,
5044 struct snd_pcm_hw_params *params)
5145 {
52
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
53
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
54
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
46
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
47
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
48
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
5549 unsigned long mclk_freq;
5650 int rfs, ret;
5751
....@@ -95,17 +89,19 @@
9589 .hw_params = smdk_wm8994_pcm_hw_params,
9690 };
9791
92
+SND_SOC_DAILINK_DEFS(paif_pcm,
93
+ DAILINK_COMP_ARRAY(COMP_CPU("samsung-pcm.0")),
94
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8994-codec", "wm8994-aif1")),
95
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-pcm.0")));
96
+
9897 static struct snd_soc_dai_link smdk_dai[] = {
9998 {
10099 .name = "WM8994 PAIF PCM",
101100 .stream_name = "Primary PCM",
102
- .cpu_dai_name = "samsung-pcm.0",
103
- .codec_dai_name = "wm8994-aif1",
104
- .platform_name = "samsung-pcm.0",
105
- .codec_name = "wm8994-codec",
106101 .dai_fmt = SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF |
107102 SND_SOC_DAIFMT_CBS_CFS,
108103 .ops = &smdk_wm8994_pcm_ops,
104
+ SND_SOC_DAILINK_REG(paif_pcm),
109105 },
110106 };
111107
....@@ -123,7 +119,7 @@
123119 smdk_pcm.dev = &pdev->dev;
124120 ret = devm_snd_soc_register_card(&pdev->dev, &smdk_pcm);
125121 if (ret)
126
- dev_err(&pdev->dev, "snd_soc_register_card failed %d\n", ret);
122
+ dev_err_probe(&pdev->dev, ret, "snd_soc_register_card failed\n");
127123
128124 return ret;
129125 }