forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/sound/soc/pxa/ttc-dkb.c
....@@ -1,22 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * linux/sound/soc/pxa/ttc_dkb.c
34 *
45 * Copyright (C) 2012 Marvell International Ltd.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- *
206 */
217 #include <linux/module.h>
228 #include <linux/moduleparam.h>
....@@ -75,7 +61,7 @@
7561
7662 static int ttc_pm860x_init(struct snd_soc_pcm_runtime *rtd)
7763 {
78
- struct snd_soc_component *component = rtd->codec_dai->component;
64
+ struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
7965
8066 /* Headset jack detection */
8167 snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE |
....@@ -94,17 +80,19 @@
9480 }
9581
9682 /* ttc/td-dkb digital audio interface glue - connects codec <--> CPU */
83
+SND_SOC_DAILINK_DEFS(i2s,
84
+ DAILINK_COMP_ARRAY(COMP_CPU("pxa-ssp-dai.1")),
85
+ DAILINK_COMP_ARRAY(COMP_CODEC("88pm860x-codec", "88pm860x-i2s")),
86
+ DAILINK_COMP_ARRAY(COMP_PLATFORM("mmp-pcm-audio")));
87
+
9788 static struct snd_soc_dai_link ttc_pm860x_hifi_dai[] = {
9889 {
9990 .name = "88pm860x i2s",
10091 .stream_name = "audio playback",
101
- .codec_name = "88pm860x-codec",
102
- .platform_name = "mmp-pcm-audio",
103
- .cpu_dai_name = "pxa-ssp-dai.1",
104
- .codec_dai_name = "88pm860x-i2s",
10592 .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF |
10693 SND_SOC_DAIFMT_CBM_CFM,
10794 .init = ttc_pm860x_init,
95
+ SND_SOC_DAILINK_REG(i2s),
10896 },
10997 };
11098