| .. | .. |
|---|
| 1 | | -/* |
|---|
| 2 | | - * Phytec pcm030 driver for the PSC of the Freescale MPC52xx |
|---|
| 3 | | - * configured as AC97 interface |
|---|
| 4 | | - * |
|---|
| 5 | | - * Copyright 2008 Jon Smirl, Digispeaker |
|---|
| 6 | | - * Author: Jon Smirl <jonsmirl@gmail.com> |
|---|
| 7 | | - * |
|---|
| 8 | | - * This file is licensed under the terms of the GNU General Public License |
|---|
| 9 | | - * version 2. This program is licensed "as is" without any warranty of any |
|---|
| 10 | | - * kind, whether express or implied. |
|---|
| 11 | | - */ |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 2 | +// |
|---|
| 3 | +// Phytec pcm030 driver for the PSC of the Freescale MPC52xx |
|---|
| 4 | +// configured as AC97 interface |
|---|
| 5 | +// |
|---|
| 6 | +// Copyright 2008 Jon Smirl, Digispeaker |
|---|
| 7 | +// Author: Jon Smirl <jonsmirl@gmail.com> |
|---|
| 12 | 8 | |
|---|
| 13 | 9 | #include <linux/init.h> |
|---|
| 14 | 10 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 27 | 23 | struct platform_device *codec_device; |
|---|
| 28 | 24 | }; |
|---|
| 29 | 25 | |
|---|
| 26 | +SND_SOC_DAILINK_DEFS(analog, |
|---|
| 27 | + DAILINK_COMP_ARRAY(COMP_CPU("mpc5200-psc-ac97.0")), |
|---|
| 28 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-hifi")), |
|---|
| 29 | + DAILINK_COMP_ARRAY(COMP_EMPTY())); |
|---|
| 30 | + |
|---|
| 31 | +SND_SOC_DAILINK_DEFS(iec958, |
|---|
| 32 | + DAILINK_COMP_ARRAY(COMP_CPU("mpc5200-psc-ac97.1")), |
|---|
| 33 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9712-codec", "wm9712-aux")), |
|---|
| 34 | + DAILINK_COMP_ARRAY(COMP_EMPTY())); |
|---|
| 35 | + |
|---|
| 30 | 36 | static struct snd_soc_dai_link pcm030_fabric_dai[] = { |
|---|
| 31 | 37 | { |
|---|
| 32 | 38 | .name = "AC97.0", |
|---|
| 33 | 39 | .stream_name = "AC97 Analog", |
|---|
| 34 | | - .codec_dai_name = "wm9712-hifi", |
|---|
| 35 | | - .cpu_dai_name = "mpc5200-psc-ac97.0", |
|---|
| 36 | | - .codec_name = "wm9712-codec", |
|---|
| 40 | + SND_SOC_DAILINK_REG(analog), |
|---|
| 37 | 41 | }, |
|---|
| 38 | 42 | { |
|---|
| 39 | 43 | .name = "AC97.1", |
|---|
| 40 | 44 | .stream_name = "AC97 IEC958", |
|---|
| 41 | | - .codec_dai_name = "wm9712-aux", |
|---|
| 42 | | - .cpu_dai_name = "mpc5200-psc-ac97.1", |
|---|
| 43 | | - .codec_name = "wm9712-codec", |
|---|
| 45 | + SND_SOC_DAILINK_REG(iec958), |
|---|
| 44 | 46 | }, |
|---|
| 45 | 47 | }; |
|---|
| 46 | 48 | |
|---|
| .. | .. |
|---|
| 57 | 59 | struct device_node *platform_np; |
|---|
| 58 | 60 | struct snd_soc_card *card = &pcm030_card; |
|---|
| 59 | 61 | struct pcm030_audio_data *pdata; |
|---|
| 62 | + struct snd_soc_dai_link *dai_link; |
|---|
| 60 | 63 | int ret; |
|---|
| 61 | 64 | int i; |
|---|
| 62 | 65 | |
|---|
| .. | .. |
|---|
| 78 | 81 | return -ENODEV; |
|---|
| 79 | 82 | } |
|---|
| 80 | 83 | |
|---|
| 81 | | - for (i = 0; i < card->num_links; i++) |
|---|
| 82 | | - card->dai_link[i].platform_of_node = platform_np; |
|---|
| 84 | + for_each_card_prelinks(card, i, dai_link) |
|---|
| 85 | + dai_link->platforms->of_node = platform_np; |
|---|
| 83 | 86 | |
|---|
| 84 | 87 | ret = request_module("snd-soc-wm9712"); |
|---|
| 85 | 88 | if (ret) |
|---|