diff options
Diffstat (limited to 'sound/soc/tegra/trimslice.c')
-rw-r--r-- | sound/soc/tegra/trimslice.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c index 2bdfc550cff8..4a8d5b672c9f 100644 --- a/sound/soc/tegra/trimslice.c +++ b/sound/soc/tegra/trimslice.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/mach-types.h> | 27 | #include <asm/mach-types.h> |
28 | 28 | ||
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/of.h> | ||
30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
31 | #include <linux/slab.h> | 32 | #include <linux/slab.h> |
32 | 33 | ||
@@ -38,9 +39,6 @@ | |||
38 | 39 | ||
39 | #include "../codecs/tlv320aic23.h" | 40 | #include "../codecs/tlv320aic23.h" |
40 | 41 | ||
41 | #include "tegra_das.h" | ||
42 | #include "tegra_i2s.h" | ||
43 | #include "tegra_pcm.h" | ||
44 | #include "tegra_asoc_utils.h" | 42 | #include "tegra_asoc_utils.h" |
45 | 43 | ||
46 | #define DRV_NAME "tegra-snd-trimslice" | 44 | #define DRV_NAME "tegra-snd-trimslice" |
@@ -119,8 +117,8 @@ static struct snd_soc_dai_link trimslice_tlv320aic23_dai = { | |||
119 | .name = "TLV320AIC23", | 117 | .name = "TLV320AIC23", |
120 | .stream_name = "AIC23", | 118 | .stream_name = "AIC23", |
121 | .codec_name = "tlv320aic23-codec.2-001a", | 119 | .codec_name = "tlv320aic23-codec.2-001a", |
122 | .platform_name = "tegra-pcm-audio", | 120 | .platform_name = "tegra20-i2s.0", |
123 | .cpu_dai_name = "tegra-i2s.0", | 121 | .cpu_dai_name = "tegra20-i2s.0", |
124 | .codec_dai_name = "tlv320aic23-hifi", | 122 | .codec_dai_name = "tlv320aic23-hifi", |
125 | .ops = &trimslice_asoc_ops, | 123 | .ops = &trimslice_asoc_ops, |
126 | }; | 124 | }; |
@@ -152,6 +150,32 @@ static __devinit int tegra_snd_trimslice_probe(struct platform_device *pdev) | |||
152 | goto err; | 150 | goto err; |
153 | } | 151 | } |
154 | 152 | ||
153 | if (pdev->dev.of_node) { | ||
154 | trimslice_tlv320aic23_dai.codec_name = NULL; | ||
155 | trimslice_tlv320aic23_dai.codec_of_node = of_parse_phandle( | ||
156 | pdev->dev.of_node, "nvidia,audio-codec", 0); | ||
157 | if (!trimslice_tlv320aic23_dai.codec_of_node) { | ||
158 | dev_err(&pdev->dev, | ||
159 | "Property 'nvidia,audio-codec' missing or invalid\n"); | ||
160 | ret = -EINVAL; | ||
161 | goto err; | ||
162 | } | ||
163 | |||
164 | trimslice_tlv320aic23_dai.cpu_dai_name = NULL; | ||
165 | trimslice_tlv320aic23_dai.cpu_dai_of_node = of_parse_phandle( | ||
166 | pdev->dev.of_node, "nvidia,i2s-controller", 0); | ||
167 | if (!trimslice_tlv320aic23_dai.cpu_dai_of_node) { | ||
168 | dev_err(&pdev->dev, | ||
169 | "Property 'nvidia,i2s-controller' missing or invalid\n"); | ||
170 | ret = -EINVAL; | ||
171 | goto err; | ||
172 | } | ||
173 | |||
174 | trimslice_tlv320aic23_dai.platform_name = NULL; | ||
175 | trimslice_tlv320aic23_dai.platform_of_node = | ||
176 | trimslice_tlv320aic23_dai.cpu_dai_of_node; | ||
177 | } | ||
178 | |||
155 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); | 179 | ret = tegra_asoc_utils_init(&trimslice->util_data, &pdev->dev); |
156 | if (ret) | 180 | if (ret) |
157 | goto err; | 181 | goto err; |
@@ -187,10 +211,17 @@ static int __devexit tegra_snd_trimslice_remove(struct platform_device *pdev) | |||
187 | return 0; | 211 | return 0; |
188 | } | 212 | } |
189 | 213 | ||
214 | static const struct of_device_id trimslice_of_match[] __devinitconst = { | ||
215 | { .compatible = "nvidia,tegra-audio-trimslice", }, | ||
216 | {}, | ||
217 | }; | ||
218 | MODULE_DEVICE_TABLE(of, trimslice_of_match); | ||
219 | |||
190 | static struct platform_driver tegra_snd_trimslice_driver = { | 220 | static struct platform_driver tegra_snd_trimslice_driver = { |
191 | .driver = { | 221 | .driver = { |
192 | .name = DRV_NAME, | 222 | .name = DRV_NAME, |
193 | .owner = THIS_MODULE, | 223 | .owner = THIS_MODULE, |
224 | .of_match_table = trimslice_of_match, | ||
194 | }, | 225 | }, |
195 | .probe = tegra_snd_trimslice_probe, | 226 | .probe = tegra_snd_trimslice_probe, |
196 | .remove = __devexit_p(tegra_snd_trimslice_remove), | 227 | .remove = __devexit_p(tegra_snd_trimslice_remove), |