hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/sound/soc/pxa/hx4700.c
....@@ -1,13 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * SoC audio for HP iPAQ hx4700
34 *
45 * Copyright (c) 2009 Philipp Zabel
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published by the
8
- * Free Software Foundation; either version 2 of the License, or (at your
9
- * option) any later version.
10
- *
116 */
127
138 #include <linux/module.h>
....@@ -58,9 +53,9 @@
5853 static int hx4700_hw_params(struct snd_pcm_substream *substream,
5954 struct snd_pcm_hw_params *params)
6055 {
61
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
62
- struct snd_soc_dai *codec_dai = rtd->codec_dai;
63
- struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
56
+ struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
57
+ struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
58
+ struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
6459 int ret = 0;
6560
6661 /* set the I2S system clock as output */
....@@ -139,17 +134,19 @@
139134 }
140135
141136 /* hx4700 digital audio interface glue - connects codec <--> CPU */
137
+SND_SOC_DAILINK_DEFS(ak4641,
138
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa2xx-i2s")),
139
+ DAILINK_COMP_ARRAY(COMP_CODEC("ak4641.0-0012", "ak4641-hifi")),
140
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("pxa-pcm-audio")));
141
+
142142 static struct snd_soc_dai_link hx4700_dai = {
143143 .name = "ak4641",
144144 .stream_name = "AK4641",
145
- .cpu_dai_name = "pxa2xx-i2s",
146
- .codec_dai_name = "ak4641-hifi",
147
- .platform_name = "pxa-pcm-audio",
148
- .codec_name = "ak4641.0-0012",
149145 .init = hx4700_ak4641_init,
150146 .dai_fmt = SND_SOC_DAIFMT_MSB | SND_SOC_DAIFMT_NB_NF |
151147 SND_SOC_DAIFMT_CBS_CFS,
152148 .ops = &hx4700_ops,
149
+ SND_SOC_DAILINK_REG(ak4641),
153150 };
154151
155152 /* hx4700 audio machine driver */