forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/cirrus/snappercl15.c
....@@ -1,24 +1,19 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * snappercl15.c -- SoC audio for Bluewater Systems Snapper CL15 module
34 *
45 * Copyright (C) 2008 Bluewater Systems Ltd
56 * Author: Ryan Mallon
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
- *
127 */
138
149 #include <linux/platform_device.h>
1510 #include <linux/module.h>
11
+#include <linux/soc/cirrus/ep93xx.h>
1612 #include <sound/core.h>
1713 #include <sound/pcm.h>
1814 #include <sound/soc.h>
1915
2016 #include <asm/mach-types.h>
21
-#include <mach/hardware.h>
2217
2318 #include "../codecs/tlv320aic23.h"
2419
....@@ -27,9 +22,9 @@
2722 static int snappercl15_hw_params(struct snd_pcm_substream *substream,
2823 struct snd_pcm_hw_params *params)
2924 {
30
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
31
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
32
- struct snd_soc_dai *cpu_dai = rtd->cpu_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);
27
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
3328 int err;
3429
3530 err = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_CLOCK,
....@@ -65,16 +60,19 @@
6560 {"MICIN", NULL, "Mic Jack"},
6661 };
6762
63
+SND_SOC_DAILINK_DEFS(aic23,
64
+ DAILINK_COMP_ARRAY(COMP_CPU("ep93xx-i2s")),
65
+ DAILINK_COMP_ARRAY(COMP_CODEC("tlv320aic23-codec.0-001a",
66
+ "tlv320aic23-hifi")),
67
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("ep93xx-i2s")));
68
+
6869 static struct snd_soc_dai_link snappercl15_dai = {
6970 .name = "tlv320aic23",
7071 .stream_name = "AIC23",
71
- .cpu_dai_name = "ep93xx-i2s",
72
- .codec_dai_name = "tlv320aic23-hifi",
73
- .codec_name = "tlv320aic23-codec.0-001a",
74
- .platform_name = "ep93xx-i2s",
7572 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
7673 SND_SOC_DAIFMT_CBS_CFS,
7774 .ops = &snappercl15_ops,
75
+ SND_SOC_DAILINK_REG(aic23),
7876 };
7977
8078 static struct snd_soc_card snd_soc_snappercl15 = {