| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * linux/sound/soc/pxa/ttc_dkb.c |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 20 | 6 | */ |
|---|
| 21 | 7 | #include <linux/module.h> |
|---|
| 22 | 8 | #include <linux/moduleparam.h> |
|---|
| .. | .. |
|---|
| 75 | 61 | |
|---|
| 76 | 62 | static int ttc_pm860x_init(struct snd_soc_pcm_runtime *rtd) |
|---|
| 77 | 63 | { |
|---|
| 78 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
|---|
| 64 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
|---|
| 79 | 65 | |
|---|
| 80 | 66 | /* Headset jack detection */ |
|---|
| 81 | 67 | snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE | |
|---|
| .. | .. |
|---|
| 94 | 80 | } |
|---|
| 95 | 81 | |
|---|
| 96 | 82 | /* 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 | + |
|---|
| 97 | 88 | static struct snd_soc_dai_link ttc_pm860x_hifi_dai[] = { |
|---|
| 98 | 89 | { |
|---|
| 99 | 90 | .name = "88pm860x i2s", |
|---|
| 100 | 91 | .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", |
|---|
| 105 | 92 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
|---|
| 106 | 93 | SND_SOC_DAIFMT_CBM_CFM, |
|---|
| 107 | 94 | .init = ttc_pm860x_init, |
|---|
| 95 | + SND_SOC_DAILINK_REG(i2s), |
|---|
| 108 | 96 | }, |
|---|
| 109 | 97 | }; |
|---|
| 110 | 98 | |
|---|