forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/samsung/smdk_spdif.c
....@@ -1,14 +1,8 @@
1
-/*
2
- * smdk_spdif.c -- S/PDIF audio for SMDK
3
- *
4
- * Copyright 2010 Samsung Electronics Co. Ltd.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License as
8
- * published by the Free Software Foundation; either version 2 of the
9
- * License, or (at your option) any later version.
10
- *
11
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// smdk_spdif.c - S/PDIF audio for SMDK
4
+//
5
+// Copyright (C) 2010 Samsung Electronics Co., Ltd.
126
137 #include <linux/clk.h>
148 #include <linux/module.h>
....@@ -106,8 +100,8 @@
106100 static int smdk_hw_params(struct snd_pcm_substream *substream,
107101 struct snd_pcm_hw_params *params)
108102 {
109
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
110
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
103
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
104
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
111105 unsigned long pll_out, rclk_rate;
112106 int ret, ratio;
113107
....@@ -148,14 +142,16 @@
148142 .hw_params = smdk_hw_params,
149143 };
150144
145
+SND_SOC_DAILINK_DEFS(spdif,
146
+ DAILINK_COMP_ARRAY(COMP_CPU("samsung-spdif")),
147
+ DAILINK_COMP_ARRAY(COMP_CODEC("spdif-dit", "dit-hifi")),
148
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-spdif")));
149
+
151150 static struct snd_soc_dai_link smdk_dai = {
152151 .name = "S/PDIF",
153152 .stream_name = "S/PDIF PCM Playback",
154
- .platform_name = "samsung-spdif",
155
- .cpu_dai_name = "samsung-spdif",
156
- .codec_dai_name = "dit-hifi",
157
- .codec_name = "spdif-dit",
158153 .ops = &smdk_spdif_ops,
154
+ SND_SOC_DAILINK_REG(spdif),
159155 };
160156
161157 static struct snd_soc_card smdk = {