.. | .. |
---|
1 | | -/* |
---|
2 | | - * Lowland audio support |
---|
3 | | - * |
---|
4 | | - * Copyright 2011 Wolfson Microelectronics |
---|
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 | | - */ |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0+ |
---|
| 2 | +// |
---|
| 3 | +// Lowland audio support |
---|
| 4 | +// |
---|
| 5 | +// Copyright 2011 Wolfson Microelectronics |
---|
11 | 6 | |
---|
12 | 7 | #include <sound/soc.h> |
---|
13 | 8 | #include <sound/soc-dapm.h> |
---|
.. | .. |
---|
37 | 32 | |
---|
38 | 33 | static int lowland_wm5100_init(struct snd_soc_pcm_runtime *rtd) |
---|
39 | 34 | { |
---|
40 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
---|
| 35 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
---|
41 | 36 | int ret; |
---|
42 | 37 | |
---|
43 | 38 | ret = snd_soc_component_set_sysclk(component, WM5100_CLK_SYSCLK, |
---|
.. | .. |
---|
70 | 65 | |
---|
71 | 66 | static int lowland_wm9081_init(struct snd_soc_pcm_runtime *rtd) |
---|
72 | 67 | { |
---|
73 | | - struct snd_soc_component *component = rtd->codec_dai->component; |
---|
| 68 | + struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component; |
---|
74 | 69 | |
---|
75 | 70 | snd_soc_dapm_nc_pin(&rtd->card->dapm, "LINEOUT"); |
---|
76 | 71 | |
---|
.. | .. |
---|
87 | 82 | .channels_max = 2, |
---|
88 | 83 | }; |
---|
89 | 84 | |
---|
| 85 | +SND_SOC_DAILINK_DEFS(cpu, |
---|
| 86 | + DAILINK_COMP_ARRAY(COMP_CPU("samsung-i2s.0")), |
---|
| 87 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm5100.1-001a", "wm5100-aif1")), |
---|
| 88 | + DAILINK_COMP_ARRAY(COMP_PLATFORM("samsung-i2s.0"))); |
---|
| 89 | + |
---|
| 90 | +SND_SOC_DAILINK_DEFS(baseband, |
---|
| 91 | + DAILINK_COMP_ARRAY(COMP_CPU("wm5100-aif2")), |
---|
| 92 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm1250-ev1.1-0027", "wm1250-ev1"))); |
---|
| 93 | + |
---|
| 94 | +SND_SOC_DAILINK_DEFS(speaker, |
---|
| 95 | + DAILINK_COMP_ARRAY(COMP_CPU("wm5100-aif3")), |
---|
| 96 | + DAILINK_COMP_ARRAY(COMP_CODEC("wm9081.1-006c", "wm9081-hifi"))); |
---|
| 97 | + |
---|
90 | 98 | static struct snd_soc_dai_link lowland_dai[] = { |
---|
91 | 99 | { |
---|
92 | 100 | .name = "CPU", |
---|
93 | 101 | .stream_name = "CPU", |
---|
94 | | - .cpu_dai_name = "samsung-i2s.0", |
---|
95 | | - .codec_dai_name = "wm5100-aif1", |
---|
96 | | - .platform_name = "samsung-i2s.0", |
---|
97 | | - .codec_name = "wm5100.1-001a", |
---|
98 | 102 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
99 | 103 | SND_SOC_DAIFMT_CBM_CFM, |
---|
100 | 104 | .init = lowland_wm5100_init, |
---|
| 105 | + SND_SOC_DAILINK_REG(cpu), |
---|
101 | 106 | }, |
---|
102 | 107 | { |
---|
103 | 108 | .name = "Baseband", |
---|
104 | 109 | .stream_name = "Baseband", |
---|
105 | | - .cpu_dai_name = "wm5100-aif2", |
---|
106 | | - .codec_dai_name = "wm1250-ev1", |
---|
107 | | - .codec_name = "wm1250-ev1.1-0027", |
---|
108 | 110 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
109 | 111 | SND_SOC_DAIFMT_CBM_CFM, |
---|
110 | 112 | .ignore_suspend = 1, |
---|
| 113 | + SND_SOC_DAILINK_REG(baseband), |
---|
111 | 114 | }, |
---|
112 | 115 | { |
---|
113 | 116 | .name = "Sub Speaker", |
---|
114 | 117 | .stream_name = "Sub Speaker", |
---|
115 | | - .cpu_dai_name = "wm5100-aif3", |
---|
116 | | - .codec_dai_name = "wm9081-hifi", |
---|
117 | | - .codec_name = "wm9081.1-006c", |
---|
118 | 118 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | |
---|
119 | 119 | SND_SOC_DAIFMT_CBM_CFM, |
---|
120 | 120 | .ignore_suspend = 1, |
---|
121 | 121 | .params = &sub_params, |
---|
122 | 122 | .init = lowland_wm9081_init, |
---|
| 123 | + SND_SOC_DAILINK_REG(speaker), |
---|
123 | 124 | }, |
---|
124 | 125 | }; |
---|
125 | 126 | |
---|
126 | 127 | static struct snd_soc_codec_conf lowland_codec_conf[] = { |
---|
127 | 128 | { |
---|
128 | | - .dev_name = "wm9081.1-006c", |
---|
| 129 | + .dlc = COMP_CODEC_CONF("wm9081.1-006c"), |
---|
129 | 130 | .name_prefix = "Sub", |
---|
130 | 131 | }, |
---|
131 | 132 | }; |
---|
.. | .. |
---|
183 | 184 | |
---|
184 | 185 | ret = devm_snd_soc_register_card(&pdev->dev, card); |
---|
185 | 186 | if (ret) |
---|
186 | | - dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", |
---|
187 | | - ret); |
---|
| 187 | + dev_err_probe(&pdev->dev, ret, "snd_soc_register_card() failed\n"); |
---|
188 | 188 | |
---|
189 | 189 | return ret; |
---|
190 | 190 | } |
---|