hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/sound/soc/samsung/smdk_wm8580.c
....@@ -1,14 +1,7 @@
1
-/*
2
- * smdk_wm8580.c
3
- *
4
- * Copyright (c) 2009 Samsung Electronics Co. Ltd
5
- * Author: Jaswinder Singh <jassisinghbrar@gmail.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) 2009 Samsung Electronics Co. Ltd
4
+// Author: Jaswinder Singh <jassisinghbrar@gmail.com>
125
136 #include <linux/module.h>
147 #include <sound/soc.h>
....@@ -29,8 +22,8 @@
2922 static int smdk_hw_params(struct snd_pcm_substream *substream,
3023 struct snd_pcm_hw_params *params)
3124 {
32
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
33
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
25
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
26
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
3427 unsigned int pll_out;
3528 int rfs, ret;
3629
....@@ -147,27 +140,31 @@
147140 #define SMDK_DAI_FMT (SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | \
148141 SND_SOC_DAIFMT_CBM_CFM)
149142
143
+SND_SOC_DAILINK_DEFS(paif_rx,
144
+ DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.2")),
145
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8580.0-001b", "wm8580-hifi-playback")),
146
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0")));
147
+
148
+SND_SOC_DAILINK_DEFS(paif_tx,
149
+ DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.2")),
150
+ DAILINK_COMP_ARRAY(COMP_CODEC("wm8580.0-001b", "wm8580-hifi-capture")),
151
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0")));
152
+
150153 static struct snd_soc_dai_link smdk_dai[] = {
151154 [PRI_PLAYBACK] = { /* Primary Playback i/f */
152155 .name = "WM8580 PAIF RX",
153156 .stream_name = "Playback",
154
- .cpu_dai_name = "samsung-i2s.2",
155
- .codec_dai_name = "wm8580-hifi-playback",
156
- .platform_name = "samsung-i2s.0",
157
- .codec_name = "wm8580.0-001b",
158157 .dai_fmt = SMDK_DAI_FMT,
159158 .ops = &smdk_ops,
159
+ SND_SOC_DAILINK_REG(paif_rx),
160160 },
161161 [PRI_CAPTURE] = { /* Primary Capture i/f */
162162 .name = "WM8580 PAIF TX",
163163 .stream_name = "Capture",
164
- .cpu_dai_name = "samsung-i2s.2",
165
- .codec_dai_name = "wm8580-hifi-capture",
166
- .platform_name = "samsung-i2s.0",
167
- .codec_name = "wm8580.0-001b",
168164 .dai_fmt = SMDK_DAI_FMT,
169165 .init = smdk_wm8580_init_paiftx,
170166 .ops = &smdk_ops,
167
+ SND_SOC_DAILINK_REG(paif_tx),
171168 },
172169 };
173170